-
Notifications
You must be signed in to change notification settings - Fork 60
Universal dot completion #1054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Universal dot completion #1054
Changes from all commits
565edda
4347fa3
eefe5f6
ca1c8d1
7110db8
af54200
e3d1470
72a522c
ce80c6c
5ad0319
943b01f
ebc5d9e
8e2395e
8e166ac
2b3190c
58cf089
70b7db6
931fd28
e347146
415eea9
c715071
dfc3eb0
4e4d03c
0fa56aa
b6f7ccc
eb4cea5
b1c6850
9c29710
9ac0817
3d0a1c8
bf7eeba
380e8a9
603b8d9
b5053bc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
let filterRecordFields ~env ~recordAsString ~prefix ~exact fields = | ||
fields | ||
|> Utils.filterMap (fun (field : SharedTypes.field) -> | ||
if Utils.checkName field.fname.txt ~prefix ~exact then | ||
Some | ||
(SharedTypes.Completion.create field.fname.txt ~env | ||
?deprecated:field.deprecated ~docstring:field.docstring | ||
~kind:(SharedTypes.Completion.Field (field, recordAsString))) | ||
else None) | ||
|
||
let fieldCompletionsForDotCompletion ?posOfDot typ ~env ~package ~prefix ~exact | ||
= | ||
let asObject = typ |> TypeUtils.extractObjectType ~env ~package in | ||
match asObject with | ||
| Some (objEnv, obj) -> | ||
(* Handle obj completion via dot *) | ||
if Debug.verbose () then | ||
Printf.printf "[dot_completion]--> Obj type found:\n"; | ||
obj |> TypeUtils.getObjFields | ||
|> Utils.filterMap (fun (field, _typ) -> | ||
if Utils.checkName field ~prefix ~exact then | ||
let fullObjFieldName = Printf.sprintf "[\"%s\"]" field in | ||
Some | ||
(SharedTypes.Completion.create fullObjFieldName ~synthetic:true | ||
~insertText:fullObjFieldName ~env:objEnv | ||
~kind:(SharedTypes.Completion.ObjLabel typ) | ||
?additionalTextEdits: | ||
(match posOfDot with | ||
| None -> None | ||
| Some posOfDot -> | ||
Some | ||
(TypeUtils.makeAdditionalTextEditsForRemovingDot | ||
posOfDot))) | ||
else None) | ||
| None -> ( | ||
match typ |> TypeUtils.extractRecordType ~env ~package with | ||
| Some (env, fields, typDecl) -> | ||
fields | ||
|> filterRecordFields ~env ~prefix ~exact | ||
~recordAsString: | ||
(typDecl.item.decl |> Shared.declToString typDecl.name.txt) | ||
| None -> []) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
let addJsxCompletionItems ~mainTypeId ~env ~prefix ~(full : SharedTypes.full) | ||
~rawOpens typ = | ||
match mainTypeId with | ||
| ("array" | "float" | "string" | "int") as builtinNameToComplete -> | ||
if Utils.checkName builtinNameToComplete ~prefix ~exact:false then | ||
let name = | ||
match full.package.genericJsxModule with | ||
| None -> "React." ^ builtinNameToComplete | ||
| Some g -> | ||
g ^ "." ^ builtinNameToComplete | ||
|> String.split_on_char '.' | ||
|> TypeUtils.removeOpensFromCompletionPath ~rawOpens | ||
~package:full.package | ||
|> String.concat "." | ||
in | ||
[ | ||
SharedTypes.Completion.create name ~synthetic:true | ||
~includesSnippets:true ~kind:(Value typ) ~env ~sortText:"A" | ||
~docstring: | ||
[ | ||
"Turns `" ^ builtinNameToComplete | ||
^ "` into a JSX element so it can be used inside of JSX."; | ||
]; | ||
] | ||
else [] | ||
| _ -> [] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,6 @@ | |
"@rescript/react": "0.12.0" | ||
}, | ||
"dependencies": { | ||
"rescript": "^11.1.0" | ||
"rescript": "11.1.4" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
module SomeModule = { | ||
type t = {name: string} | ||
|
||
@get external getName: t => string = "name" | ||
|
||
let thisShouldNotBeCompletedFor = () => "hi" | ||
} | ||
|
||
let n = {SomeModule.name: "hello"} | ||
|
||
// n. | ||
// ^com | ||
|
||
@editor.completeFrom(CompletionFromModule.SomeOtherModule) | ||
type typeOutsideModule = {nname: string} | ||
|
||
module SomeOtherModule = { | ||
type t = typeOutsideModule | ||
|
||
type irrelevantType = string | ||
|
||
@get external getNName: t => string = "nname" | ||
@get external getNName2: typeOutsideModule => string = "nname" | ||
@get external getNName3: irrelevantType => string = "nname" | ||
|
||
let thisShouldNotBeCompletedFor = () => "hi" | ||
} | ||
|
||
let nn: SomeOtherModule.t = {nname: "hello"} | ||
|
||
// nn. | ||
// ^com | ||
|
||
// @editor.completeFrom(SomeOthe) type typeOutsideModule = {nname: string} | ||
// ^com | ||
|
||
let nnn: typeOutsideModule = {nname: "hello"} | ||
|
||
// nnn-> | ||
// ^com | ||
|
||
open SomeOtherModule | ||
// nnn-> | ||
// ^com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// Used to check completions across files | ||
|
||
// CompletionFromModule.n. | ||
// ^com | ||
|
||
// CompletionFromModule.nn. | ||
// ^com | ||
|
||
// CompletionFromModule.nnn-> | ||
// ^com | ||
|
||
open CompletionFromModule.SomeOtherModule | ||
// CompletionFromModule.nnn-> | ||
// ^com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
@@warning("-26") | ||
@@warning("-27") | ||
@@warning("-110") | ||
|
||
module A = { | ||
@editor.completeFrom(B) @editor.completeFrom(C) | ||
type a | ||
} | ||
|
||
module B = { | ||
let b = (a: A.a) => 1 | ||
} | ||
|
||
module C = { | ||
open A | ||
let c = (a: a) => {'c'} | ||
} | ||
|
||
let a : A.a = %todo | ||
// a. | ||
// ^com | ||
// B.b and C.c should be completed |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
module ObservablePoint = { | ||
type op = { | ||
mutable x: int, | ||
mutable y: int, | ||
} | ||
|
||
@send | ||
external setBoth: (op, float) => unit = "set" | ||
|
||
@send | ||
external set: (op, float, float) => unit = "set" | ||
} | ||
|
||
module Sprite = { | ||
type s = { | ||
anchor: ObservablePoint.op, | ||
} | ||
} | ||
|
||
let sprite : Sprite.s = %todo | ||
|
||
// sprite.anchor. | ||
// ^com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
// | ||
module SomeModule = { | ||
type t = {name: string} | ||
|
||
@get external getName: t => string = "name" | ||
@send | ||
external withUnlabelledArgumentNotFirst: (~name: string=?, t) => unit = | ||
"withUnlabelledArgumentNotFirst" | ||
|
||
let thisShouldNotBeCompletedFor = () => "hi" | ||
} | ||
|
||
let n = {SomeModule.name: "hello"} | ||
|
||
// Type from inside of a module | ||
// n. | ||
// ^com | ||
|
||
@editor.completeFrom(DotPipeCompletionSpec.SomeOtherModule) | ||
type typeOutsideModule = {nname: string} | ||
|
||
let doWithTypeOutsideModule = (_: typeOutsideModule) => "" | ||
|
||
module CompleteFromThisToo = { | ||
external a: typeOutsideModule => string = "a" | ||
external b: unit => typeOutsideModule = "b" | ||
} | ||
|
||
module SomeOtherModule = { | ||
@editor.completeFrom(DotPipeCompletionSpec.CompleteFromThisToo) | ||
type t = typeOutsideModule | ||
|
||
type irrelevantType = string | ||
|
||
@get external getNName: t => string = "nname" | ||
@get external getNName2: typeOutsideModule => string = "nname" | ||
@get external getNName3: irrelevantType => string = "nname" | ||
|
||
let thisShouldNotBeCompletedFor = () => "hi" | ||
} | ||
|
||
let nn: SomeOtherModule.t = {nname: "hello"} | ||
|
||
// Type from module but that's an alias | ||
// nn. | ||
// ^com | ||
|
||
module A = { | ||
@editor.completeFrom(B) | ||
type a | ||
|
||
external withA: a => unit = "withA" | ||
external make: unit => a = "makeA" | ||
} | ||
|
||
module B = { | ||
let b = (_a: A.a) => 1 | ||
} | ||
|
||
external a: A.a = "a" | ||
|
||
// Main type in other module | ||
// a. | ||
// ^com | ||
|
||
let xx: CompletionFromModule.SomeModule.t = {name: "hello"} | ||
// Type from other file | ||
// xx. | ||
// ^com | ||
|
||
type builtinType = array<string> | ||
|
||
let ffff: builtinType = [] | ||
|
||
// A built in type | ||
// ffff.u | ||
// ^com | ||
|
||
// Type outside of module with complete from pointing to other module | ||
let nnn: typeOutsideModule = {nname: "hello"} | ||
// nnn. | ||
// ^com | ||
|
||
// Continuous completion | ||
let xxxx = [1, 2] | ||
|
||
// xxxx->Js.Array2.filter(v => v > 10).filt | ||
// ^com | ||
|
||
// xxxx->Js.Array2.filter(v => v > 10)->Js.Array2.joinWith(",").includ | ||
// ^com | ||
|
||
let str = "hello" | ||
|
||
// str->Js.String2.toLowerCase.toUpperCa | ||
// ^com | ||
|
||
// str->Js.String2.toLowerCase->Js.String2.toUpperCase.toLowerC | ||
// ^com | ||
|
||
let cc = (t: typeOutsideModule) => { | ||
// t. | ||
// ^com | ||
t | ||
} | ||
|
||
let outOfScope = (t: typeOutsideModule) => t | ||
|
||
// @editor.completeFrom(Dot) type t | ||
// ^com | ||
|
||
// @editor.completeFrom([CompletionPipe]) type t | ||
// ^com | ||
|
||
// @editor.completeFrom([CompletionPipe, Dot]) type t | ||
// ^com | ||
|
||
let someObj = { | ||
"name": "hello", | ||
"age": 123, | ||
} | ||
|
||
// someObj. | ||
// ^com | ||
|
||
// someObj.na | ||
// ^com | ||
|
||
module DOMAPI = { | ||
type htmlElement = {prefix: string} | ||
|
||
@editor.completeFrom(DotPipeCompletionSpec.HTMLButtonElement) | ||
type rec htmlButtonElement = {mutable disabled: bool} | ||
} | ||
|
||
module HTMLButtonElement = { | ||
open DOMAPI | ||
|
||
@send | ||
external checkValidity: htmlButtonElement => bool = "checkValidity" | ||
} | ||
|
||
external button: DOMAPI.htmlButtonElement = "button" | ||
|
||
// button. | ||
// ^com |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// These are bindings used in RxjsCompletion.res | ||
// We are using a separate file to test complication for modules of external files. | ||
type target | ||
|
||
module Subscriber = { | ||
type t<'t> = {next: 't => unit} | ||
} | ||
|
||
module Observable = { | ||
// Complete items defined inside the parent module. | ||
@editor.completeFrom(Rxjs) | ||
type t<'t> | ||
|
||
type dispose = unit => unit | ||
|
||
@new @module("rxjs") | ||
external make: (Subscriber.t<'t> => dispose) => t<'t> = "Observable" | ||
|
||
type subscription | ||
|
||
@send | ||
external subscribe: (t<'t>, 't => unit) => subscription = "subscribe" | ||
} | ||
|
||
@module("rxjs") | ||
external fromEvent: (target, string) => Observable.t<'t> = "fromEvent" | ||
|
||
type operation<'t, 'u> | ||
|
||
@send | ||
external pipe: (Observable.t<'t>, operation<'t, 'u>) => Observable.t<'u> = "pipe" | ||
|
||
@send | ||
external pipe2: (Observable.t<'t>, operation<'t, 'u>, operation<'u, 'i>) => Observable.t<'i> = | ||
"pipe" | ||
|
||
@module("rxjs") | ||
external map: ('t => 'u) => operation<'t, 'u> = "map" | ||
|
||
@module("rxjs") | ||
external distinctUntilChanged: unit => operation<'t, 't> = "distinctUntilChanged" | ||
|
||
@module("rxjs") | ||
external merge: (Observable.t<'t>, Observable.t<'t>) => Observable.t<'t> = "merge" | ||
|
||
@module("rxjs") | ||
external scan: (('acc, 't) => 'acc, 'acc) => operation<'t, 'acc> = "scan" | ||
|
||
@module("rxjs") | ||
external combineLatest: (Observable.t<'a>, Observable.t<'b>) => Observable.t<('a, 'b)> = | ||
"combineLatest" |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
@@warning("-26") | ||
@@warning("-110") | ||
|
||
type keyPress = | ||
| Up(string) | ||
| Down(string) | ||
|
||
@val | ||
external window: {..} = "window" | ||
|
||
let main = async () => { | ||
let keyMapObservable = { | ||
open Rxjs | ||
|
||
let keydown = | ||
fromEvent(Obj.magic(window), "keydown")->pipe2( | ||
map(event => Down(event["key"])), | ||
distinctUntilChanged(), | ||
) | ||
|
||
let keyup = | ||
fromEvent(Obj.magic(window), "keyup")->pipe2( | ||
map(event => Up(event["key"])), | ||
distinctUntilChanged(), | ||
) | ||
|
||
// merge(keydown, keyup). | ||
// ^com | ||
|
||
// Rxjs.Observable.subscribe, Rxjs.pipe and Rxjs.pipe2 should be completed | ||
} | ||
|
||
let (a,b) : ( Rxjs.Observable.t<string> , Rxjs.Observable.t<string>) = %todo | ||
|
||
// Rxjs.combineLatest(a, b). | ||
// ^com | ||
|
||
// Rxjs.Observable.subscribe, Rxjs.pipe and Rxjs.pipe2 should be completed | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,18 @@ | ||
Complete src/CompletePrioritize1.res 5:6 | ||
posCursor:[5:6] posNoWhite:[5:5] Found expr:[5:3->0:-1] | ||
Complete src/CompletePrioritize1.res 6:6 | ||
posCursor:[6:6] posNoWhite:[6:5] Found expr:[6:3->0:-1] | ||
Completable: Cpath Value[a]-> | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[a]-> | ||
ContextPath Value[a] | ||
Path a | ||
CPPipe env:CompletePrioritize1 | ||
CPPipe type path:Test.t | ||
CPPipe pathFromEnv:Test found:true | ||
Path Test. | ||
[{ | ||
"label": "Test.add", | ||
"label": "Test.name", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "float => float", | ||
"detail": "t => int", | ||
"documentation": null | ||
}] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
Complete src/CompletionFromModule.res 10:5 | ||
posCursor:[10:5] posNoWhite:[10:4] Found expr:[10:3->10:5] | ||
Pexp_field [10:3->10:4] _:[13:0->10:5] | ||
Completable: Cpath Value[n]."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[n]."" | ||
ContextPath Value[n] | ||
Path n | ||
ContextPath Value[n]-> | ||
ContextPath Value[n] | ||
Path n | ||
CPPipe pathFromEnv:SomeModule found:true | ||
Path SomeModule. | ||
[{ | ||
"label": "name", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} | ||
}, { | ||
"label": "->SomeModule.getName", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. curious about the function coming before the field There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you expand a bit? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1 If I write 2 Could There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems that is about what called "uniform function call syntax" And there was a similar discussion in ReasonML reasonml/reason#1638 early day There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thank you for the context. Will read through. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we could figure out a good way to do that, pointing out the module to use with the call ( Anyway, just completing the actual pipe, but via dot, is a good start for DX imo. |
||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getName", | ||
"insertText": "->SomeModule.getName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 10, "character": 4}, "end": {"line": 10, "character": 5}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
||
Complete src/CompletionFromModule.res 30:6 | ||
posCursor:[30:6] posNoWhite:[30:5] Found expr:[30:3->30:6] | ||
Pexp_field [30:3->30:5] _:[36:0->30:6] | ||
Completable: Cpath Value[nn]."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[nn]."" | ||
ContextPath Value[nn] | ||
Path nn | ||
ContextPath Value[nn]-> | ||
ContextPath Value[nn] | ||
Path nn | ||
CPPipe pathFromEnv:SomeOtherModule found:true | ||
Path SomeOtherModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "nname", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} | ||
}, { | ||
"label": "->SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getNName", | ||
"insertText": "->SomeOtherModule.getNName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null, | ||
"sortText": "getNName2", | ||
"insertText": "->SomeOtherModule.getNName2", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getNName", | ||
"insertText": "->SomeOtherModule.getNName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null, | ||
"sortText": "getNName2", | ||
"insertText": "->SomeOtherModule.getNName2", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 30, "character": 5}, "end": {"line": 30, "character": 6}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
||
Complete src/CompletionFromModule.res 33:32 | ||
XXX Not found! | ||
Completable: Cpath Module[SomeOthe] | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Module[SomeOthe] | ||
Path SomeOthe | ||
[{ | ||
"label": "SomeOtherModule", | ||
"kind": 9, | ||
"tags": [], | ||
"detail": "module SomeOtherModule", | ||
"documentation": null | ||
}] | ||
|
||
Complete src/CompletionFromModule.res 38:8 | ||
posCursor:[38:8] posNoWhite:[38:7] Found expr:[38:3->0:-1] | ||
Completable: Cpath Value[nnn]-> | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[nnn]-> | ||
ContextPath Value[nnn] | ||
Path nnn | ||
CPPipe pathFromEnv: found:true | ||
Path CompletionFromModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null | ||
}, { | ||
"label": "SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null | ||
}] | ||
|
||
Complete src/CompletionFromModule.res 42:8 | ||
posCursor:[42:8] posNoWhite:[42:7] Found expr:[42:3->0:-1] | ||
Completable: Cpath Value[nnn]-> | ||
Raw opens: 1 SomeOtherModule.place holder | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 2 pervasives CompletionFromModule.res | ||
ContextPath Value[nnn]-> | ||
ContextPath Value[nnn] | ||
Path nnn | ||
CPPipe pathFromEnv: found:true | ||
Path CompletionFromModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null | ||
}, { | ||
"label": "getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null | ||
}] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,156 @@ | ||
Complete src/CompletionFromModule2.res 2:26 | ||
posCursor:[2:26] posNoWhite:[2:25] Found expr:[2:3->2:26] | ||
Pexp_field [2:3->2:25] _:[11:0->2:26] | ||
Completable: Cpath Value[CompletionFromModule, n]."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[CompletionFromModule, n]."" | ||
ContextPath Value[CompletionFromModule, n] | ||
Path CompletionFromModule.n | ||
ContextPath Value[CompletionFromModule, n]-> | ||
ContextPath Value[CompletionFromModule, n] | ||
Path CompletionFromModule.n | ||
CPPipe pathFromEnv:SomeModule found:true | ||
Path CompletionFromModule.SomeModule. | ||
[{ | ||
"label": "name", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nname: string\n```\n\n```rescript\ntype t = {name: string}\n```"} | ||
}, { | ||
"label": "->CompletionFromModule.SomeModule.getName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getName", | ||
"insertText": "->CompletionFromModule.SomeModule.getName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 2, "character": 25}, "end": {"line": 2, "character": 26}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
||
Complete src/CompletionFromModule2.res 5:27 | ||
posCursor:[5:27] posNoWhite:[5:26] Found expr:[5:3->5:27] | ||
Pexp_field [5:3->5:26] _:[11:0->5:27] | ||
Completable: Cpath Value[CompletionFromModule, nn]."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[CompletionFromModule, nn]."" | ||
ContextPath Value[CompletionFromModule, nn] | ||
Path CompletionFromModule.nn | ||
ContextPath Value[CompletionFromModule, nn]-> | ||
ContextPath Value[CompletionFromModule, nn] | ||
Path CompletionFromModule.nn | ||
CPPipe pathFromEnv:SomeOtherModule found:true | ||
Path CompletionFromModule.SomeOtherModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "nname", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nnname: string\n```\n\n```rescript\ntype typeOutsideModule = {nname: string}\n```"} | ||
}, { | ||
"label": "->CompletionFromModule.SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getNName", | ||
"insertText": "->CompletionFromModule.SomeOtherModule.getNName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->CompletionFromModule.SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null, | ||
"sortText": "getNName2", | ||
"insertText": "->CompletionFromModule.SomeOtherModule.getNName2", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->CompletionFromModule.SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null, | ||
"sortText": "getNName", | ||
"insertText": "->CompletionFromModule.SomeOtherModule.getNName", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->CompletionFromModule.SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null, | ||
"sortText": "getNName2", | ||
"insertText": "->CompletionFromModule.SomeOtherModule.getNName2", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 5, "character": 26}, "end": {"line": 5, "character": 27}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
||
Complete src/CompletionFromModule2.res 8:29 | ||
posCursor:[8:29] posNoWhite:[8:28] Found expr:[8:3->0:-1] | ||
Completable: Cpath Value[CompletionFromModule, nnn]-> | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[CompletionFromModule, nnn]-> | ||
ContextPath Value[CompletionFromModule, nnn] | ||
Path CompletionFromModule.nnn | ||
CPPipe pathFromEnv: found:true | ||
Path CompletionFromModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "CompletionFromModule.SomeOtherModule.getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null | ||
}, { | ||
"label": "CompletionFromModule.SomeOtherModule.getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null | ||
}] | ||
|
||
Complete src/CompletionFromModule2.res 12:29 | ||
posCursor:[12:29] posNoWhite:[12:28] Found expr:[12:3->0:-1] | ||
Completable: Cpath Value[CompletionFromModule, nnn]-> | ||
Raw opens: 1 CompletionFromModule.SomeOtherModule.place holder | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 2 pervasives CompletionFromModule.res | ||
ContextPath Value[CompletionFromModule, nnn]-> | ||
ContextPath Value[CompletionFromModule, nnn] | ||
Path CompletionFromModule.nnn | ||
CPPipe pathFromEnv: found:true | ||
Path CompletionFromModule. | ||
Path CompletionFromModule.SomeOtherModule. | ||
[{ | ||
"label": "getNName", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "t => string", | ||
"documentation": null | ||
}, { | ||
"label": "getNName2", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "typeOutsideModule => string", | ||
"documentation": null | ||
}] | ||
|
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
Complete src/CompletionMultipleEditorCompleteFrom.res 19:5 | ||
posCursor:[19:5] posNoWhite:[19:4] Found expr:[19:3->19:5] | ||
Pexp_field [19:3->19:4] _:[22:0->19:5] | ||
Completable: Cpath Value[a]."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[a]."" | ||
ContextPath Value[a] | ||
Path a | ||
ContextPath Value[a]-> | ||
ContextPath Value[a] | ||
Path a | ||
CPPipe pathFromEnv:A found:true | ||
Path A. | ||
Path B. | ||
Path C. | ||
[{ | ||
"label": "->B.b", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "A.a => int", | ||
"documentation": null, | ||
"sortText": "b", | ||
"insertText": "->B.b", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->C.c", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "A.a => char", | ||
"documentation": null, | ||
"sortText": "c", | ||
"insertText": "->C.c", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 19, "character": 4}, "end": {"line": 19, "character": 5}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Complete src/CompletionPipeProperty.res 21:17 | ||
posCursor:[21:17] posNoWhite:[21:16] Found expr:[21:3->21:17] | ||
Pexp_field [21:3->21:16] _:[23:0->21:17] | ||
Completable: Cpath Value[sprite].anchor."" | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 1 pervasives | ||
ContextPath Value[sprite].anchor."" | ||
ContextPath Value[sprite].anchor | ||
ContextPath Value[sprite] | ||
Path sprite | ||
ContextPath Value[sprite]->anchor | ||
ContextPath Value[sprite] | ||
Path sprite | ||
CPPipe pathFromEnv:Sprite found:true | ||
Path Sprite.anchor | ||
ContextPath Value[sprite].anchor-> | ||
ContextPath Value[sprite].anchor | ||
ContextPath Value[sprite] | ||
Path sprite | ||
ContextPath Value[sprite]->anchor | ||
ContextPath Value[sprite] | ||
Path sprite | ||
CPPipe pathFromEnv:Sprite found:true | ||
Path Sprite.anchor | ||
CPPipe pathFromEnv:ObservablePoint found:true | ||
Path ObservablePoint. | ||
[{ | ||
"label": "x", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "int", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nx: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} | ||
}, { | ||
"label": "y", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "int", | ||
"documentation": {"kind": "markdown", "value": "```rescript\ny: int\n```\n\n```rescript\ntype op = {mutable x: int, mutable y: int}\n```"} | ||
}, { | ||
"label": "->ObservablePoint.setBoth", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "(op, float) => unit", | ||
"documentation": null, | ||
"sortText": "setBoth", | ||
"insertText": "->ObservablePoint.setBoth", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, | ||
"newText": "" | ||
}] | ||
}, { | ||
"label": "->ObservablePoint.set", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "(op, float, float) => unit", | ||
"documentation": null, | ||
"sortText": "set", | ||
"insertText": "->ObservablePoint.set", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 21, "character": 16}, "end": {"line": 21, "character": 17}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|
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.
Is this alias as
t
a hard requirement to make this work?Being newish to ReScript
type t
is a little strange and it feels a bit like an artificial limitation right now.