-
Notifications
You must be signed in to change notification settings - Fork 456
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Complete tagged template application (#7278)
* WIP tagged template completion * Ensure debug logging is behind flag * Include completions of alias * Turn off evenMoreCompletions * Add support for tagged template + dot in FrontEnd. * Revert change to pipe * Yeah this is the revert pipe thing * Revert other changes and commit test result * Remove local execution commands * Remove debug log * Change sample * Add changelog entry * Split up cases in frontend. * Add example
- Loading branch information
Showing
4 changed files
with
156 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
tests/analysis_tests/tests/src/CompletionTaggedTemplate.res
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module M = { | ||
type t | ||
|
||
let a = (_t:t) => 4 | ||
let b = (_:t) => "c" | ||
let xyz = (_:t, p:int) => p + 1 | ||
} | ||
|
||
@module("meh") @taggedTemplate | ||
external meh: (array<string>, array<string>) => M.t = "default" | ||
|
||
// let x = meh`foo`. | ||
// ^com | ||
|
||
// let y = meh`bar`.x | ||
// ^com |
80 changes: 80 additions & 0 deletions
80
tests/analysis_tests/tests/src/expected/CompletionTaggedTemplate.res.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
Complete src/CompletionTaggedTemplate.res 11:20 | ||
posCursor:[11:20] posNoWhite:[11:19] Found expr:[11:11->0:-1] | ||
Completable: Cpath Value[meh](Nolabel, Nolabel)."" | ||
Package opens Pervasives.JsxModules.place holder | ||
ContextPath Value[meh](Nolabel, Nolabel)."" | ||
ContextPath Value[meh](Nolabel, Nolabel) | ||
ContextPath Value[meh] | ||
Path meh | ||
ContextPath Value[meh](Nolabel, Nolabel, Nolabel)-> | ||
ContextPath Value[meh](Nolabel, Nolabel, Nolabel) | ||
ContextPath Value[meh] | ||
Path meh | ||
CPPipe pathFromEnv:M found:true | ||
Path M. | ||
[{ | ||
"label": "->M.xyz", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "(t, int) => int", | ||
"documentation": null, | ||
"sortText": "xyz", | ||
"insertText": "->M.xyz", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 11, "character": 19}, "end": {"line": 11, "character": 20}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->M.b", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "b", | ||
"insertText": "->M.b", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 11, "character": 19}, "end": {"line": 11, "character": 20}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->M.a", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => int", | ||
"documentation": null, | ||
"sortText": "a", | ||
"insertText": "->M.a", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 11, "character": 19}, "end": {"line": 11, "character": 20}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
||
Complete src/CompletionTaggedTemplate.res 14:21 | ||
posCursor:[14:21] posNoWhite:[14:20] Found expr:[14:11->14:21] | ||
Completable: Cpath Value[meh](Nolabel, Nolabel).x | ||
Package opens Pervasives.JsxModules.place holder | ||
ContextPath Value[meh](Nolabel, Nolabel).x | ||
ContextPath Value[meh](Nolabel, Nolabel) | ||
ContextPath Value[meh] | ||
Path meh | ||
ContextPath Value[meh](Nolabel, Nolabel, Nolabel)->x | ||
ContextPath Value[meh](Nolabel, Nolabel, Nolabel) | ||
ContextPath Value[meh] | ||
Path meh | ||
CPPipe pathFromEnv:M found:true | ||
Path M.x | ||
[{ | ||
"label": "->M.xyz", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "(t, int) => int", | ||
"documentation": null, | ||
"sortText": "xyz", | ||
"insertText": "->M.xyz", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 14, "character": 19}, "end": {"line": 14, "character": 20}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
d153a91
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold
1.05
.Parse RedBlackTree.res - time/run
1.3645777733333333
ms1.2123143266666667
ms1.13
Parse Napkinscript.res - time/run
42.85270329333333
ms39.28006235333333
ms1.09
Parse HeroGraphic.res - time/run
5.763896613333333
ms5.13472718
ms1.12
This comment was automatically generated by workflow using github-action-benchmark.