Skip to content

Commit abebd90

Browse files
authored
Bugfixes for type resolutions (#892)
* debugging-type-resolution * wip * break it again * revert a few tests * more cleanup * pass type arg ctx around properly * cleanup and restore * restore merged functionality * cleanup usages of old extractType from outside of TypeUtils * change to regular ifs * turn off verbose logging * fix type args env for type manifests * better * remove old resolveNested entirely * cleanup * changelog * changelog
1 parent a050ac3 commit abebd90

22 files changed

+1306
-217
lines changed

.vscode/settings.json

+12-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"editor.insertSpaces": false,
3-
"tslint.enable": true,
4-
"typescript.tsc.autoDetect": "off",
5-
"typescript.preferences.quoteStyle": "single",
6-
"editor.codeActionsOnSave": {
7-
"source.fixAll.eslint": true
8-
},
9-
"ocaml.sandbox": {
10-
"kind": "opam",
11-
"switch": "${workspaceFolder:rescript-vscode}/analysis"
12-
}
13-
}
2+
"editor.insertSpaces": false,
3+
"tslint.enable": true,
4+
"typescript.tsc.autoDetect": "off",
5+
"typescript.preferences.quoteStyle": "single",
6+
"editor.codeActionsOnSave": {
7+
"source.fixAll.eslint": "explicit"
8+
},
9+
"ocaml.sandbox": {
10+
"kind": "opam",
11+
"switch": "4.14.0"
12+
}
13+
}

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
- Complete for maker-style functions (functions returning type `t` of a module) when encountering a `type t` in relevant scenarios. https://github.com/rescript-lang/rescript-vscode/pull/884
2525
- Expand type aliases in hovers. https://github.com/rescript-lang/rescript-vscode/pull/881
2626

27+
#### :bug: Bug Fix
28+
29+
- Many bugfixes around nested pattern and expression completion. https://github.com/rescript-lang/rescript-vscode/pull/892
30+
2731
#### :nail_care: Polish
2832

2933
- Better error recovery when analysis fails. https://github.com/rescript-lang/rescript-vscode/pull/880

analysis/.ocamlformat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
profile = default
2-
version = 0.22.4
2+
version = 0.26.1
33

44
field-space = tight-decl
55
break-cases = toplevel

analysis/dune-project

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
(ocaml
1818
(>= 4.10))
1919
(ocamlformat
20-
(= 0.22.4))
20+
(= 0.26.1))
2121
(cppo
2222
(= 1.6.9))
2323
(reanalyze

analysis/rescript-vscode.opam

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ homepage: "https://github.com/rescript-lang/rescript-vscode"
77
bug-reports: "https://github.com/rescript-lang/rescript-vscode/issues"
88
depends: [
99
"ocaml" {>= "4.10"}
10-
"ocamlformat" {= "0.22.4"}
10+
"ocamlformat" {= "0.26.1"}
1111
"cppo" {= "1.6.9"}
1212
"reanalyze" {= "2.23.0"}
1313
"dune"

analysis/src/Cli.ml

+5-4
Original file line numberDiff line numberDiff line change
@@ -144,10 +144,11 @@ let main () =
144144
~maxLength ~debug
145145
| [_; "codeLens"; path] -> Commands.codeLens ~path ~debug
146146
| [_; "extractDocs"; path] ->
147-
148-
let () = match Sys.getenv_opt "FROM_COMPILER" with
149-
| Some("true") -> Cfg.isDocGenFromCompiler := true
150-
| _ -> () in
147+
let () =
148+
match Sys.getenv_opt "FROM_COMPILER" with
149+
| Some "true" -> Cfg.isDocGenFromCompiler := true
150+
| _ -> ()
151+
in
151152

152153
DocExtraction.extractDocs ~path ~debug
153154
| [_; "codeAction"; path; startLine; startCol; endLine; endCol; currentFile]

analysis/src/Commands.ml

+3-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let references ~path ~pos ~debug =
163163
in
164164
print_endline
165165
(if allLocs = [] then Protocol.null
166-
else "[\n" ^ (allLocs |> String.concat ",\n") ^ "\n]")
166+
else "[\n" ^ (allLocs |> String.concat ",\n") ^ "\n]")
167167

168168
let rename ~path ~pos ~newName ~debug =
169169
let result =
@@ -304,6 +304,8 @@ let test ~path =
304304
(match String.sub rest 0 3 with
305305
| "db+" -> Log.verbose := true
306306
| "db-" -> Log.verbose := false
307+
| "dv+" -> Debug.debugLevel := Verbose
308+
| "dv-" -> Debug.debugLevel := Off
307309
| "def" ->
308310
print_endline
309311
("Definition " ^ path ^ " " ^ string_of_int line ^ ":"

0 commit comments

Comments
 (0)