@intersystems-community/ascot 0.1.1 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/generated/ascot.js +13219 -335
- package/generated/interfaces/iris-ascot-common.d.ts +225 -4
- package/generated/interfaces/iris-ascot-exported.d.ts +2 -1
- package/generated/interfaces/iris-ascot-imported.d.ts +1 -1
- package/lib/ascot.core.wasm +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -42,19 +42,26 @@ ClassMethod M() As %Status
|
|
|
42
42
|
|
|
43
43
|
await ws.diagnostics("file:///T.cls");
|
|
44
44
|
// [{ severity: "error", message: "Expected return value of type '%Status' but got nothing",
|
|
45
|
-
// range: { start: { line: 6, character: 5 }, ... }, relatedInformation: [...]
|
|
45
|
+
// range: { start: { line: 6, character: 5 }, ... }, relatedInformation: [...],
|
|
46
|
+
// code: "A6781", codeDescription: "https://docs.rs/ascot/.../enum.TypeErrorKind.html#variant.ReturnNothingForX" }]
|
|
46
47
|
|
|
47
48
|
await ws.hover("file:///T.cls", { line: 5, character: 7 }); // the `x` being written
|
|
48
49
|
// "```objectscript\n%DataType = 1\n```"
|
|
49
50
|
```
|
|
50
51
|
|
|
52
|
+
`createWorkspace` takes an optional second argument, a `Style` applied to every document:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
const strict = await createWorkspace(new NoIris(), { command: { form: "long" }, function: { case: "pascal" }, commandDo: { form: "short" } });
|
|
56
|
+
```
|
|
57
|
+
|
|
51
58
|
Load every file of a project into one `Workspace` so cross-file references resolve, and
|
|
52
59
|
call `open` again on each edit. `close(uri)` removes a document; a closed editor tab is
|
|
53
60
|
usually not a removal, so keep the on-disk text open instead.
|
|
54
61
|
|
|
55
62
|
## API
|
|
56
63
|
|
|
57
|
-
`createWorkspace(imported)` returns a `Workspace` whose methods mirror the engine's
|
|
64
|
+
`createWorkspace(imported, style?)` returns a `Workspace` whose methods mirror the engine's
|
|
58
65
|
exports, all returning promises. Positions and ranges are zero-based line/character pairs,
|
|
59
66
|
as in the Language Server Protocol.
|
|
60
67
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Root } from "../generated/ascot.js" with { "resolution-mode": "import" };
|
|
2
|
-
import type { ClassInfo, RoutineSource } from "../generated/interfaces/iris-ascot-common.js" with { "resolution-mode": "import"
|
|
2
|
+
import type { ClassInfo, RoutineSource, Style } from "../generated/interfaces/iris-ascot-common.js" with { "resolution-mode": "import"
|
|
3
3
|
};
|
|
4
4
|
export type * from "../generated/interfaces/iris-ascot-common.js";
|
|
5
5
|
type RawWorkspace = InstanceType<Root["exported"]["Workspace"]>;
|
|
@@ -19,4 +19,4 @@ export interface Imported {
|
|
|
19
19
|
* calls (e.g. from two documents' diagnostics resolving concurrently) can't trip ascot's
|
|
20
20
|
* internal `RefCell` borrows or jco's single-in-flight-call constraint.
|
|
21
21
|
*/
|
|
22
|
-
export declare function createWorkspace(imported: Imported): Promise<Workspace>;
|
|
22
|
+
export declare function createWorkspace(imported: Imported, style?: Style): Promise<Workspace>;
|
package/dist/index.js
CHANGED
|
@@ -79,9 +79,9 @@ function serialize(instance) {
|
|
|
79
79
|
* calls (e.g. from two documents' diagnostics resolving concurrently) can't trip ascot's
|
|
80
80
|
* internal `RefCell` borrows or jco's single-in-flight-call constraint.
|
|
81
81
|
*/
|
|
82
|
-
async function createWorkspace(imported) {
|
|
82
|
+
async function createWorkspace(imported, style) {
|
|
83
83
|
const IrisConnection = Object.getPrototypeOf(imported).constructor;
|
|
84
84
|
const root = await loadWasm(IrisConnection);
|
|
85
|
-
return serialize(new root.exported.Workspace(imported));
|
|
85
|
+
return serialize(new root.exported.Workspace(imported, style));
|
|
86
86
|
}
|
|
87
87
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +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