@cockernutx/language-plugin-brace 0.1.1 → 0.1.4
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 +22 -13
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,6 +8,10 @@ produces spurious errors and no hover.
|
|
|
8
8
|
|
|
9
9
|
## Setup
|
|
10
10
|
|
|
11
|
+
```sh
|
|
12
|
+
npm install -D @cockernutx/language-plugin-brace
|
|
13
|
+
```
|
|
14
|
+
|
|
11
15
|
```jsonc
|
|
12
16
|
// tsconfig.app.json
|
|
13
17
|
{
|
|
@@ -17,29 +21,34 @@ produces spurious errors and no hover.
|
|
|
17
21
|
}
|
|
18
22
|
```
|
|
19
23
|
|
|
20
|
-
|
|
24
|
+
That is the whole setup: the package ships built JavaScript, so there is nothing to compile, and
|
|
25
|
+
**Developer: Reload Window** is the only other step (the language server loads plugins at startup).
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
deno task build:plugin # from the repo root
|
|
24
|
-
```
|
|
27
|
+
## If the plugin does not load
|
|
25
28
|
|
|
26
|
-
Volar loads the plugin by calling `require()` on it in a Node process (`vue-tsc` and the
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Vue Language Server output channel:
|
|
29
|
+
Volar loads the plugin by calling `require()` on it in a Node process (`vue-tsc` and the editor's
|
|
30
|
+
language server). When that fails Volar swallows the `SyntaxError` and runs **without the plugin**:
|
|
31
|
+
brace templates lose hover, completions and diagnostics, and the only trace is this line in the Vue
|
|
32
|
+
Language Server output channel:
|
|
31
33
|
|
|
32
34
|
```
|
|
33
35
|
[Vue] Resolve plugin path failed: @cockernutx/language-plugin-brace SyntaxError: …
|
|
34
36
|
```
|
|
35
37
|
|
|
36
|
-
`index.cjs` loads `dist/index.js`, `deno task test` rebuilds it, and a test fails if `dist` is
|
|
37
|
-
missing or older than the source it came from.
|
|
38
|
-
|
|
39
38
|
**Check it loaded:** hover a variable inside `@try` — a type means loaded, `any` (or nothing)
|
|
40
39
|
means not. In that case Volar also reports errors on valid brace syntax.
|
|
41
40
|
|
|
42
|
-
|
|
41
|
+
### Working on the plugin itself
|
|
42
|
+
|
|
43
|
+
The plugin is TypeScript, and only this repository's Deno toolchain can load that directly; a Node
|
|
44
|
+
process needs the build. So from a checkout, compile before the editor will see your changes:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
deno task build:plugin # from the repo root
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`index.cjs` loads `dist/index.js`, `deno task test` rebuilds it, and a test fails if `dist` is
|
|
51
|
+
missing or older than the source it came from.
|
|
43
52
|
|
|
44
53
|
## Notes
|
|
45
54
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cockernutx/language-plugin-brace",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "Volar / Vue language tools plugin for lang=\"brace\" SFC templates",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"homepage": "https://github.com/strawberyy-coconut/vue-brace#readme",
|
|
28
28
|
"bugs": "https://github.com/strawberyy-coconut/vue-brace/issues",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@cockernutx/brace-template": "^0.1.
|
|
30
|
+
"@cockernutx/brace-template": "^0.1.4",
|
|
31
31
|
"@vue/language-core": "^3.3.11"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|