diff --git a/.gitignore b/.gitignore index e7b7a1ca8..432ac9ab6 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,9 @@ analysis/tests/.bsb.lock analysis/tests-generic-jsx-transform/lib analysis/tests-generic-jsx-transform/.bsb.lock +analysis/tests-incremental-typechecking/lib +analysis/tests-incremental-typechecking/.bsb.lock + tools/node_modules tools/lib tools/**/*.res.js diff --git a/CHANGELOG.md b/CHANGELOG.md index 549ea5b6c..e49e0b14e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,10 @@ - Extend signature help to work on constructor payloads as well. Can be turned off if wanted through settings. https://github.com/rescript-lang/rescript-vscode/pull/947 +#### :nail_care: Polish + +- Enhance variant constructor payload completion. https://github.com/rescript-lang/rescript-vscode/pull/946 + ## 1.48.0 #### :bug: Bug Fix diff --git a/analysis/Makefile b/analysis/Makefile index e0e190d30..70c211afb 100644 --- a/analysis/Makefile +++ b/analysis/Makefile @@ -6,10 +6,13 @@ build-tests: build-tests-generic-jsx-transform: make -C tests-generic-jsx-transform build +build-tests-incremental-typechecking: + make -C tests-incremental-typechecking build + build-reanalyze: make -C reanalyze build -build: build-reanalyze build-tests build-tests-generic-jsx-transform +build: build-reanalyze build-tests build-tests-generic-jsx-transform build-tests-incremental-typechecking dce: build-analysis-binary opam exec reanalyze.exe -- -dce-cmt _build -suppress vendor @@ -17,6 +20,7 @@ dce: build-analysis-binary test-analysis-binary: make -C tests test make -C tests-generic-jsx-transform test + make -C tests-incremental-typechecking test test-reanalyze: make -C reanalyze test @@ -25,6 +29,8 @@ test: test-analysis-binary test-reanalyze clean: make -C tests clean + make -C tests-generic-jsx-transform clean + make -C tests-incremental-typechecking clean make -C reanalyze clean .PHONY: build-reanalyze build-tests dce clean test diff --git a/analysis/src/CompletionExpressions.ml b/analysis/src/CompletionExpressions.ml index f061a03fa..d000294da 100644 --- a/analysis/src/CompletionExpressions.ml +++ b/analysis/src/CompletionExpressions.ml @@ -255,3 +255,37 @@ let prettyPrintFnTemplateArgName ?currentIndex ~env ~full (someName |> Utils.lowercaseFirstChar) ^ suffix | _ -> defaultVarName) | _ -> defaultVarName) + +let completeConstructorPayload ~posBeforeCursor ~firstCharBeforeCursorNoWhite + (constructorLid : Longident.t Location.loc) expr = + match + traverseExpr expr ~exprPath:[] ~pos:posBeforeCursor + ~firstCharBeforeCursorNoWhite + with + | None -> None + | Some (prefix, nested) -> + (* The nested path must start with the constructor name found, plus + the target argument number for the constructor. We translate to + that here, because we need to account for multi arg constructors + being represented as tuples. *) + let nested = + match List.rev nested with + | Completable.NTupleItem {itemNum} :: rest -> + [ + Completable.NVariantPayload + {constructorName = Longident.last constructorLid.txt; itemNum}; + ] + @ rest + | nested -> + [ + Completable.NVariantPayload + {constructorName = Longident.last constructorLid.txt; itemNum = 0}; + ] + @ nested + in + let variantCtxPath = + Completable.CTypeAtPos + {constructorLid.loc with loc_start = constructorLid.loc.loc_end} + in + Some + (Completable.Cexpression {contextPath = variantCtxPath; prefix; nested}) diff --git a/analysis/src/CompletionFrontEnd.ml b/analysis/src/CompletionFrontEnd.ml index 26871bc14..29d09cc47 100644 --- a/analysis/src/CompletionFrontEnd.ml +++ b/analysis/src/CompletionFrontEnd.ml @@ -1058,7 +1058,9 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor && expr |> Res_parsetree_viewer.isBracedExpr then ValueOrField else Value ))) - | Pexp_construct (lid, eOpt) -> + | Pexp_construct ({txt = Lident ("::" | "()")}, _) -> + (* Ignore list expressions, used in JSX, unit, and more *) () + | Pexp_construct (lid, eOpt) -> ( let lidPath = flattenLidCheckDot lid in if debug && lid.txt <> Lident "Function$" then Printf.printf "Pexp_construct %s:%s %s\n" @@ -1071,6 +1073,19 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor eOpt = None && (not lid.loc.loc_ghost) && lid.loc |> Loc.hasPos ~pos:posBeforeCursor then setResult (Cpath (CPId (lidPath, Value))) + else + match eOpt with + | Some e when locHasCursor e.pexp_loc -> ( + match + CompletionExpressions.completeConstructorPayload + ~posBeforeCursor ~firstCharBeforeCursorNoWhite lid e + with + | Some result -> + (* Check if anything else more important completes before setting this completion. *) + Ast_iterator.default_iterator.expr iterator e; + setResult result + | None -> ()) + | _ -> ()) | Pexp_field (e, fieldName) -> ( if debug then Printf.printf "Pexp_field %s %s:%s\n" (Loc.toString e.pexp_loc) diff --git a/analysis/tests-generic-jsx-transform/src/GenericJsxCompletion.res b/analysis/tests-generic-jsx-transform/src/GenericJsxCompletion.res index 7b4e3824f..babce4b57 100644 --- a/analysis/tests-generic-jsx-transform/src/GenericJsxCompletion.res +++ b/analysis/tests-generic-jsx-transform/src/GenericJsxCompletion.res @@ -1,25 +1,25 @@ -//
{ - let someString = "" + let someString = "" let someInt = 12 let someArr = [GenericJsx.null] ignore(someInt) ignore(someArr) // someString->st // ^com - open GenericJsx + open GenericJsx
- {GenericJsx.string(someProp)} + {GenericJsx.string(someProp ++ someString)}
{GenericJsx.null}
// {someString->st} // ^com
} -} \ No newline at end of file +} diff --git a/analysis/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt b/analysis/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt index 3707266be..9368a52a3 100644 --- a/analysis/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt +++ b/analysis/tests-generic-jsx-transform/src/expected/GenericJsxCompletion.res.txt @@ -50,7 +50,7 @@ Path GenericJsx.Elements.props Complete src/GenericJsxCompletion.res 14:21 posCursor:[14:21] posNoWhite:[14:20] Found expr:[8:13->23:3] posCursor:[14:21] posNoWhite:[14:20] Found expr:[8:14->23:3] -posCursor:[14:21] posNoWhite:[14:20] Found expr:[9:1->22:10] +posCursor:[14:21] posNoWhite:[14:20] Found expr:[9:4->22:10] posCursor:[14:21] posNoWhite:[14:20] Found expr:[10:4->22:10] posCursor:[14:21] posNoWhite:[14:20] Found expr:[11:4->22:10] posCursor:[14:21] posNoWhite:[14:20] Found expr:[12:4->22:10] @@ -90,22 +90,19 @@ Path Js.String2.st Complete src/GenericJsxCompletion.res 20:24 posCursor:[20:24] posNoWhite:[20:23] Found expr:[8:13->23:3] posCursor:[20:24] posNoWhite:[20:23] Found expr:[8:14->23:3] -posCursor:[20:24] posNoWhite:[20:23] Found expr:[9:1->22:10] +posCursor:[20:24] posNoWhite:[20:23] Found expr:[9:4->22:10] posCursor:[20:24] posNoWhite:[20:23] Found expr:[10:4->22:10] posCursor:[20:24] posNoWhite:[20:23] Found expr:[11:4->22:10] posCursor:[20:24] posNoWhite:[20:23] Found expr:[12:4->22:10] posCursor:[20:24] posNoWhite:[20:23] Found expr:[13:4->22:10] -posCursor:[20:24] posNoWhite:[20:23] Found expr:[16:1->22:10] +posCursor:[20:24] posNoWhite:[20:23] Found expr:[16:4->22:10] posCursor:[20:24] posNoWhite:[20:23] Found expr:[17:5->22:10] JSX 17:8] > _children:17:8 posCursor:[20:24] posNoWhite:[20:23] Found expr:[17:8->22:4] -Pexp_construct :::[18:7->22:4] [18:7->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[18:7->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[19:7->22:4] -Pexp_construct :::[19:7->22:4] [19:7->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[19:7->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->22:4] -Pexp_construct :::[20:10->22:4] [20:10->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->22:4] posCursor:[20:24] posNoWhite:[20:23] Found expr:[20:10->20:24] Completable: Cpath Value[someString]->st <> diff --git a/analysis/tests-incremental-typechecking/Makefile b/analysis/tests-incremental-typechecking/Makefile new file mode 100644 index 000000000..33e0783fb --- /dev/null +++ b/analysis/tests-incremental-typechecking/Makefile @@ -0,0 +1,17 @@ +SHELL = /bin/bash + +node_modules/.bin/rescript: + npm install + +build: node_modules/.bin/rescript + node_modules/.bin/rescript > /dev/null || true + +test: build + ./test.sh + +clean: + rm -r node_modules lib + +.DEFAULT_GOAL := test + +.PHONY: clean test diff --git a/analysis/tests-incremental-typechecking/package-lock.json b/analysis/tests-incremental-typechecking/package-lock.json new file mode 100644 index 000000000..b3161b799 --- /dev/null +++ b/analysis/tests-incremental-typechecking/package-lock.json @@ -0,0 +1,33 @@ +{ + "name": "tests-incremental-typechecking", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "dependencies": { + "rescript": "11.1.0-rc.2" + } + }, + "node_modules/rescript": { + "version": "11.1.0-rc.2", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0-rc.2.tgz", + "integrity": "sha512-kCUtmsODEUF1Eth5ppc+yIK79HLI7CwRs1R4iopDek4FC58IqHSLT3K1XHGB39YCWuOuV9WMly+wksHRJcSLcw==", + "hasInstallScript": true, + "bin": { + "bsc": "bsc", + "bstracing": "lib/bstracing", + "rescript": "rescript" + }, + "engines": { + "node": ">=10" + } + } + }, + "dependencies": { + "rescript": { + "version": "11.1.0-rc.2", + "resolved": "https://registry.npmjs.org/rescript/-/rescript-11.1.0-rc.2.tgz", + "integrity": "sha512-kCUtmsODEUF1Eth5ppc+yIK79HLI7CwRs1R4iopDek4FC58IqHSLT3K1XHGB39YCWuOuV9WMly+wksHRJcSLcw==" + } + } +} diff --git a/analysis/tests-incremental-typechecking/package.json b/analysis/tests-incremental-typechecking/package.json new file mode 100644 index 000000000..000126246 --- /dev/null +++ b/analysis/tests-incremental-typechecking/package.json @@ -0,0 +1,10 @@ +{ + "scripts": { + "build": "rescript", + "clean": "rescript clean -with-deps" + }, + "private": true, + "dependencies": { + "rescript": "11.1.0-rc.2" + } +} diff --git a/analysis/tests-incremental-typechecking/rescript.json b/analysis/tests-incremental-typechecking/rescript.json new file mode 100644 index 000000000..22fafc047 --- /dev/null +++ b/analysis/tests-incremental-typechecking/rescript.json @@ -0,0 +1,11 @@ +{ + "name": "test-generic-jsx-transform", + "sources": [ + { + "dir": "src", + "subdirs": true + } + ], + "bsc-flags": ["-w -33-44-8"], + "jsx": { "module": "GenericJsx" } +} diff --git a/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Json.res b/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Json.res new file mode 100644 index 000000000..5173fefec --- /dev/null +++ b/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Json.res @@ -0,0 +1,2 @@ +let x = Js.Json.Array() +// ^com diff --git a/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Own.res b/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Own.res new file mode 100644 index 000000000..b77e1f4ec --- /dev/null +++ b/analysis/tests-incremental-typechecking/src/ConstructorCompletion__Own.res @@ -0,0 +1,6 @@ +module WithVariant = { + type t = One({miss: bool}) | Two(bool) +} + +let x = WithVariant.One() +// ^com diff --git a/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt b/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt new file mode 100644 index 000000000..97b5054db --- /dev/null +++ b/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Json.res.txt @@ -0,0 +1,20 @@ +Complete src/ConstructorCompletion__Json.res 0:22 +posCursor:[0:22] posNoWhite:[0:21] Found expr:[0:8->0:23] +Pexp_construct Js +Json +Array:[0:8->0:21] [0:21->0:23] +Completable: Cexpression CTypeAtPos()->variantPayload::Array($0) +Package opens Pervasives.JsxModules.place holder +Resolved opens 1 pervasives +ContextPath CTypeAtPos() +[{ + "label": "[]", + "kind": 12, + "tags": [], + "detail": "t", + "documentation": null, + "sortText": "A", + "insertText": "[$0]", + "insertTextFormat": 2 + }] + diff --git a/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt b/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt new file mode 100644 index 000000000..a16224fb4 --- /dev/null +++ b/analysis/tests-incremental-typechecking/src/expected/ConstructorCompletion__Own.res.txt @@ -0,0 +1,19 @@ +Complete src/ConstructorCompletion__Own.res 4:24 +posCursor:[4:24] posNoWhite:[4:23] Found expr:[4:8->4:25] +Pexp_construct WithVariant +One:[4:8->4:23] [4:23->4:25] +Completable: Cexpression CTypeAtPos()->variantPayload::One($0) +Package opens Pervasives.JsxModules.place holder +Resolved opens 1 pervasives +ContextPath CTypeAtPos() +[{ + "label": "{}", + "kind": 4, + "tags": [], + "detail": "Inline record", + "documentation": null, + "sortText": "A", + "insertText": "{$0}", + "insertTextFormat": 2 + }] + diff --git a/analysis/tests-incremental-typechecking/test.sh b/analysis/tests-incremental-typechecking/test.sh new file mode 100755 index 000000000..ec23433ba --- /dev/null +++ b/analysis/tests-incremental-typechecking/test.sh @@ -0,0 +1,21 @@ +for file in src/*.res; do + output="$(dirname $file)/expected/$(basename $file).txt" + ../../rescript-editor-analysis.exe test $file &> $output + # CI. We use LF, and the CI OCaml fork prints CRLF. Convert. + if [ "$RUNNER_OS" == "Windows" ]; then + perl -pi -e 's/\r\n/\n/g' -- $output + fi +done + +warningYellow='\033[0;33m' +successGreen='\033[0;32m' +reset='\033[0m' + +diff=$(git ls-files --modified src/expected) +if [[ $diff = "" ]]; then + printf "${successGreen}✅ No unstaged tests difference.${reset}\n" +else + printf "${warningYellow}⚠️ There are unstaged differences in tests/! Did you break a test?\n${diff}\n${reset}" + git --no-pager diff src/expected + exit 1 +fi diff --git a/analysis/tests/src/expected/CompletionJsx.res.txt b/analysis/tests/src/expected/CompletionJsx.res.txt index 123606be2..3760079bb 100644 --- a/analysis/tests/src/expected/CompletionJsx.res.txt +++ b/analysis/tests/src/expected/CompletionJsx.res.txt @@ -71,13 +71,10 @@ posCursor:[18:24] posNoWhite:[18:23] Found expr:[12:4->32:10] posCursor:[18:24] posNoWhite:[18:23] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[18:24] posNoWhite:[18:23] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[16:7->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[17:7->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->32:4] -Pexp_construct :::[18:10->32:4] [18:10->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->32:4] posCursor:[18:24] posNoWhite:[18:23] Found expr:[18:10->18:24] Completable: Cpath Value[someString]->st <> @@ -120,13 +117,10 @@ posCursor:[20:27] posNoWhite:[20:26] Found expr:[12:4->32:10] posCursor:[20:27] posNoWhite:[20:26] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[20:27] posNoWhite:[20:26] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[16:7->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[17:7->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->32:4] -Pexp_construct :::[20:10->32:4] [20:10->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->32:4] posCursor:[20:27] posNoWhite:[20:26] Found expr:[20:10->20:27] Completable: Cpath string->st <> @@ -168,13 +162,10 @@ posCursor:[22:44] posNoWhite:[22:43] Found expr:[12:4->32:10] posCursor:[22:44] posNoWhite:[22:43] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[22:44] posNoWhite:[22:43] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[16:7->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[17:7->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[22:10->32:4] -Pexp_construct :::[22:10->32:4] [22:10->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[22:10->32:4] posCursor:[22:44] posNoWhite:[22:43] Found expr:[22:10->22:44] Completable: Cpath Value[Js, String2, trim](Nolabel)->st <> @@ -218,13 +209,10 @@ posCursor:[24:19] posNoWhite:[24:18] Found expr:[12:4->32:10] posCursor:[24:19] posNoWhite:[24:18] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[24:19] posNoWhite:[24:18] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[16:7->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[17:7->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->32:4] -Pexp_construct :::[24:10->32:4] [24:10->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->32:4] posCursor:[24:19] posNoWhite:[24:18] Found expr:[24:10->0:-1] Completable: Cpath Value[someInt]-> <> @@ -303,13 +291,10 @@ posCursor:[26:14] posNoWhite:[26:13] Found expr:[12:4->32:10] posCursor:[26:14] posNoWhite:[26:13] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[26:14] posNoWhite:[26:13] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[16:7->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[17:7->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->32:4] -Pexp_construct :::[26:10->32:4] [26:10->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->32:4] posCursor:[26:14] posNoWhite:[26:13] Found expr:[26:10->0:-1] Completable: Cpath int-> <> @@ -387,13 +372,10 @@ posCursor:[28:20] posNoWhite:[28:19] Found expr:[12:4->32:10] posCursor:[28:20] posNoWhite:[28:19] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[28:20] posNoWhite:[28:19] Found expr:[15:8->32:4] -Pexp_construct :::[16:7->32:4] [16:7->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[16:7->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[17:7->32:4] -Pexp_construct :::[17:7->32:4] [17:7->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[17:7->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->32:4] -Pexp_construct :::[28:10->32:4] [28:10->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->32:4] posCursor:[28:20] posNoWhite:[28:19] Found expr:[28:10->28:20] Completable: Cpath Value[someArr]->a <> @@ -430,13 +412,10 @@ posCursor:[30:12] posNoWhite:[30:11] Found expr:[12:4->32:10] posCursor:[30:12] posNoWhite:[30:11] Found expr:[15:5->32:10] JSX 15:8] > _children:15:8 posCursor:[30:12] posNoWhite:[30:11] Found expr:[15:8->33:2] -Pexp_construct :::[16:7->33:2] [16:7->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[16:7->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[17:7->33:2] -Pexp_construct :::[17:7->33:2] [17:7->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[17:7->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[30:10->33:2] -Pexp_construct :::[30:10->33:2] [30:10->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[30:10->33:2] posCursor:[30:12] posNoWhite:[30:11] Found expr:[30:10->32:10] JSX 30:12] div[32:6->32:9]=...[32:6->32:9]> _children:32:9 diff --git a/analysis/tests/src/expected/Fragment.res.txt b/analysis/tests/src/expected/Fragment.res.txt index adb67f8d8..ae23ede19 100644 --- a/analysis/tests/src/expected/Fragment.res.txt +++ b/analysis/tests/src/expected/Fragment.res.txt @@ -6,7 +6,6 @@ the type is not great but jump to definition works Hover src/Fragment.res 9:56 Nothing at that position. Now trying to use completion. posCursor:[9:56] posNoWhite:[9:55] Found expr:[9:10->9:67] -Pexp_construct :::[9:13->9:67] [9:13->9:67] posCursor:[9:56] posNoWhite:[9:55] Found expr:[9:13->9:67] posCursor:[9:56] posNoWhite:[9:55] Found expr:[9:13->9:66] JSX 9:26] > _children:9:26 diff --git a/analysis/tests/src/expected/Jsx2.res.txt b/analysis/tests/src/expected/Jsx2.res.txt index ed35db333..82ea87673 100644 --- a/analysis/tests/src/expected/Jsx2.res.txt +++ b/analysis/tests/src/expected/Jsx2.res.txt @@ -313,13 +313,11 @@ Pexp_apply ...[83:20->83:21] (...[80:4->83:19], ...[84:2->85:69]) posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:4->83:19] JSX 80:5] > _children:80:5 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:5->83:20] -Pexp_construct :::[83:0->83:20] [83:0->83:20] posCursor:[80:6] posNoWhite:[80:5] Found expr:__ghost__[80:5->83:20] Pexp_construct []:__ghost__[80:5->83:20] None posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:4->83:19] JSX 80:5] > _children:80:5 posCursor:[80:6] posNoWhite:[80:5] Found expr:[80:5->83:20] -Pexp_construct :::[83:0->83:20] [83:0->83:20] posCursor:[80:6] posNoWhite:[80:5] Found expr:__ghost__[80:5->83:20] Pexp_construct []:__ghost__[80:5->83:20] None [] @@ -533,7 +531,6 @@ Path Nested. Hover src/Jsx2.res 162:12 Nothing at that position. Now trying to use completion. posCursor:[162:12] posNoWhite:[162:11] Found expr:[162:3->162:21] -Pexp_construct :::[162:6->162:21] [162:6->162:21] posCursor:[162:12] posNoWhite:[162:11] Found expr:[162:6->162:21] posCursor:[162:12] posNoWhite:[162:11] Found expr:[162:6->162:20] JSX 162:10] age[162:11->162:14]=...[162:15->162:17]> _children:162:18 @@ -546,10 +543,8 @@ Path Comp.make Hover src/Jsx2.res 167:16 Nothing at that position. Now trying to use completion. posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:3->167:30] -Pexp_construct :::[167:7->167:30] [167:7->167:30] posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:7->167:30] posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:7->167:25] -Pexp_construct :::[167:10->167:25] [167:10->167:25] posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:10->167:25] posCursor:[167:16] posNoWhite:[167:15] Found expr:[167:10->167:24] JSX 167:14] age[167:15->167:18]=...[167:19->167:21]> _children:167:22 diff --git a/analysis/tests/src/expected/TypeAtPosCompletion.res.txt b/analysis/tests/src/expected/TypeAtPosCompletion.res.txt index 8a334e9c6..3aa2e61e3 100644 --- a/analysis/tests/src/expected/TypeAtPosCompletion.res.txt +++ b/analysis/tests/src/expected/TypeAtPosCompletion.res.txt @@ -21,7 +21,6 @@ ContextPath CTypeAtPos() Complete src/TypeAtPosCompletion.res 16:18 posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:8->19:1] Pexp_construct One:[13:8->13:11] [13:11->19:1] -posCursor:[16:18] posNoWhite:[16:16] Found expr:[13:11->19:1] posCursor:[16:18] posNoWhite:[16:16] Found expr:[15:2->18:3] Completable: Cexpression CTypeAtPos()->variantPayload::One($1), recordBody Package opens Pervasives.JsxModules.place holder