@marko/language-server 1.0.7 → 1.0.8
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/index.js +5 -1
- package/dist/index.js.map +3 -3
- package/dist/index.mjs +13 -8
- package/dist/index.mjs.map +3 -3
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
TextDocumentSyncKind,
|
|
14
14
|
createConnection
|
|
15
15
|
} from "vscode-languageserver/node";
|
|
16
|
-
import { Project as
|
|
16
|
+
import { Project as Project5 } from "@marko/language-tools";
|
|
17
17
|
|
|
18
18
|
// src/utils/file.ts
|
|
19
19
|
import path from "path";
|
|
@@ -1177,7 +1177,7 @@ import { URI as URI6 } from "vscode-uri";
|
|
|
1177
1177
|
import * as prettier2 from "prettier";
|
|
1178
1178
|
import {
|
|
1179
1179
|
NodeType as NodeType9,
|
|
1180
|
-
Project as
|
|
1180
|
+
Project as Project4,
|
|
1181
1181
|
ScriptLang,
|
|
1182
1182
|
extractScript
|
|
1183
1183
|
} from "@marko/language-tools";
|
|
@@ -1186,11 +1186,16 @@ import {
|
|
|
1186
1186
|
import path6 from "path";
|
|
1187
1187
|
import {
|
|
1188
1188
|
Processors,
|
|
1189
|
+
Project as Project3,
|
|
1189
1190
|
getExt,
|
|
1190
1191
|
isDefinitionFile
|
|
1191
1192
|
} from "@marko/language-tools";
|
|
1192
1193
|
var fsPathReg = /^(?:[./\\]|[A-Z]:)/i;
|
|
1193
1194
|
var modulePartsReg = /^((?:@(?:[^/]+)\/)?(?:[^/]+))(.*)$/;
|
|
1195
|
+
Project3.setDefaultTypePaths({
|
|
1196
|
+
internalTypesFile: path6.join(__dirname, "marko.internal.d.ts"),
|
|
1197
|
+
markoTypesFile: path6.join(__dirname, "marko.runtime.d.ts")
|
|
1198
|
+
});
|
|
1194
1199
|
function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
|
|
1195
1200
|
var _a, _b, _c;
|
|
1196
1201
|
const processors = Processors.create({
|
|
@@ -1230,7 +1235,7 @@ function patch(ts2, configFile, extractCache2, resolutionCache, host, ps) {
|
|
|
1230
1235
|
}
|
|
1231
1236
|
ps == null ? void 0 : ps.getOrCreateScriptInfoForNormalizedPath(
|
|
1232
1237
|
fileName,
|
|
1233
|
-
|
|
1238
|
+
true,
|
|
1234
1239
|
void 0,
|
|
1235
1240
|
ts2.ScriptKind.Deferred,
|
|
1236
1241
|
false,
|
|
@@ -1409,7 +1414,7 @@ var ScriptService = {
|
|
|
1409
1414
|
return;
|
|
1410
1415
|
const tsProject = getTSProject(filename);
|
|
1411
1416
|
const extracted = processScript(doc, tsProject);
|
|
1412
|
-
const lang =
|
|
1417
|
+
const lang = Project4.getScriptLang(
|
|
1413
1418
|
filename,
|
|
1414
1419
|
tsProject.markoScriptLang,
|
|
1415
1420
|
ts,
|
|
@@ -1793,8 +1798,8 @@ function processScript(doc, tsProject) {
|
|
|
1793
1798
|
ts,
|
|
1794
1799
|
parsed,
|
|
1795
1800
|
lookup,
|
|
1796
|
-
scriptLang:
|
|
1797
|
-
runtimeTypesCode: (_a =
|
|
1801
|
+
scriptLang: Project4.getScriptLang(filename, markoScriptLang, ts, host),
|
|
1802
|
+
runtimeTypesCode: (_a = Project4.getTypeLibs(tsProject.rootDir, ts, host)) == null ? void 0 : _a.markoTypesCode
|
|
1798
1803
|
});
|
|
1799
1804
|
});
|
|
1800
1805
|
}
|
|
@@ -1866,7 +1871,7 @@ function getTSProject(docFsPath) {
|
|
|
1866
1871
|
}
|
|
1867
1872
|
}
|
|
1868
1873
|
const rootDir = configFile && path7.dirname(configFile) || process.cwd();
|
|
1869
|
-
const cache =
|
|
1874
|
+
const cache = Project4.getCache(configFile && rootDir);
|
|
1870
1875
|
let projectCache = cache.get(getTSProject);
|
|
1871
1876
|
let cached;
|
|
1872
1877
|
if (projectCache) {
|
|
@@ -3046,7 +3051,7 @@ for (const command in service.commands) {
|
|
|
3046
3051
|
}
|
|
3047
3052
|
function validateDocs() {
|
|
3048
3053
|
queueDiagnostic();
|
|
3049
|
-
|
|
3054
|
+
Project5.clearCaches();
|
|
3050
3055
|
}
|
|
3051
3056
|
function queueDiagnostic() {
|
|
3052
3057
|
clearTimeout(diagnosticTimeout);
|