@danypops/lector 0.1.6 → 0.1.7
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/package.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { readFileSync } from "node:fs";
|
|
1
|
+
import { readFileSync, realpathSync } from "node:fs";
|
|
2
2
|
import { join } from "node:path";
|
|
3
3
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
4
4
|
import type { CallHierarchyEntry, IncomingCall, OutgoingCall } from "../../domain/call-hierarchy.ts";
|
|
@@ -119,6 +119,8 @@ interface LspPublishDiagnosticsParams {
|
|
|
119
119
|
}
|
|
120
120
|
|
|
121
121
|
/** LSP DiagnosticSeverity is 1-4; the spec recommends treating an absent severity as an error. */
|
|
122
|
+
const RUNTIME_EXECUTABLE = realpathSync(process.execPath);
|
|
123
|
+
|
|
122
124
|
const LSP_DIAGNOSTIC_SEVERITY_NAMES: Readonly<Record<number, DiagnosticSeverity>> = {
|
|
123
125
|
1: "error",
|
|
124
126
|
2: "warning",
|
|
@@ -134,7 +136,7 @@ function isHierarchicalDocumentSymbol(item: LspDocumentSymbol | LspSymbolInforma
|
|
|
134
136
|
/** Resolves a descriptor's launch into a spawnable command + args. */
|
|
135
137
|
function resolveLanguageServerCommand(descriptor: LanguageServerDescriptor): { command: string; args: string[] } {
|
|
136
138
|
if (descriptor.launch.kind === "npm-module") {
|
|
137
|
-
return { command:
|
|
139
|
+
return { command: RUNTIME_EXECUTABLE, args: [fileURLToPath(import.meta.resolve(descriptor.launch.entryModule)), ...descriptor.args] };
|
|
138
140
|
}
|
|
139
141
|
return { command: descriptor.launch.command, args: [...descriptor.args] };
|
|
140
142
|
}
|