Skip to content

Commit 96aa78f

Browse files
committed
do not care about ExtractedType now that we have incremental type checking
1 parent d7e5ec8 commit 96aa78f

File tree

3 files changed

+69
-157
lines changed

3 files changed

+69
-157
lines changed

analysis/src/CompletionBackEnd.ml

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1029,30 +1029,11 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
10291029
|> completionsGetTypeEnv2 ~debug ~full ~opens ~rawOpens ~pos
10301030
in
10311031
match mainTypeCompletionEnv with
1032-
| None -> (
1032+
| None ->
10331033
if Debug.verbose () then
10341034
Printf.printf
1035-
"[dot_completion] Could not extract main type completion env. \
1036-
Checking for extracted type.\n";
1037-
1038-
match
1039-
completionsFromCtxPath
1040-
|> completionsGetCompletionType2 ~debug ~full ~opens ~rawOpens ~pos
1041-
with
1042-
| Some (ExtractedType typ, env) -> (
1043-
if Debug.verbose () then
1044-
Printf.printf "[dot_completion] Found extracted type\n";
1045-
1046-
match typ with
1047-
| Trecord {fields; definition} ->
1048-
fields
1049-
|> DotCompletionUtils.filterRecordFields ~env ~prefix:fieldName ~exact
1050-
~recordAsString:
1051-
(match definition with
1052-
| `NameOnly name -> "type " ^ name
1053-
| `TypeExpr t -> Shared.typeToString t)
1054-
| _ -> [])
1055-
| None | Some (TypeExpr _, _) -> [])
1035+
"[dot_completion] Could not extract main type completion env.\n";
1036+
[]
10561037
| Some (typ, env) ->
10571038
if Debug.verbose () then
10581039
Printf.printf "[dot_completion] env module path: %s, type: %s\n"

analysis/tests/src/CompletionInferValues.res

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,6 @@ module Div = {
5454
// let _ = <div onMouseEnter={event => { let btn = event->JsxEvent.Mouse.button->Belt.Int.toString->Js.String2.split("/"); btn->ma }} />
5555
// ^com
5656

57-
// let x: someRecord = {name: "Hello", age: 123}; x.
58-
// ^com
59-
6057
type someVariant = One | Two | Three(int, string)
6158
type somePolyVariant = [#one | #two | #three(int, string)]
6259
type someNestedRecord = {someRecord: someRecord}
@@ -115,10 +112,6 @@ type otherNestedRecord = {
115112
// let x: otherNestedRecord; switch x { | {optRecord:Some({name})} => name->slic }
116113
// ^com
117114

118-
// Follow arrays
119-
// let x: array<otherNestedRecord>; switch x { | [inner] => inner.s }
120-
// ^com
121-
122115
// Infer top level return
123116
// let x = 123; switch x { | 123 => () | v => v->toSt }
124117
// ^com

0 commit comments

Comments
 (0)