@valbuild/language-server 0.127.0 → 0.128.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @valbuild/language-server
|
|
2
2
|
|
|
3
|
+
## 0.128.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [[`8b52b33`](https://github.com/valbuild/val/commit/8b52b33e1f629f14f66cc71dcc7cf415d210c7d4), [`362fb49`](https://github.com/valbuild/val/commit/362fb49f30d2b04c4ff78d54dca2bf5ad978a05c), [`c595799`](https://github.com/valbuild/val/commit/c59579977a436ec530c6c69f2b340ab9829d97ab)]:
|
|
8
|
+
- @valbuild/core@0.128.0
|
|
9
|
+
- @valbuild/server@0.128.0
|
|
10
|
+
- @valbuild/shared@0.128.0
|
|
11
|
+
|
|
3
12
|
## 0.127.0
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -154,7 +154,7 @@ shape, or changed semantics an older client would misread.
|
|
|
154
154
|
| `fix/download-remote` | Download a remote file back into the project. |
|
|
155
155
|
| `login` | The `val.login` command (device flow; writes `.val/pat.json`, the same file the CLI uses). |
|
|
156
156
|
| `completions/mediaPath` | The `path` of an image or file, with `width`/`height`/`mimeType` filled in on accept. |
|
|
157
|
-
| `completions/galleryKey` | Keys of an `s.
|
|
157
|
+
| `completions/galleryKey` | Keys of an `s.imageset()` / `s.fileset()` collection. |
|
|
158
158
|
| `completions/keyOf` | Keys of the record or object an `s.keyOf()` field points at. |
|
|
159
159
|
| `completions/route` | Routes the project defines. |
|
|
160
160
|
| `completions/richtextLink` | Route completion inside a richtext inline link's `href`. |
|
|
@@ -206,7 +206,7 @@ export type GalleryMembership = {
|
|
|
206
206
|
/** Module path of the gallery this field points at. */
|
|
207
207
|
referencedModule: string;
|
|
208
208
|
/** The gallery's directory, when it declares one. */
|
|
209
|
-
|
|
209
|
+
dir?: string;
|
|
210
210
|
/** The path the field currently holds. */
|
|
211
211
|
path: string;
|
|
212
212
|
/** `image` or `file`, for wording and for which metadata to read. */
|
|
@@ -183,7 +183,7 @@ var packageJson = {
|
|
|
183
183
|
"lsp",
|
|
184
184
|
"language-server"
|
|
185
185
|
],
|
|
186
|
-
version: "0.
|
|
186
|
+
version: "0.128.0",
|
|
187
187
|
bin: {
|
|
188
188
|
"val-language-server": "./bin.js"
|
|
189
189
|
},
|
|
@@ -1707,7 +1707,7 @@ function longestResolvedPrefixRange(modulePath, modulePathMap) {
|
|
|
1707
1707
|
/**
|
|
1708
1708
|
* Gallery checks core emits unconditionally.
|
|
1709
1709
|
*
|
|
1710
|
-
* `RecordSchema.validate` attaches these to every `s.
|
|
1710
|
+
* `RecordSchema.validate` attaches these to every `s.imageset()` / `s.fileset()`
|
|
1711
1711
|
* module whether or not anything is actually wrong (see
|
|
1712
1712
|
* `packages/core/src/schema/record.ts`): they are placeholders asking someone to
|
|
1713
1713
|
* go and look. `val validate` looks by running the matching fix handler, which
|
|
@@ -1856,7 +1856,7 @@ function galleryMembershipAt({
|
|
|
1856
1856
|
return undefined;
|
|
1857
1857
|
}
|
|
1858
1858
|
const gallery = snapshot?.schemas[referencedModule];
|
|
1859
|
-
const
|
|
1859
|
+
const dir = gallery?.type === "record" && typeof gallery.dir === "string" ? gallery.dir : undefined;
|
|
1860
1860
|
// Core emits TWO fixless errors on a gallery-backed field: this one, and "an
|
|
1861
1861
|
// image from a gallery must not carry its own width, height...". Both look
|
|
1862
1862
|
// identical from here, and offering "add it to the gallery" for the second
|
|
@@ -1871,8 +1871,8 @@ function galleryMembershipAt({
|
|
|
1871
1871
|
}
|
|
1872
1872
|
return {
|
|
1873
1873
|
referencedModule,
|
|
1874
|
-
...(
|
|
1875
|
-
|
|
1874
|
+
...(dir !== undefined ? {
|
|
1875
|
+
dir
|
|
1876
1876
|
} : {}),
|
|
1877
1877
|
path: currentPath,
|
|
1878
1878
|
mediaType: schema.type
|
|
@@ -3455,7 +3455,7 @@ function createSchemaDrivenCompletions({
|
|
|
3455
3455
|
if (!container || typeof container !== "object" || !("type" in container) || container.type !== "record" || !("mediaType" in container) || !container.mediaType) {
|
|
3456
3456
|
return [];
|
|
3457
3457
|
}
|
|
3458
|
-
const directory = "
|
|
3458
|
+
const directory = "dir" in container && typeof container.dir === "string" ? container.dir : undefined;
|
|
3459
3459
|
const galleryFiles = container.mediaType === "images" ? files.images(directory) : files.list(directory);
|
|
3460
3460
|
return items(galleryFiles.map(file => file.ref), vscodeLanguageserver.CompletionItemKind.File, range);
|
|
3461
3461
|
}
|
|
@@ -3521,11 +3521,11 @@ function mediaPathItems({
|
|
|
3521
3521
|
}) {
|
|
3522
3522
|
const referencedModule = typeof container.referencedModule === "string" ? container.referencedModule : undefined;
|
|
3523
3523
|
const options = container.options;
|
|
3524
|
-
let directory = typeof options?.
|
|
3524
|
+
let directory = typeof options?.dir === "string" ? options.dir : undefined;
|
|
3525
3525
|
if (directory === undefined && referencedModule) {
|
|
3526
3526
|
const gallery = snapshot.schemas[referencedModule];
|
|
3527
|
-
if (gallery?.type === "record" && typeof gallery.
|
|
3528
|
-
directory = gallery.
|
|
3527
|
+
if (gallery?.type === "record" && typeof gallery.dir === "string") {
|
|
3528
|
+
directory = gallery.dir;
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
3531
3531
|
const candidates = container.type === "image" ? files.images(directory) : files.list(directory);
|
|
@@ -3711,7 +3711,7 @@ async function createGalleryMembershipActions({
|
|
|
3711
3711
|
if (register) {
|
|
3712
3712
|
actions.push(register);
|
|
3713
3713
|
}
|
|
3714
|
-
if (allowRename && gallery.
|
|
3714
|
+
if (allowRename && gallery.dir && onDisk) {
|
|
3715
3715
|
const move = createMoveIntoGalleryDirectoryAction({
|
|
3716
3716
|
document,
|
|
3717
3717
|
gallery,
|
|
@@ -3736,7 +3736,7 @@ async function createRegisterInGalleryAction({
|
|
|
3736
3736
|
// a "file does not exist" one.
|
|
3737
3737
|
return undefined;
|
|
3738
3738
|
}
|
|
3739
|
-
if (gallery.
|
|
3739
|
+
if (gallery.dir && !gallery.path.startsWith(`${gallery.dir}/`)) {
|
|
3740
3740
|
// Outside the gallery's directory: registering it would break the gallery's
|
|
3741
3741
|
// own directory check. Moving is the remedy, not registering.
|
|
3742
3742
|
return undefined;
|
|
@@ -3777,7 +3777,7 @@ function createMoveIntoGalleryDirectoryAction({
|
|
|
3777
3777
|
gallery,
|
|
3778
3778
|
valRoot
|
|
3779
3779
|
}) {
|
|
3780
|
-
const directory = gallery.
|
|
3780
|
+
const directory = gallery.dir;
|
|
3781
3781
|
if (!directory || gallery.path.startsWith(`${directory}/`)) {
|
|
3782
3782
|
return undefined;
|
|
3783
3783
|
}
|
|
@@ -183,7 +183,7 @@ var packageJson = {
|
|
|
183
183
|
"lsp",
|
|
184
184
|
"language-server"
|
|
185
185
|
],
|
|
186
|
-
version: "0.
|
|
186
|
+
version: "0.128.0",
|
|
187
187
|
bin: {
|
|
188
188
|
"val-language-server": "./bin.js"
|
|
189
189
|
},
|
|
@@ -1707,7 +1707,7 @@ function longestResolvedPrefixRange(modulePath, modulePathMap) {
|
|
|
1707
1707
|
/**
|
|
1708
1708
|
* Gallery checks core emits unconditionally.
|
|
1709
1709
|
*
|
|
1710
|
-
* `RecordSchema.validate` attaches these to every `s.
|
|
1710
|
+
* `RecordSchema.validate` attaches these to every `s.imageset()` / `s.fileset()`
|
|
1711
1711
|
* module whether or not anything is actually wrong (see
|
|
1712
1712
|
* `packages/core/src/schema/record.ts`): they are placeholders asking someone to
|
|
1713
1713
|
* go and look. `val validate` looks by running the matching fix handler, which
|
|
@@ -1856,7 +1856,7 @@ function galleryMembershipAt({
|
|
|
1856
1856
|
return undefined;
|
|
1857
1857
|
}
|
|
1858
1858
|
const gallery = snapshot?.schemas[referencedModule];
|
|
1859
|
-
const
|
|
1859
|
+
const dir = gallery?.type === "record" && typeof gallery.dir === "string" ? gallery.dir : undefined;
|
|
1860
1860
|
// Core emits TWO fixless errors on a gallery-backed field: this one, and "an
|
|
1861
1861
|
// image from a gallery must not carry its own width, height...". Both look
|
|
1862
1862
|
// identical from here, and offering "add it to the gallery" for the second
|
|
@@ -1871,8 +1871,8 @@ function galleryMembershipAt({
|
|
|
1871
1871
|
}
|
|
1872
1872
|
return {
|
|
1873
1873
|
referencedModule,
|
|
1874
|
-
...(
|
|
1875
|
-
|
|
1874
|
+
...(dir !== undefined ? {
|
|
1875
|
+
dir
|
|
1876
1876
|
} : {}),
|
|
1877
1877
|
path: currentPath,
|
|
1878
1878
|
mediaType: schema.type
|
|
@@ -3455,7 +3455,7 @@ function createSchemaDrivenCompletions({
|
|
|
3455
3455
|
if (!container || typeof container !== "object" || !("type" in container) || container.type !== "record" || !("mediaType" in container) || !container.mediaType) {
|
|
3456
3456
|
return [];
|
|
3457
3457
|
}
|
|
3458
|
-
const directory = "
|
|
3458
|
+
const directory = "dir" in container && typeof container.dir === "string" ? container.dir : undefined;
|
|
3459
3459
|
const galleryFiles = container.mediaType === "images" ? files.images(directory) : files.list(directory);
|
|
3460
3460
|
return items(galleryFiles.map(file => file.ref), vscodeLanguageserver.CompletionItemKind.File, range);
|
|
3461
3461
|
}
|
|
@@ -3521,11 +3521,11 @@ function mediaPathItems({
|
|
|
3521
3521
|
}) {
|
|
3522
3522
|
const referencedModule = typeof container.referencedModule === "string" ? container.referencedModule : undefined;
|
|
3523
3523
|
const options = container.options;
|
|
3524
|
-
let directory = typeof options?.
|
|
3524
|
+
let directory = typeof options?.dir === "string" ? options.dir : undefined;
|
|
3525
3525
|
if (directory === undefined && referencedModule) {
|
|
3526
3526
|
const gallery = snapshot.schemas[referencedModule];
|
|
3527
|
-
if (gallery?.type === "record" && typeof gallery.
|
|
3528
|
-
directory = gallery.
|
|
3527
|
+
if (gallery?.type === "record" && typeof gallery.dir === "string") {
|
|
3528
|
+
directory = gallery.dir;
|
|
3529
3529
|
}
|
|
3530
3530
|
}
|
|
3531
3531
|
const candidates = container.type === "image" ? files.images(directory) : files.list(directory);
|
|
@@ -3711,7 +3711,7 @@ async function createGalleryMembershipActions({
|
|
|
3711
3711
|
if (register) {
|
|
3712
3712
|
actions.push(register);
|
|
3713
3713
|
}
|
|
3714
|
-
if (allowRename && gallery.
|
|
3714
|
+
if (allowRename && gallery.dir && onDisk) {
|
|
3715
3715
|
const move = createMoveIntoGalleryDirectoryAction({
|
|
3716
3716
|
document,
|
|
3717
3717
|
gallery,
|
|
@@ -3736,7 +3736,7 @@ async function createRegisterInGalleryAction({
|
|
|
3736
3736
|
// a "file does not exist" one.
|
|
3737
3737
|
return undefined;
|
|
3738
3738
|
}
|
|
3739
|
-
if (gallery.
|
|
3739
|
+
if (gallery.dir && !gallery.path.startsWith(`${gallery.dir}/`)) {
|
|
3740
3740
|
// Outside the gallery's directory: registering it would break the gallery's
|
|
3741
3741
|
// own directory check. Moving is the remedy, not registering.
|
|
3742
3742
|
return undefined;
|
|
@@ -3777,7 +3777,7 @@ function createMoveIntoGalleryDirectoryAction({
|
|
|
3777
3777
|
gallery,
|
|
3778
3778
|
valRoot
|
|
3779
3779
|
}) {
|
|
3780
|
-
const directory = gallery.
|
|
3780
|
+
const directory = gallery.dir;
|
|
3781
3781
|
if (!directory || gallery.path.startsWith(`${directory}/`)) {
|
|
3782
3782
|
return undefined;
|
|
3783
3783
|
}
|
|
@@ -172,7 +172,7 @@ var packageJson = {
|
|
|
172
172
|
"lsp",
|
|
173
173
|
"language-server"
|
|
174
174
|
],
|
|
175
|
-
version: "0.
|
|
175
|
+
version: "0.128.0",
|
|
176
176
|
bin: {
|
|
177
177
|
"val-language-server": "./bin.js"
|
|
178
178
|
},
|
|
@@ -1696,7 +1696,7 @@ function longestResolvedPrefixRange(modulePath, modulePathMap) {
|
|
|
1696
1696
|
/**
|
|
1697
1697
|
* Gallery checks core emits unconditionally.
|
|
1698
1698
|
*
|
|
1699
|
-
* `RecordSchema.validate` attaches these to every `s.
|
|
1699
|
+
* `RecordSchema.validate` attaches these to every `s.imageset()` / `s.fileset()`
|
|
1700
1700
|
* module whether or not anything is actually wrong (see
|
|
1701
1701
|
* `packages/core/src/schema/record.ts`): they are placeholders asking someone to
|
|
1702
1702
|
* go and look. `val validate` looks by running the matching fix handler, which
|
|
@@ -1845,7 +1845,7 @@ function galleryMembershipAt({
|
|
|
1845
1845
|
return undefined;
|
|
1846
1846
|
}
|
|
1847
1847
|
const gallery = snapshot?.schemas[referencedModule];
|
|
1848
|
-
const
|
|
1848
|
+
const dir = gallery?.type === "record" && typeof gallery.dir === "string" ? gallery.dir : undefined;
|
|
1849
1849
|
// Core emits TWO fixless errors on a gallery-backed field: this one, and "an
|
|
1850
1850
|
// image from a gallery must not carry its own width, height...". Both look
|
|
1851
1851
|
// identical from here, and offering "add it to the gallery" for the second
|
|
@@ -1860,8 +1860,8 @@ function galleryMembershipAt({
|
|
|
1860
1860
|
}
|
|
1861
1861
|
return {
|
|
1862
1862
|
referencedModule,
|
|
1863
|
-
...(
|
|
1864
|
-
|
|
1863
|
+
...(dir !== undefined ? {
|
|
1864
|
+
dir
|
|
1865
1865
|
} : {}),
|
|
1866
1866
|
path: currentPath,
|
|
1867
1867
|
mediaType: schema.type
|
|
@@ -3444,7 +3444,7 @@ function createSchemaDrivenCompletions({
|
|
|
3444
3444
|
if (!container || typeof container !== "object" || !("type" in container) || container.type !== "record" || !("mediaType" in container) || !container.mediaType) {
|
|
3445
3445
|
return [];
|
|
3446
3446
|
}
|
|
3447
|
-
const directory = "
|
|
3447
|
+
const directory = "dir" in container && typeof container.dir === "string" ? container.dir : undefined;
|
|
3448
3448
|
const galleryFiles = container.mediaType === "images" ? files.images(directory) : files.list(directory);
|
|
3449
3449
|
return items(galleryFiles.map(file => file.ref), CompletionItemKind.File, range);
|
|
3450
3450
|
}
|
|
@@ -3510,11 +3510,11 @@ function mediaPathItems({
|
|
|
3510
3510
|
}) {
|
|
3511
3511
|
const referencedModule = typeof container.referencedModule === "string" ? container.referencedModule : undefined;
|
|
3512
3512
|
const options = container.options;
|
|
3513
|
-
let directory = typeof options?.
|
|
3513
|
+
let directory = typeof options?.dir === "string" ? options.dir : undefined;
|
|
3514
3514
|
if (directory === undefined && referencedModule) {
|
|
3515
3515
|
const gallery = snapshot.schemas[referencedModule];
|
|
3516
|
-
if (gallery?.type === "record" && typeof gallery.
|
|
3517
|
-
directory = gallery.
|
|
3516
|
+
if (gallery?.type === "record" && typeof gallery.dir === "string") {
|
|
3517
|
+
directory = gallery.dir;
|
|
3518
3518
|
}
|
|
3519
3519
|
}
|
|
3520
3520
|
const candidates = container.type === "image" ? files.images(directory) : files.list(directory);
|
|
@@ -3700,7 +3700,7 @@ async function createGalleryMembershipActions({
|
|
|
3700
3700
|
if (register) {
|
|
3701
3701
|
actions.push(register);
|
|
3702
3702
|
}
|
|
3703
|
-
if (allowRename && gallery.
|
|
3703
|
+
if (allowRename && gallery.dir && onDisk) {
|
|
3704
3704
|
const move = createMoveIntoGalleryDirectoryAction({
|
|
3705
3705
|
document,
|
|
3706
3706
|
gallery,
|
|
@@ -3725,7 +3725,7 @@ async function createRegisterInGalleryAction({
|
|
|
3725
3725
|
// a "file does not exist" one.
|
|
3726
3726
|
return undefined;
|
|
3727
3727
|
}
|
|
3728
|
-
if (gallery.
|
|
3728
|
+
if (gallery.dir && !gallery.path.startsWith(`${gallery.dir}/`)) {
|
|
3729
3729
|
// Outside the gallery's directory: registering it would break the gallery's
|
|
3730
3730
|
// own directory check. Moving is the remedy, not registering.
|
|
3731
3731
|
return undefined;
|
|
@@ -3766,7 +3766,7 @@ function createMoveIntoGalleryDirectoryAction({
|
|
|
3766
3766
|
gallery,
|
|
3767
3767
|
valRoot
|
|
3768
3768
|
}) {
|
|
3769
|
-
const directory = gallery.
|
|
3769
|
+
const directory = gallery.dir;
|
|
3770
3770
|
if (!directory || gallery.path.startsWith(`${directory}/`)) {
|
|
3771
3771
|
return undefined;
|
|
3772
3772
|
}
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"lsp",
|
|
12
12
|
"language-server"
|
|
13
13
|
],
|
|
14
|
-
"version": "0.
|
|
14
|
+
"version": "0.128.0",
|
|
15
15
|
"bin": {
|
|
16
16
|
"val-language-server": "./bin.js"
|
|
17
17
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"typescript": "^6.0.3",
|
|
30
30
|
"vscode-languageserver": "^10.1.0",
|
|
31
31
|
"vscode-languageserver-textdocument": "^1.0.14",
|
|
32
|
-
"@valbuild/
|
|
33
|
-
"@valbuild/shared": "0.
|
|
34
|
-
"@valbuild/
|
|
32
|
+
"@valbuild/server": "0.128.0",
|
|
33
|
+
"@valbuild/shared": "0.128.0",
|
|
34
|
+
"@valbuild/core": "0.128.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/jest": "^30.0.0",
|