Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
comment out
  • Loading branch information
zth committed May 30, 2024
commit 01d979bee08b3acef5c96489c73aad0fc3589a93
48 changes: 16 additions & 32 deletions analysis/tests/not_compiled/expected/Diagnostics.res.txt
Original file line number Diff line number Diff line change
@@ -1,33 +1,17 @@

Syntax error!
not_compiled/Diagnostics.res:1:5

1 │ let = 1 + 1.0
2 │ let add = =2
3 │ lett a = 2

I was expecting a name for this let-binding. Example: `let message = "hello"`


Syntax error!
not_compiled/Diagnostics.res:2:10-11

1 │ let = 1 + 1.0
2 │ let add = =2
3 │ lett a = 2
4 │

This let-binding misses an expression


Syntax error!
not_compiled/Diagnostics.res:3:5-6

1 │ let = 1 + 1.0
2 │ let add = =2
3 │ lett a = 2
4 │
5 │ //^dia

consecutive statements on a line must be separated by ';' or a newline
[{
"range": {"start": {"line": 2, "character": 4}, "end": {"line": 2, "character": 6}},
"message": "consecutive statements on a line must be separated by ';' or a newline",
"severity": 1,
"source": "ReScript"
}, {
"range": {"start": {"line": 1, "character": 9}, "end": {"line": 1, "character": 11}},
"message": "This let-binding misses an expression",
"severity": 1,
"source": "ReScript"
}, {
"range": {"start": {"line": 0, "character": 4}, "end": {"line": 0, "character": 5}},
"message": "I was expecting a name for this let-binding. Example: `let message = \"hello\"`",
"severity": 1,
"source": "ReScript"
}]

20 changes: 0 additions & 20 deletions analysis/tests/not_compiled/expected/DocTemplate.res.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
type a = {a: int}
// ^xfm

type rec t = A | B
// ^xfm
and e = C
@unboxed type name = Name(string)
// ^xfm
let a = 1
// ^xfm
let inc = x => x + 1
// ^xfm
module T = {
// ^xfm
let b = 1
// ^xfm
}
@module("path")
external dirname: string => string = "dirname"
//^xfm
Xform not_compiled/DocTemplate.res 3:3
can't find module DocTemplate
Hit: Add Documentation template
Expand Down
20 changes: 0 additions & 20 deletions analysis/tests/not_compiled/expected/DocTemplate.resi.txt
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
type a = {a: int}
// ^xfm

type rec t = A | B
// ^xfm
and e = C
@unboxed type name = Name(string)
// ^xfm
let a: int
// ^xfm
let inc: int => int
// ^xfm
module T: {
// ^xfm
let b: int
// ^xfm
}
@module("path")
external dirname: string => string = "dirname"
//^xfm
Xform not_compiled/DocTemplate.resi 3:3
Hit: Add Documentation template

Expand Down
4 changes: 0 additions & 4 deletions analysis/tests/src/expected/Auto.res.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
open! ShadowedBelt

let m = List.map
// ^hov
Hover src/Auto.res 2:13
{"contents": {"kind": "markdown", "value": "```rescript\n(list<'a>, 'a => 'b) => list<'b>\n```"}}

13 changes: 0 additions & 13 deletions analysis/tests/src/expected/BrokenParserCases.res.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
// --- BROKEN PARSER CASES ---
// This below demonstrates an issue when what you're completing is the _last_ labelled argument, and there's a unit application after it. The parser wrongly merges the unit argument as the expression of the labelled argument assignment, where is should really let the trailing unit argument be, and set a %rescript.exprhole as the expression of the assignment, just like it normally does.
// let _ = someFn(~isOff=, ())
// ^com

// This should parse as a single item tuple when in a pattern?
// switch s { | (t) }
// ^com

// Here the parser eats the arrow and considers the None in the expression part of the pattern.
// let _ = switch x { | None | => None }
// ^com

Complete src/BrokenParserCases.res 2:24
posCursor:[2:24] posNoWhite:[2:23] Found expr:[2:11->2:30]
Pexp_apply ...[2:11->2:17] (~isOff2:19->2:24=...[2:27->2:29])
Expand Down
11 changes: 0 additions & 11 deletions analysis/tests/src/expected/CodeLens.res.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
let add = (x, y) => x + y

let foo = (~age, ~name) => name ++ string_of_int(age)

let ff = (~opt1=0, ~a, ~b, (), ~opt2=0, (), ~c) => a + b + c + opt1 + opt2

let compFF = Completion.ff

@react.component
let make = (~name) => React.string(name)
//^cle
Code Lens src/CodeLens.res
[{
"range": {"start": {"line": 9, "character": 4}, "end": {"line": 9, "character": 8}},
Expand Down
9 changes: 0 additions & 9 deletions analysis/tests/src/expected/Codemod.res.txt
Original file line number Diff line number Diff line change
@@ -1,12 +1,3 @@
type someTyp = [#valid | #invalid]

let ff = (v1: someTyp, v2: someTyp) => {
let x = switch (v1, v2) {
// ^c-a (#valid, #valid) | (#invalid, _)
| (#valid, #invalid) => ()
}
x
}
Codemod AddMissingCasessrc/Codemod.res 3:10
switch (v1, v2) {
// ^c-a (#valid, #valid) | (#invalid, _)
Expand Down
15 changes: 0 additions & 15 deletions analysis/tests/src/expected/CompletableComponent.res.txt
Original file line number Diff line number Diff line change
@@ -1,15 +0,0 @@
type status = On | Off

@@jsxConfig({version: 4, mode: "automatic"})
type props<'status, 'name> = {status: 'status, name: 'name}

let make = ({status, name, _}: props<status, string>) => {
ignore(status)
ignore(name)
React.null
}
let make = {
let \"CompletableComponent" = (props: props<_>) => make(props)

\"CompletableComponent"
}
7 changes: 0 additions & 7 deletions analysis/tests/src/expected/CompletePrioritize1.res.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
module Test = {
type t = {name: int}
let add = (a: float) => a +. 1.0
}
let a: Test.t = {name: 4}
// a->
// ^com
Complete src/CompletePrioritize1.res 5:6
posCursor:[5:6] posNoWhite:[5:5] Found expr:[5:3->0:-1]
Completable: Cpath Value[a]->
Expand Down
14 changes: 0 additions & 14 deletions analysis/tests/src/expected/CompletePrioritize2.res.txt
Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
let ax = 4
let _ = ax
let ax = ""
let _ = ax
module Test = {
type t = {name: int}
let add = (ax: t) => ax.name + 1
}
let ax: Test.t = {name: 4}
// ax->
// ^com

// ax
// ^com
Complete src/CompletePrioritize2.res 9:7
posCursor:[9:7] posNoWhite:[9:6] Found expr:[9:3->0:-1]
Completable: Cpath Value[ax]->
Expand Down
Loading