@rohal12/spindle-lsp 0.8.2 → 0.8.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/dist/bin.js +11 -3
- package/dist/bin.js.map +2 -2
- package/package.json +1 -1
package/dist/bin.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from "node:module";
|
|
3
|
+
const require = __createRequire(import.meta.url);
|
|
2
4
|
var __create = Object.create;
|
|
3
5
|
var __defProp = Object.defineProperty;
|
|
4
6
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -59705,7 +59707,7 @@ function startServer(_args) {
|
|
|
59705
59707
|
connection.onInitialize((params) => {
|
|
59706
59708
|
console.error("[spindle-lsp] onInitialize called");
|
|
59707
59709
|
const initOptions = params.initializationOptions ?? {};
|
|
59708
|
-
workspaceRoot = initOptions.workspaceRoot ?? (params.workspaceFolders?.[0]?.uri ? uriToFsPath(params.workspaceFolders[0].uri) : void 0);
|
|
59710
|
+
workspaceRoot = initOptions.workspaceRoot ?? (params.workspaceFolders?.[0]?.uri ? uriToFsPath(params.workspaceFolders[0].uri) : void 0) ?? (params.rootUri ? uriToFsPath(params.rootUri) : void 0);
|
|
59709
59711
|
const projectConfig = workspaceRoot ? loadConfigFromDisk(workspaceRoot) : { macros: {} };
|
|
59710
59712
|
const config2 = {
|
|
59711
59713
|
disabledPlugins: initOptions.disabledPlugins,
|
|
@@ -59781,7 +59783,13 @@ function startServer(_args) {
|
|
|
59781
59783
|
connection.onDidCloseTextDocument(({ textDocument }) => {
|
|
59782
59784
|
documents.delete(textDocument.uri);
|
|
59783
59785
|
if (workspace) {
|
|
59784
|
-
|
|
59786
|
+
try {
|
|
59787
|
+
const fsPath = uriToFsPath(textDocument.uri);
|
|
59788
|
+
const text = readFileSync7(fsPath, "utf-8");
|
|
59789
|
+
workspace.documents.update(textDocument.uri, text);
|
|
59790
|
+
} catch {
|
|
59791
|
+
workspace.documents.close(textDocument.uri);
|
|
59792
|
+
}
|
|
59785
59793
|
}
|
|
59786
59794
|
});
|
|
59787
59795
|
connection.onDidChangeWatchedFiles(({ changes }) => {
|
|
@@ -59850,7 +59858,7 @@ var init_server4 = __esm({
|
|
|
59850
59858
|
|
|
59851
59859
|
// src/bin.ts
|
|
59852
59860
|
var args = process.argv.slice(2);
|
|
59853
|
-
var VERSION = "0.8.
|
|
59861
|
+
var VERSION = "0.8.4";
|
|
59854
59862
|
var HELP = `spindle-lsp v${VERSION}
|
|
59855
59863
|
Language Server Protocol server for Spindle story format
|
|
59856
59864
|
|