Skip to content

Commit 4726065

Browse files
committed
rename attribute
1 parent 78f5779 commit 4726065

5 files changed

+10
-10
lines changed

analysis/src/CompletionBackEnd.ml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1015,7 +1015,7 @@ and getCompletionsForContextPath ~debug ~full ~opens ~rawOpens ~pos ~env ~exact
10151015
| Some (env, fields, recordAsString, path, attributes) ->
10161016
let pipeCompletion =
10171017
match
1018-
(path, ProcessAttributes.findMainTypeForModuleAttribute attributes)
1018+
(path, ProcessAttributes.findEditorCompleteFromAttribute attributes)
10191019
with
10201020
| Some path, _ when Path.last path = "t" ->
10211021
Some

analysis/src/CompletionFrontEnd.ml

+2-2
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor
947947
(Completable.CdecoratorPayload
948948
(JsxConfig {nested = List.rev nested; prefix})))
949949
| _ -> ()
950-
else if id.txt = "mainTypeForModule" then
950+
else if id.txt = "editor.completeFrom" then
951951
match payload with
952952
| PStr
953953
[
@@ -963,7 +963,7 @@ let completionWithParser1 ~currentFile ~debug ~offset ~path ~posCursor
963963
]
964964
when locHasCursor pexp_loc ->
965965
if Debug.verbose () then
966-
print_endline "[decoratorCompletion] Found @mainTypeForModule";
966+
print_endline "[decoratorCompletion] Found @editor.completeFrom";
967967
setResult
968968
(Completable.Cpath
969969
(CPId

analysis/src/ProcessAttributes.ml

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,11 @@ let newDeclared ~item ~extent ~name ~stamp ~modulePath isExported attributes =
4949
item;
5050
}
5151

52-
let rec findMainTypeForModuleAttribute attributes =
52+
let rec findEditorCompleteFromAttribute attributes =
5353
let open Parsetree in
5454
match attributes with
5555
| [] -> None
56-
| ( {Asttypes.txt = "mainTypeForModule"},
56+
| ( {Asttypes.txt = "editor.completeFrom"},
5757
PStr
5858
[
5959
{
@@ -63,4 +63,4 @@ let rec findMainTypeForModuleAttribute attributes =
6363
] )
6464
:: _ ->
6565
Some (Utils.flattenLongIdent path)
66-
| _ :: rest -> findMainTypeForModuleAttribute rest
66+
| _ :: rest -> findEditorCompleteFromAttribute rest

analysis/tests/src/CompletionFromModule.res

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ let n = {SomeModule.name: "hello"}
1313
// ^com
1414
// ^dv-
1515

16-
@mainTypeForModule(SomeOtherModule)
16+
@editor.completeFrom(SomeOtherModule)
1717
type typeOutsideModule = {nname: string}
1818

1919
module SomeOtherModule = {
@@ -35,5 +35,5 @@ let nn: SomeOtherModule.t = {nname: "hello"}
3535
// ^com
3636
// ^dv-
3737

38-
// @mainTypeForModule(SomeOthe) type typeOutsideModule = {nname: string}
39-
// ^com
38+
// @editor.completeFrom(SomeOthe) type typeOutsideModule = {nname: string}
39+
// ^com

analysis/tests/src/expected/CompletionFromModule.res.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Path SomeOtherModule.
7777
}]
7878

7979

80-
Complete src/CompletionFromModule.res 37:30
80+
Complete src/CompletionFromModule.res 37:32
8181
XXX Not found!
8282
Completable: Cpath Module[SomeOthe]
8383
Package opens Pervasives.JsxModules.place holder

0 commit comments

Comments
 (0)