-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reuse original env when instantiating type (#1067)
* Reuse original env when instantiating type * Add changelog entry
- Loading branch information
Showing
4 changed files
with
76 additions
and
1 deletion.
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
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,33 @@ | ||
module Firebase = { | ||
module Firestore = { | ||
type firestore | ||
|
||
type documentReference<'documentdata> = { | ||
id: string, | ||
path: string, | ||
} | ||
|
||
type documentSnapshot<'documentdata> = { | ||
id: string, | ||
ref: documentReference<'documentdata>, | ||
} | ||
|
||
@module("firebase/firestore") @variadic | ||
external doc: (firestore, string, array<string>) => documentReference<'documentdata> = "doc" | ||
|
||
@module("firebase/firestore") | ||
external getDoc: documentReference<'documentdata> => Js.Promise.t< | ||
documentSnapshot<'documentdata>, | ||
> = "getDoc" | ||
} | ||
} | ||
|
||
module Sample = { | ||
open Firebase | ||
|
||
external store: Firestore.firestore = "store" | ||
|
||
let ref = store->Firestore.doc("some_id", []) | ||
// ref. | ||
// ^com | ||
} |
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,41 @@ | ||
Complete src/Firebase.res 30:9 | ||
posCursor:[30:9] posNoWhite:[30:8] Found expr:[30:5->30:9] | ||
Pexp_field [30:5->30:8] _:[32:0->30:9] | ||
Completable: Cpath Value[ref]."" | ||
Raw opens: 1 Firebase.place holder | ||
Package opens Pervasives.JsxModules.place holder | ||
Resolved opens 2 pervasives Firebase.res | ||
ContextPath Value[ref]."" | ||
ContextPath Value[ref] | ||
Path ref | ||
ContextPath Value[ref]-> | ||
ContextPath Value[ref] | ||
Path ref | ||
CPPipe pathFromEnv:Firebase.Firestore found:true | ||
Path Firebase.Firestore. | ||
[{ | ||
"label": "id", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\nid: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} | ||
}, { | ||
"label": "path", | ||
"kind": 5, | ||
"tags": [], | ||
"detail": "string", | ||
"documentation": {"kind": "markdown", "value": "```rescript\npath: string\n```\n\n```rescript\ntype documentReference<'documentdata> = {\n id: string,\n path: string,\n}\n```"} | ||
}, { | ||
"label": "->Firestore.getDoc", | ||
"kind": 12, | ||
"tags": [], | ||
"detail": "documentReference<\n 'documentdata,\n> => Js.Promise.t<documentSnapshot<'documentdata>>", | ||
"documentation": null, | ||
"sortText": "getDoc", | ||
"insertText": "->Firestore.getDoc", | ||
"additionalTextEdits": [{ | ||
"range": {"start": {"line": 30, "character": 8}, "end": {"line": 30, "character": 9}}, | ||
"newText": "" | ||
}] | ||
}] | ||
|