swls-wasm 0.3.3 → 0.3.5
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/config.d.ts +155 -0
- package/config.js +4 -0
- package/package.json +8 -2
- package/swls_wasm.js +2 -2
- package/swls_wasm_bg.wasm +0 -0
package/config.d.ts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
// Shared configuration types describing the swls language server's
|
|
2
|
+
// `initialize.initializationOptions` (the server deserializes them into its
|
|
3
|
+
// Rust `Config` / `LocalConfig`). Consumed by the editor integration packages
|
|
4
|
+
// (`swls-codemirror`, `swls-monaco`) so the accepted options stay in one place.
|
|
5
|
+
//
|
|
6
|
+
// This is a type-only module; see `config.js` for the (empty) runtime entry.
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Per-language toggles for `textDocument/formatting`. Formatting is enabled by
|
|
10
|
+
* default for Turtle only; every other language is off unless enabled here.
|
|
11
|
+
*/
|
|
12
|
+
export interface SwlsFormatOptions {
|
|
13
|
+
/** Enable Turtle formatting (default: `true`). */
|
|
14
|
+
turtle?: boolean;
|
|
15
|
+
/** Enable TriG formatting (default: `false`). */
|
|
16
|
+
trig?: boolean;
|
|
17
|
+
/** Enable N3 formatting (default: `false`). */
|
|
18
|
+
n3?: boolean;
|
|
19
|
+
/** Enable JSON-LD formatting (default: `false`). */
|
|
20
|
+
jsonld?: boolean;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Editor features and diagnostics that can be switched off individually through
|
|
25
|
+
* the {@link SwlsConfig.disabled} list. Mirrors the server's `Disabled` enum.
|
|
26
|
+
*/
|
|
27
|
+
export type SwlsDisabledFeature =
|
|
28
|
+
/** SHACL shape validation. */
|
|
29
|
+
| "shapes"
|
|
30
|
+
// --- diagnostics ---
|
|
31
|
+
/** Predicate/object IRIs that use an undeclared prefix. */
|
|
32
|
+
| "undefined_prefix"
|
|
33
|
+
/** Prefixes that are declared but never used. */
|
|
34
|
+
| "unused_prefix"
|
|
35
|
+
/** Properties under a `closed_namespaces` namespace that are unknown to the
|
|
36
|
+
* ontology and not in `allowed_properties`. */
|
|
37
|
+
| "namespace_properties"
|
|
38
|
+
/** Syntax/parse errors. */
|
|
39
|
+
| "syntax_diagnostics"
|
|
40
|
+
// --- completion ---
|
|
41
|
+
/** Master switch for `textDocument/completion`. */
|
|
42
|
+
| "completion"
|
|
43
|
+
/** Keyword completion (e.g. `@prefix`, `@context`). */
|
|
44
|
+
| "completion_keyword"
|
|
45
|
+
/** RDF class-name completion (e.g. after `a `/`rdf:type`). */
|
|
46
|
+
| "completion_class"
|
|
47
|
+
/** RDF property/predicate-name completion. */
|
|
48
|
+
| "completion_property"
|
|
49
|
+
/** Prefix-name completion sourced from bundled LOV / prefix.cc data. */
|
|
50
|
+
| "completion_prefix"
|
|
51
|
+
/** Subject-IRI completion reusing subjects already in the document (Turtle). */
|
|
52
|
+
| "completion_subject"
|
|
53
|
+
// --- hover ---
|
|
54
|
+
/** Master switch for `textDocument/hover`. */
|
|
55
|
+
| "hover"
|
|
56
|
+
/** Hover showing the inferred RDF type(s) of the term under the cursor. */
|
|
57
|
+
| "hover_type"
|
|
58
|
+
/** Hover showing ontology documentation for an RDF class IRI. */
|
|
59
|
+
| "hover_class"
|
|
60
|
+
/** Hover showing ontology documentation for a property/predicate IRI. */
|
|
61
|
+
| "hover_property"
|
|
62
|
+
/** Hover explaining a property accepted via the `allowed_properties` list. */
|
|
63
|
+
| "hover_excluded_property"
|
|
64
|
+
// --- navigation / editing ---
|
|
65
|
+
/** Master switch for `textDocument/definition`. */
|
|
66
|
+
| "goto_definition"
|
|
67
|
+
/** Components.js-specific goto-definition for component/module/parameter IRIs. */
|
|
68
|
+
| "goto_definition_components_js"
|
|
69
|
+
/** `textDocument/typeDefinition`. */
|
|
70
|
+
| "goto_type_definition"
|
|
71
|
+
/** `textDocument/references`. */
|
|
72
|
+
| "references"
|
|
73
|
+
/** `textDocument/rename`. */
|
|
74
|
+
| "rename"
|
|
75
|
+
/** Semantic tokens. */
|
|
76
|
+
| "semantic_tokens"
|
|
77
|
+
/** `textDocument/formatting`. */
|
|
78
|
+
| "format"
|
|
79
|
+
/** Auto-insert of a missing prefix/context declaration while typing `prefix:`. */
|
|
80
|
+
| "prefix_auto_insert"
|
|
81
|
+
/** Master switch for `textDocument/codeAction`. */
|
|
82
|
+
| "code_action"
|
|
83
|
+
/** "Organize Imports" quick-fix that sorts `@prefix` declarations (Turtle). */
|
|
84
|
+
| "code_action_organize_imports"
|
|
85
|
+
/** "Extract blank node" / "Inline named blank node" quick-fixes. */
|
|
86
|
+
| "code_action_blank_node_refactor"
|
|
87
|
+
/** Inlay hints. */
|
|
88
|
+
| "inlay_hint";
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Controls how property completion filters candidates by domain.
|
|
92
|
+
*
|
|
93
|
+
* - `"loose"` / `"none"`: suggest any property, ignoring the subject's type.
|
|
94
|
+
* - `"strict"`: only suggest properties whose domain matches the subject's
|
|
95
|
+
* type (or any property when the type cannot be determined).
|
|
96
|
+
* - `{ loose: [...] }`: strict overall, but loose for properties whose IRI
|
|
97
|
+
* starts with one of the listed namespaces.
|
|
98
|
+
* - `{ strict: [...] }`: loose overall, but strict for properties whose IRI
|
|
99
|
+
* starts with one of the listed namespaces.
|
|
100
|
+
*/
|
|
101
|
+
export type SwlsCompletionConfig =
|
|
102
|
+
| "none"
|
|
103
|
+
| "loose"
|
|
104
|
+
| "strict"
|
|
105
|
+
| { loose?: string[] }
|
|
106
|
+
| { strict?: string[] };
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* How Turtle/TriG prefix declarations are written when the editor inserts them.
|
|
110
|
+
*
|
|
111
|
+
* - `"turtle"`: `@prefix ex: <...> .`
|
|
112
|
+
* - `"sparql"`: `PREFIX ex: <...>`
|
|
113
|
+
*/
|
|
114
|
+
export type SwlsPrefixFormat = "turtle" | "sparql";
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Options forwarded to the swls language server as
|
|
118
|
+
* `initialize.initializationOptions`.
|
|
119
|
+
*/
|
|
120
|
+
export interface SwlsConfig {
|
|
121
|
+
/** Server log level (default: `"debug"`). */
|
|
122
|
+
log?: string;
|
|
123
|
+
/** Enable Turtle support. */
|
|
124
|
+
turtle?: boolean;
|
|
125
|
+
/** Enable TriG support. */
|
|
126
|
+
trig?: boolean;
|
|
127
|
+
/** Enable N3 support (opt-in: off unless explicitly set to `true`). */
|
|
128
|
+
n3?: boolean;
|
|
129
|
+
/** Enable JSON-LD support. */
|
|
130
|
+
jsonld?: boolean;
|
|
131
|
+
/** Enable SPARQL support. */
|
|
132
|
+
sparql?: boolean;
|
|
133
|
+
/** Per-language formatting toggles forwarded to the server. */
|
|
134
|
+
format?: SwlsFormatOptions;
|
|
135
|
+
/** Extra ontologies to import (URLs resolved through the file system). */
|
|
136
|
+
ontologies?: string[];
|
|
137
|
+
/** Extra SHACL shapes to import. */
|
|
138
|
+
shapes?: string[];
|
|
139
|
+
/** Editor features / diagnostics to disable. */
|
|
140
|
+
disabled?: SwlsDisabledFeature[];
|
|
141
|
+
/** Prefixes from the bundled prefix.cc data to hide from prefix completion. */
|
|
142
|
+
prefix_disabled?: string[];
|
|
143
|
+
/** Configure property-completion behavior. */
|
|
144
|
+
completion?: SwlsCompletionConfig;
|
|
145
|
+
/** Preferred form for inserted Turtle/TriG prefix declarations. */
|
|
146
|
+
prefix_format?: SwlsPrefixFormat;
|
|
147
|
+
/**
|
|
148
|
+
* Namespaces whose property (predicate) IRIs must be known to an ontology.
|
|
149
|
+
* Predicate IRIs under one of these namespaces that are neither known nor in
|
|
150
|
+
* {@link SwlsConfig.allowed_properties} are flagged with a warning.
|
|
151
|
+
*/
|
|
152
|
+
closed_namespaces?: string[];
|
|
153
|
+
/** Property IRIs explicitly allowed despite the `closed_namespaces` check. */
|
|
154
|
+
allowed_properties?: string[];
|
|
155
|
+
}
|
package/config.js
ADDED
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"collaborators": [
|
|
5
5
|
"ajuvercr <arthur.vercruysse@outlook.com>"
|
|
6
6
|
],
|
|
7
|
-
"version": "0.3.
|
|
7
|
+
"version": "0.3.5",
|
|
8
8
|
"files": [
|
|
9
9
|
"swls_wasm_bg.wasm",
|
|
10
10
|
"swls_wasm.js",
|
|
@@ -15,7 +15,9 @@
|
|
|
15
15
|
"pump.d.ts",
|
|
16
16
|
"worker.js",
|
|
17
17
|
"client.js",
|
|
18
|
-
"client.d.ts"
|
|
18
|
+
"client.d.ts",
|
|
19
|
+
"config.js",
|
|
20
|
+
"config.d.ts"
|
|
19
21
|
],
|
|
20
22
|
"main": "index.js",
|
|
21
23
|
"types": "index.d.ts",
|
|
@@ -32,6 +34,10 @@
|
|
|
32
34
|
"types": "./client.d.ts",
|
|
33
35
|
"default": "./client.js"
|
|
34
36
|
},
|
|
37
|
+
"./config": {
|
|
38
|
+
"types": "./config.d.ts",
|
|
39
|
+
"default": "./config.js"
|
|
40
|
+
},
|
|
35
41
|
"./worker": "./worker.js",
|
|
36
42
|
"./swls_wasm.js": {
|
|
37
43
|
"types": "./swls_wasm.d.ts",
|
package/swls_wasm.js
CHANGED
|
@@ -143,7 +143,7 @@ function __wbg_get_imports() {
|
|
|
143
143
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
144
144
|
}
|
|
145
145
|
},
|
|
146
|
-
|
|
146
|
+
__wbg_fetch_1a5c26f1d15c55e0: function() { return handleError(function (arg0, arg1) {
|
|
147
147
|
const ret = fetch(arg0, arg1);
|
|
148
148
|
return ret;
|
|
149
149
|
}, arguments); },
|
|
@@ -329,7 +329,7 @@ function __wbg_get_imports() {
|
|
|
329
329
|
return ret;
|
|
330
330
|
},
|
|
331
331
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
332
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
332
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 4875, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
333
333
|
const ret = makeMutClosure(arg0, arg1, wasm_bindgen__convert__closures_____invoke__h5d8169a9c6a0716a);
|
|
334
334
|
return ret;
|
|
335
335
|
},
|
package/swls_wasm_bg.wasm
CHANGED
|
Binary file
|