@marko/language-server 0.9.0 → 0.11.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/dist/index.js +12 -10
- package/dist/index.js.map +1 -1
- package/dist/utils/compiler.d.ts +5 -1
- package/dist/utils/compiler.js +38 -16
- package/dist/utils/compiler.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -75,14 +75,15 @@ connection.onDefinition((params) => {
|
|
|
75
75
|
connection.onDocumentFormatting(async ({ textDocument, options, }) => {
|
|
76
76
|
try {
|
|
77
77
|
const doc = documents.get(textDocument.uri);
|
|
78
|
-
const { fsPath } = vscode_uri_1.URI.parse(textDocument.uri);
|
|
78
|
+
const { fsPath, scheme } = vscode_uri_1.URI.parse(textDocument.uri);
|
|
79
79
|
const text = doc.getText();
|
|
80
|
-
const
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
80
|
+
const formatted = prettier.format(text, Object.assign({ parser: "marko", filepath: fsPath, tabWidth: options.tabSize, useTabs: options.insertSpaces === false }, (scheme === "file"
|
|
81
|
+
? await prettier
|
|
82
|
+
.resolveConfig(fsPath, {
|
|
83
|
+
editorconfig: true,
|
|
84
|
+
})
|
|
85
|
+
.catch(() => null)
|
|
86
|
+
: null)));
|
|
86
87
|
return [
|
|
87
88
|
node_1.TextEdit.replace(node_1.Range.create(doc.positionAt(0), doc.positionAt(text.length)), formatted),
|
|
88
89
|
];
|
|
@@ -97,7 +98,7 @@ connection.onDocumentFormatting(async ({ textDocument, options, }) => {
|
|
|
97
98
|
connection.onDidChangeWatchedFiles(() => {
|
|
98
99
|
const clearedCompilers = new Set();
|
|
99
100
|
for (const doc of documents.all()) {
|
|
100
|
-
const compiler = (0, compiler_1.
|
|
101
|
+
const { compiler } = (0, compiler_1.getCompilerAndTranslatorForDoc)(doc);
|
|
101
102
|
if (!clearedCompilers.has(compiler)) {
|
|
102
103
|
clearCaches(compiler);
|
|
103
104
|
clearedCompilers.add(compiler);
|
|
@@ -107,7 +108,7 @@ connection.onDidChangeWatchedFiles(() => {
|
|
|
107
108
|
documents.onDidChangeContent((change) => {
|
|
108
109
|
queueValidation(change.document);
|
|
109
110
|
if (change.document.version > 1) {
|
|
110
|
-
clearCaches((0, compiler_1.
|
|
111
|
+
clearCaches((0, compiler_1.getCompilerAndTranslatorForDoc)(change.document).compiler);
|
|
111
112
|
}
|
|
112
113
|
});
|
|
113
114
|
function queueValidation(doc) {
|
|
@@ -130,13 +131,14 @@ function doValidate(doc) {
|
|
|
130
131
|
if (scheme !== "file") {
|
|
131
132
|
return [];
|
|
132
133
|
}
|
|
133
|
-
const compiler = (0, compiler_1.
|
|
134
|
+
const { compiler, translator } = (0, compiler_1.getCompilerAndTranslatorForDoc)(doc);
|
|
134
135
|
const diagnostics = [];
|
|
135
136
|
try {
|
|
136
137
|
compiler.compileSync(doc.getText(), fsPath, {
|
|
137
138
|
cache: getCacheForCompiler(compiler),
|
|
138
139
|
output: "source",
|
|
139
140
|
code: false,
|
|
141
|
+
translator,
|
|
140
142
|
});
|
|
141
143
|
}
|
|
142
144
|
catch (e) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAaoC;AACpC,2CAAiC;AACjC,2FAAkE;AAClE,gEAAqC;AACrC,+BAAkD;AAClD,+
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAaoC;AACpC,2CAAiC;AACjC,2FAAkE;AAClE,gEAAqC;AACrC,+BAAkD;AAClD,+CAI0B;AAC1B,yDAAyD;AACzD,kFAAuD;AACvD,kFAAuD;AAEvD,IACE,OAAO,OAAO,KAAK,WAAW;IAC9B,OAAO,CAAC,UAAU;IAClB,CAAC,CAAC,KAAK,IAAI,OAAO,CAAC,UAAU,C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U,CAAC,CAAC;AAC7B,UAAU,CAAC,MAAM,EAAE,CAAC"}
|
package/dist/utils/compiler.d.ts
CHANGED
|
@@ -52,11 +52,15 @@ export interface TagDefinition {
|
|
|
52
52
|
targetProperty: string;
|
|
53
53
|
}
|
|
54
54
|
export declare type Compiler = typeof import("@marko/compiler");
|
|
55
|
+
export declare type CompilerAndTranslator = {
|
|
56
|
+
compiler: Compiler;
|
|
57
|
+
translator: string;
|
|
58
|
+
};
|
|
55
59
|
export interface TagLibLookup {
|
|
56
60
|
getTagsSorted(): TagDefinition[];
|
|
57
61
|
getTag(tagName: string): TagDefinition;
|
|
58
62
|
getAttribute(tagName: string, attrName: string): AttributeDefinition;
|
|
59
63
|
forEachAttribute(tagName: string, callback: (attr: AttributeDefinition, tag: TagDefinition) => void): void;
|
|
60
64
|
}
|
|
61
|
-
export declare function
|
|
65
|
+
export declare function getCompilerAndTranslatorForDoc(doc: TextDocument): CompilerAndTranslator;
|
|
62
66
|
export declare function getTagLibLookup(document: TextDocument): TagLibLookup | undefined;
|
package/dist/utils/compiler.js
CHANGED
|
@@ -1,32 +1,54 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getTagLibLookup = exports.
|
|
3
|
+
exports.getTagLibLookup = exports.getCompilerAndTranslatorForDoc = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const path_1 = (0, tslib_1.__importDefault)(require("path"));
|
|
6
6
|
const vscode_uri_1 = require("vscode-uri");
|
|
7
7
|
const resolve_from_1 = (0, tslib_1.__importDefault)(require("resolve-from"));
|
|
8
8
|
const lasso_package_root_1 = (0, tslib_1.__importDefault)(require("lasso-package-root"));
|
|
9
|
-
const
|
|
10
|
-
function
|
|
11
|
-
let
|
|
12
|
-
if (!
|
|
13
|
-
|
|
9
|
+
const compilerAndTranslatorForDoc = new WeakMap();
|
|
10
|
+
function getCompilerAndTranslatorForDoc(doc) {
|
|
11
|
+
let compilerAndTranslator = compilerAndTranslatorForDoc.get(doc);
|
|
12
|
+
if (!compilerAndTranslator) {
|
|
13
|
+
compilerAndTranslatorForDoc.set(doc, (compilerAndTranslator = loadCompiler(path_1.default.dirname(vscode_uri_1.URI.parse(doc.uri).fsPath))));
|
|
14
14
|
}
|
|
15
|
-
return
|
|
15
|
+
return compilerAndTranslator;
|
|
16
16
|
}
|
|
17
|
-
exports.
|
|
17
|
+
exports.getCompilerAndTranslatorForDoc = getCompilerAndTranslatorForDoc;
|
|
18
18
|
function getTagLibLookup(document) {
|
|
19
|
-
|
|
19
|
+
try {
|
|
20
|
+
const { compiler, translator } = getCompilerAndTranslatorForDoc(document);
|
|
21
|
+
return compiler.taglib.buildLookup(vscode_uri_1.URI.parse(document.uri).fsPath, translator);
|
|
22
|
+
}
|
|
23
|
+
catch (_a) { }
|
|
20
24
|
}
|
|
21
25
|
exports.getTagLibLookup = getTagLibLookup;
|
|
22
26
|
function loadCompiler(dir) {
|
|
23
|
-
return require(isCompatibleCompilerInstalled(dir)
|
|
24
|
-
? (0, resolve_from_1.default)(dir, "@marko/compiler")
|
|
25
|
-
: "@marko/compiler");
|
|
26
|
-
}
|
|
27
|
-
function isCompatibleCompilerInstalled(dir) {
|
|
28
27
|
const rootDir = lasso_package_root_1.default.getRootDir(dir);
|
|
29
|
-
const
|
|
30
|
-
|
|
28
|
+
const pkgPath = rootDir && resolve_from_1.default.silent(rootDir, "@marko/compiler/package.json");
|
|
29
|
+
const pkg = pkgPath && require(pkgPath);
|
|
30
|
+
if (pkg && /^5\./.test(pkg.version)) {
|
|
31
|
+
try {
|
|
32
|
+
// Ensure translator is available in local package, or fallback to built in compiler.
|
|
33
|
+
let translator = []
|
|
34
|
+
.concat(Object.keys(pkg.dependencies), Object.keys(pkg.peerDependencies), Object.keys(pkg.devDependencies))
|
|
35
|
+
.find((name) => /^marko$|^(@\/marko\/|marko-)translator-/.test(name));
|
|
36
|
+
if (translator === "marko" || !translator) {
|
|
37
|
+
// Fallback to compiler default translator
|
|
38
|
+
translator = require((0, resolve_from_1.default)(dir, "@marko/compiler/config"))
|
|
39
|
+
.translator;
|
|
40
|
+
}
|
|
41
|
+
require((0, resolve_from_1.default)(dir, translator));
|
|
42
|
+
return {
|
|
43
|
+
compiler: require((0, resolve_from_1.default)(dir, "@marko/compiler")),
|
|
44
|
+
translator,
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
catch (_a) { }
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
compiler: require("@marko/compiler"),
|
|
51
|
+
translator: "@marko/translator-default",
|
|
52
|
+
};
|
|
31
53
|
}
|
|
32
54
|
//# sourceMappingURL=compiler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/utils/compiler.ts"],"names":[],"mappings":";;;;AAAA,6DAAwB;AACxB,2CAAiC;AACjC,6EAAuC;AACvC,yFAAkD;
|
|
1
|
+
{"version":3,"file":"compiler.js","sourceRoot":"","sources":["../../src/utils/compiler.ts"],"names":[],"mappings":";;;;AAAA,6DAAwB;AACxB,2CAAiC;AACjC,6EAAuC;AACvC,yFAAkD;AAmElD,MAAM,2BAA2B,GAAG,IAAI,OAAO,EAG5C,CAAC;AAEJ,SAAgB,8BAA8B,CAC5C,GAAiB;IAEjB,IAAI,qBAAqB,GAAG,2BAA2B,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACjE,IAAI,CAAC,qBAAqB,EAAE;QAC1B,2BAA2B,CAAC,GAAG,CAC7B,GAAG,EACH,CAAC,qBAAqB,GAAG,YAAY,CACnC,cAAI,CAAC,OAAO,CAAC,gBAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CACxC,CAAC,CACH,CAAC;KACH;IAED,OAAO,qBAAqB,CAAC;AAC/B,CAAC;AAdD,wEAcC;AAED,SAAgB,eAAe,CAC7B,QAAsB;IAEtB,IAAI;QACF,MAAM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AA,sBAAW,EAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;gBACtD,UAAU;aACX,CAAC;SACH;QAAC,WAAM,GAAE;KACX;IAED,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,iBAAiB,CAAC;QACpC,UAAU,EAAE,2BAA2B;KACxC,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/language-server",
|
|
3
3
|
"description": "Marko Language Server",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"author": "Diego Berrocal",
|
|
6
6
|
"bugs": "https://github.com/marko-js/language-server/issues/new?template=Bug_report.md",
|
|
7
7
|
"bin": {
|
|
8
8
|
"marko-language-server": "./dist/bin.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@marko/compiler": "^5.16.
|
|
12
|
-
"@marko/translator-default": "^5.16.
|
|
11
|
+
"@marko/compiler": "^5.16.1",
|
|
12
|
+
"@marko/translator-default": "^5.16.1",
|
|
13
13
|
"lasso-package-root": "^1.0.1",
|
|
14
|
-
"marko": "^5.16.
|
|
14
|
+
"marko": "^5.16.1",
|
|
15
15
|
"prettier": "^2.4.1",
|
|
16
16
|
"prettier-plugin-marko": "^1.1.2",
|
|
17
17
|
"resolve-from": "^5.0.0",
|
|
18
18
|
"tslib": "^2.2.0",
|
|
19
|
-
"vscode-css-languageservice": "^5.1.
|
|
19
|
+
"vscode-css-languageservice": "^5.1.7",
|
|
20
20
|
"vscode-languageserver": "^7.0.0",
|
|
21
|
-
"vscode-languageserver-textdocument": "^1.0.
|
|
21
|
+
"vscode-languageserver-textdocument": "^1.0.2",
|
|
22
22
|
"vscode-uri": "^3.0.2"
|
|
23
23
|
},
|
|
24
24
|
"files": [
|
|
@@ -38,5 +38,5 @@
|
|
|
38
38
|
"type": "git",
|
|
39
39
|
"url": "https://github.com/marko-js/language-server/tree/master/server"
|
|
40
40
|
},
|
|
41
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "05b82b9c449a13862267dba8988331d917f8a314"
|
|
42
42
|
}
|