@webgal/language-server 0.0.2-alpha.1 → 0.0.2-alpha.2
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/build/browser.cjs +1 -1
- package/build/browser.mjs +1 -1
- package/build/index.cjs +1 -1
- package/build/index.mjs +1 -1
- package/build/{onInitialize-uaxhCEGr.cjs → onInitialize-7r14ko5I.cjs} +22 -4
- package/build/{onInitialize-DIUUrHI3.mjs → onInitialize-DLHBz6ds.mjs} +22 -4
- package/package.json +3 -3
package/build/browser.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
require('./providerState-B7hGbqQj.cjs');
|
|
3
3
|
const require_utils = require('./utils.cjs');
|
|
4
|
-
const require_onInitialize = require('./onInitialize-
|
|
4
|
+
const require_onInitialize = require('./onInitialize-7r14ko5I.cjs');
|
|
5
5
|
let _volar_language_server_browser = require("@volar/language-server/browser");
|
|
6
6
|
|
|
7
7
|
//#region src/browser.ts
|
package/build/browser.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./providerState-CLCXHs37.mjs";
|
|
2
2
|
import { bindCoreFileAccessorToClientVfs, createClientVfsFileSystem, createWebgalVirtualCode, updateWebgalVirtualCode } from "./utils.mjs";
|
|
3
|
-
import { i as registerConnectionHandlers, n as applyServerCapabilities, r as createWebgalService, t as applyClientCapabilities } from "./onInitialize-
|
|
3
|
+
import { i as registerConnectionHandlers, n as applyServerCapabilities, r as createWebgalService, t as applyClientCapabilities } from "./onInitialize-DLHBz6ds.mjs";
|
|
4
4
|
import { createConnection, createConnection as createConnection$1, createServer, createSimpleProject } from "@volar/language-server/browser";
|
|
5
5
|
|
|
6
6
|
//#region src/browser.ts
|
package/build/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
require('./providerState-B7hGbqQj.cjs');
|
|
2
2
|
const require_utils = require('./utils.cjs');
|
|
3
|
-
const require_onInitialize = require('./onInitialize-
|
|
3
|
+
const require_onInitialize = require('./onInitialize-7r14ko5I.cjs');
|
|
4
4
|
let _volar_language_server_node = require("@volar/language-server/node");
|
|
5
5
|
let vscode_languageserver_node = require("vscode-languageserver/node");
|
|
6
6
|
|
package/build/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "./providerState-CLCXHs37.mjs";
|
|
2
2
|
import { bindCoreFileAccessorToClientVfs, createClientVfsFileSystem, createWebgalVirtualCode, updateWebgalVirtualCode } from "./utils.mjs";
|
|
3
|
-
import { i as registerConnectionHandlers, n as applyServerCapabilities, r as createWebgalService, t as applyClientCapabilities } from "./onInitialize-
|
|
3
|
+
import { i as registerConnectionHandlers, n as applyServerCapabilities, r as createWebgalService, t as applyClientCapabilities } from "./onInitialize-DLHBz6ds.mjs";
|
|
4
4
|
import { createConnection, createServer, createSimpleProject } from "@volar/language-server/node";
|
|
5
5
|
import { createConnection as createConnection$1 } from "vscode-languageserver/node";
|
|
6
6
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const require_utils = require('./utils.cjs');
|
|
2
2
|
let _volar_language_server = require("@volar/language-server");
|
|
3
|
+
let vscode_uri = require("vscode-uri");
|
|
3
4
|
|
|
4
5
|
//#region src/events/onDid.ts
|
|
5
6
|
var onDid_default = function(documents, connection) {
|
|
@@ -11,6 +12,9 @@ var onDid_default = function(documents, connection) {
|
|
|
11
12
|
else require_utils.setGlobalSettings(change.settings.XRWebGalLanguageServer || require_utils.defaultSettings);
|
|
12
13
|
connection.languages.diagnostics.refresh();
|
|
13
14
|
});
|
|
15
|
+
connection.onNotification("webgal/vfsChanged", () => {
|
|
16
|
+
connection.sendRequest("workspace/documentLink/refresh");
|
|
17
|
+
});
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
//#endregion
|
|
@@ -1294,6 +1298,11 @@ function provideDefinition(document, position, definitionMap) {
|
|
|
1294
1298
|
//#endregion
|
|
1295
1299
|
//#region src/events/onDocumentLinks.ts
|
|
1296
1300
|
async function provideDocumentLinks(document, connection, candidates) {
|
|
1301
|
+
const toFileTarget = (path) => {
|
|
1302
|
+
if (!path) return;
|
|
1303
|
+
if (path.startsWith("file://")) return vscode_uri.URI.parse(path).toString();
|
|
1304
|
+
return vscode_uri.URI.file(path).toString();
|
|
1305
|
+
};
|
|
1297
1306
|
const pathArray = document.uri.split("/");
|
|
1298
1307
|
const currentDirectory = await connection.sendRequest("client/currentDirectory");
|
|
1299
1308
|
const documentLinks = [];
|
|
@@ -1305,12 +1314,21 @@ async function provideDocumentLinks(document, connection, candidates) {
|
|
|
1305
1314
|
let targetPath;
|
|
1306
1315
|
if (isConfig) targetPath = await connection.sendRequest("client/FJoin", currentDirectory + "/");
|
|
1307
1316
|
else targetPath = await connection.sendRequest("client/FJoin", currentDirectory + "/" + dirResources);
|
|
1308
|
-
|
|
1309
|
-
|
|
1317
|
+
const defaultPath = await connection.sendRequest("client/FJoin", targetPath + "/" + matchText);
|
|
1318
|
+
let stat = await connection.sendRequest("client/FStat", defaultPath);
|
|
1319
|
+
let resolvedPath = defaultPath;
|
|
1320
|
+
if (!stat) {
|
|
1321
|
+
const foundPath = await connection.sendRequest("client/findFile", [currentDirectory, matchText]);
|
|
1322
|
+
if (foundPath) {
|
|
1323
|
+
resolvedPath = foundPath;
|
|
1324
|
+
stat = await connection.sendRequest("client/FStat", resolvedPath);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
const tooltip = stat && resolvedPath ? resolvedPath : "unknown file";
|
|
1310
1328
|
documentLinks.push({
|
|
1311
|
-
target:
|
|
1329
|
+
target: toFileTarget(resolvedPath),
|
|
1312
1330
|
range: _volar_language_server.Range.create(_volar_language_server.Position.create(candidate.line, candidate.start), _volar_language_server.Position.create(candidate.line, candidate.end)),
|
|
1313
|
-
tooltip
|
|
1331
|
+
tooltip
|
|
1314
1332
|
});
|
|
1315
1333
|
}
|
|
1316
1334
|
return [...documentLinks];
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { StateConfig, defaultSettings, documentSettings, findTokenRange, getPatternAtPosition, getStageCompletionContext, getWebgalDefinitionMap, getWebgalDocumentLinkCandidates, getWebgalFoldingRanges, getWebgalLineCommandTypes, getWebgalSourceUriString, getWebgalVirtualCodeLines, getWebgalVirtualCodeText, getWordAtPosition, setGlobalSettings, validateTextDocument } from "./utils.mjs";
|
|
2
2
|
import { CompletionItemKind, DidChangeConfigurationNotification, InsertTextFormat, LocationLink, MarkupKind, Position, Range, TextDocumentSyncKind } from "@volar/language-server";
|
|
3
|
+
import { URI } from "vscode-uri";
|
|
3
4
|
|
|
4
5
|
//#region src/events/onDid.ts
|
|
5
6
|
var onDid_default = function(documents, connection) {
|
|
@@ -11,6 +12,9 @@ var onDid_default = function(documents, connection) {
|
|
|
11
12
|
else setGlobalSettings(change.settings.XRWebGalLanguageServer || defaultSettings);
|
|
12
13
|
connection.languages.diagnostics.refresh();
|
|
13
14
|
});
|
|
15
|
+
connection.onNotification("webgal/vfsChanged", () => {
|
|
16
|
+
connection.sendRequest("workspace/documentLink/refresh");
|
|
17
|
+
});
|
|
14
18
|
};
|
|
15
19
|
|
|
16
20
|
//#endregion
|
|
@@ -1294,6 +1298,11 @@ function provideDefinition(document, position, definitionMap) {
|
|
|
1294
1298
|
//#endregion
|
|
1295
1299
|
//#region src/events/onDocumentLinks.ts
|
|
1296
1300
|
async function provideDocumentLinks(document, connection, candidates) {
|
|
1301
|
+
const toFileTarget = (path) => {
|
|
1302
|
+
if (!path) return;
|
|
1303
|
+
if (path.startsWith("file://")) return URI.parse(path).toString();
|
|
1304
|
+
return URI.file(path).toString();
|
|
1305
|
+
};
|
|
1297
1306
|
const pathArray = document.uri.split("/");
|
|
1298
1307
|
const currentDirectory = await connection.sendRequest("client/currentDirectory");
|
|
1299
1308
|
const documentLinks = [];
|
|
@@ -1305,12 +1314,21 @@ async function provideDocumentLinks(document, connection, candidates) {
|
|
|
1305
1314
|
let targetPath;
|
|
1306
1315
|
if (isConfig) targetPath = await connection.sendRequest("client/FJoin", currentDirectory + "/");
|
|
1307
1316
|
else targetPath = await connection.sendRequest("client/FJoin", currentDirectory + "/" + dirResources);
|
|
1308
|
-
|
|
1309
|
-
|
|
1317
|
+
const defaultPath = await connection.sendRequest("client/FJoin", targetPath + "/" + matchText);
|
|
1318
|
+
let stat = await connection.sendRequest("client/FStat", defaultPath);
|
|
1319
|
+
let resolvedPath = defaultPath;
|
|
1320
|
+
if (!stat) {
|
|
1321
|
+
const foundPath = await connection.sendRequest("client/findFile", [currentDirectory, matchText]);
|
|
1322
|
+
if (foundPath) {
|
|
1323
|
+
resolvedPath = foundPath;
|
|
1324
|
+
stat = await connection.sendRequest("client/FStat", resolvedPath);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
const tooltip = stat && resolvedPath ? resolvedPath : "unknown file";
|
|
1310
1328
|
documentLinks.push({
|
|
1311
|
-
target:
|
|
1329
|
+
target: toFileTarget(resolvedPath),
|
|
1312
1330
|
range: Range.create(Position.create(candidate.line, candidate.start), Position.create(candidate.line, candidate.end)),
|
|
1313
|
-
tooltip
|
|
1331
|
+
tooltip
|
|
1314
1332
|
});
|
|
1315
1333
|
}
|
|
1316
1334
|
return [...documentLinks];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webgal/language-server",
|
|
3
|
-
"version": "0.0.2-alpha.
|
|
3
|
+
"version": "0.0.2-alpha.2",
|
|
4
4
|
"main": "build/index.cjs",
|
|
5
5
|
"module": "build/index.mjs",
|
|
6
6
|
"types": "build/index.d.mts",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"@volar/language-service": "~2.4.0",
|
|
56
56
|
"@volar/typescript": "~2.4.0",
|
|
57
57
|
"@webgal/language-core": "0.0.2-alpha.1",
|
|
58
|
-
"@webgal/language-service": "0.0.2-alpha.
|
|
58
|
+
"@webgal/language-service": "0.0.2-alpha.3",
|
|
59
59
|
"tsc-alias": "^1.8.16",
|
|
60
60
|
"vscode-languageserver": "^9.0.1",
|
|
61
61
|
"vscode-languageserver-textdocument": "^1.0.11",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"tsdown": "^0.20.3",
|
|
69
69
|
"tsx": "^4.21.0"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "ebff8c309c7b7940bdebed1dc096d99a318af3cc"
|
|
72
72
|
}
|