Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@

#### :bug: Bug fix

- Show `Stdlib.Null` and `Stdlib.Nullable` completions for `Stdlib.null<'a>` and `Stdlib.nullable<'a>` types, respectively. https://github.com/rescript-lang/rescript/pull/7826

#### :memo: Documentation

#### :nail_care: Polish
Expand Down
2 changes: 2 additions & 0 deletions analysis/src/TypeUtils.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1291,4 +1291,6 @@ let completionPathFromMaybeBuiltin path =
| [mainModule; "t"] when String.starts_with ~prefix:"Stdlib_" mainModule ->
(* Route Stdlib_X to Stdlib.X for proper completions without the Stdlib_ prefix *)
Some (String.split_on_char '_' mainModule)
| ["Primitive_js_extern"; "null"] -> Some ["Stdlib"; "Null"]
| ["Primitive_js_extern"; "nullable"] -> Some ["Stdlib"; "Nullable"]
| _ -> None)
9 changes: 9 additions & 0 deletions tests/analysis_tests/tests/src/CompletionNullNullable.res
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let x: null<unit> = Stdlib_Null.null

// x.
// ^com

let y: nullable<unit> = null

// y.
// ^com
Loading
Loading