Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
zth committed Jan 2, 2025
1 parent 7980342 commit d3420b3
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 438 deletions.
3 changes: 1 addition & 2 deletions analysis/src/TypeUtils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1183,8 +1183,7 @@ let transformCompletionToPipeCompletion ?(synthetic = false) ~env ?posOfDot
of the project. Example: type x in module SomeModule in file SomeFile would get the globally
unique id `SomeFile.SomeModule.x`.*)
let rec findRootTypeId ~full ~env (t : Types.type_expr) =
let debug = Debug.verbose () in
(* let debug = false in *)
let debug = false in
match t.desc with
| Tlink t1 | Tsubst t1 | Tpoly (t1, []) -> findRootTypeId ~full ~env t1
| Tconstr (Pident {name = "function$"}, [t; _], _) ->
Expand Down
87 changes: 0 additions & 87 deletions analysis/tests/src/DotCompletionEverywhere.res

This file was deleted.

30 changes: 30 additions & 0 deletions analysis/tests/src/DotPipeCompletionSpec.res
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,33 @@ let outOfScope = (t: typeOutsideModule) => t

// @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
Loading

0 comments on commit d3420b3

Please sign in to comment.