@player-tools/json-language-server 0.4.2-next.1 → 0.5.0-next.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/cjs/index.cjs +244 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/index.legacy-esm.js +215 -0
- package/dist/index.mjs +215 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +19 -25
- package/src/index.ts +24 -24
- package/src/utils.ts +3 -3
- package/types/index.d.ts +2 -0
- package/types/utils.d.ts +5 -0
- package/README.md +0 -3
- package/dist/index.cjs.js +0 -207
- package/dist/index.d.ts +0 -6
- package/dist/index.esm.js +0 -199
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
|
|
30
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
31
|
+
var src_exports = {};
|
|
32
|
+
__export(src_exports, {
|
|
33
|
+
runAndCatch: () => runAndCatch
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(src_exports);
|
|
36
|
+
var import_vscode_languageserver2 = require("vscode-languageserver");
|
|
37
|
+
var import_vscode_languageserver_textdocument = require("vscode-languageserver-textdocument");
|
|
38
|
+
var import_json_language_service = require("@player-tools/json-language-service");
|
|
39
|
+
var import_fs = __toESM(require("fs"));
|
|
40
|
+
|
|
41
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/utils.ts
|
|
42
|
+
var import_vscode_languageserver = require("vscode-languageserver");
|
|
43
|
+
function cancel() {
|
|
44
|
+
return new import_vscode_languageserver.ResponseError(
|
|
45
|
+
-32800,
|
|
46
|
+
"Request cancelled"
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
async function runAndCatch(func, token, errorVal) {
|
|
50
|
+
if (token.isCancellationRequested) {
|
|
51
|
+
return cancel();
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const result = await func();
|
|
55
|
+
if (token.isCancellationRequested) {
|
|
56
|
+
return cancel();
|
|
57
|
+
}
|
|
58
|
+
return result;
|
|
59
|
+
} catch (e) {
|
|
60
|
+
return errorVal;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
65
|
+
var dateFormat = new Intl.DateTimeFormat("en", {
|
|
66
|
+
year: "numeric",
|
|
67
|
+
month: "2-digit",
|
|
68
|
+
day: "2-digit",
|
|
69
|
+
hour12: false,
|
|
70
|
+
hour: "2-digit",
|
|
71
|
+
minute: "2-digit",
|
|
72
|
+
second: "2-digit"
|
|
73
|
+
});
|
|
74
|
+
var logFilePath = process.argv.length === 4 && import_fs.default.existsSync(process.argv[3]) && process.argv[3];
|
|
75
|
+
var formatLog = (a) => {
|
|
76
|
+
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
77
|
+
const date = /* @__PURE__ */ new Date();
|
|
78
|
+
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg}
|
|
79
|
+
`;
|
|
80
|
+
};
|
|
81
|
+
var fileLog = logFilePath ? (a) => import_fs.default.appendFile(logFilePath, formatLog(a), () => {
|
|
82
|
+
}) : () => {
|
|
83
|
+
};
|
|
84
|
+
var service = new import_json_language_service.PlayerLanguageService();
|
|
85
|
+
var connection = (0, import_vscode_languageserver2.createConnection)(import_vscode_languageserver2.ProposedFeatures.all);
|
|
86
|
+
var documents = new import_vscode_languageserver2.TextDocuments(import_vscode_languageserver_textdocument.TextDocument);
|
|
87
|
+
var hasConfigurationCapability = false;
|
|
88
|
+
process.on("unhandledRejection", (e) => {
|
|
89
|
+
console.error(e.message);
|
|
90
|
+
});
|
|
91
|
+
process.on("uncaughtException", (e) => {
|
|
92
|
+
console.error(e.message);
|
|
93
|
+
});
|
|
94
|
+
console.log = (a) => {
|
|
95
|
+
fileLog(a);
|
|
96
|
+
connection.console.log(JSON.stringify(a, null, 2));
|
|
97
|
+
};
|
|
98
|
+
console.error = (a) => {
|
|
99
|
+
fileLog(a);
|
|
100
|
+
connection.console.error(JSON.stringify(a, null, 2));
|
|
101
|
+
};
|
|
102
|
+
async function validate(textDocument) {
|
|
103
|
+
const diagnostics = await service.validateTextDocument(textDocument);
|
|
104
|
+
if (diagnostics) {
|
|
105
|
+
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
connection.onInitialize((params) => {
|
|
109
|
+
const { capabilities } = params;
|
|
110
|
+
hasConfigurationCapability = Boolean(
|
|
111
|
+
capabilities.workspace && Boolean(capabilities.workspace.configuration)
|
|
112
|
+
);
|
|
113
|
+
fileLog("Initialized Player LSP Server");
|
|
114
|
+
return {
|
|
115
|
+
capabilities: {
|
|
116
|
+
textDocumentSync: import_vscode_languageserver2.TextDocumentSyncKind.Full,
|
|
117
|
+
codeActionProvider: true,
|
|
118
|
+
definitionProvider: true,
|
|
119
|
+
completionProvider: {
|
|
120
|
+
resolveProvider: false,
|
|
121
|
+
triggerCharacters: ['"', ":"]
|
|
122
|
+
},
|
|
123
|
+
documentFormattingProvider: true,
|
|
124
|
+
documentRangeFormattingProvider: true,
|
|
125
|
+
hoverProvider: true
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
});
|
|
129
|
+
connection.onCompletion(async (textDocumentPosition, token) => {
|
|
130
|
+
return runAndCatch(
|
|
131
|
+
() => {
|
|
132
|
+
const document = documents.get(textDocumentPosition.textDocument.uri);
|
|
133
|
+
if (document !== void 0) {
|
|
134
|
+
return service.getCompletionsAtPosition(
|
|
135
|
+
document,
|
|
136
|
+
textDocumentPosition.position
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
return null;
|
|
140
|
+
},
|
|
141
|
+
token,
|
|
142
|
+
null
|
|
143
|
+
);
|
|
144
|
+
});
|
|
145
|
+
connection.onHover(async (hoverParams, token) => {
|
|
146
|
+
return runAndCatch(
|
|
147
|
+
() => {
|
|
148
|
+
const document = documents.get(hoverParams.textDocument.uri);
|
|
149
|
+
if (document !== void 0) {
|
|
150
|
+
return service.getHoverInfoAtPosition(document, hoverParams.position);
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
},
|
|
154
|
+
token,
|
|
155
|
+
null
|
|
156
|
+
);
|
|
157
|
+
});
|
|
158
|
+
connection.onCompletionResolve(
|
|
159
|
+
(item, token) => runAndCatch(() => service.resolveCompletionItem(item), token, item)
|
|
160
|
+
);
|
|
161
|
+
connection.onDocumentFormatting(
|
|
162
|
+
(formattingParams, token) => runAndCatch(
|
|
163
|
+
() => {
|
|
164
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
165
|
+
if (document !== void 0) {
|
|
166
|
+
return service.formatTextDocument(document, formattingParams.options);
|
|
167
|
+
}
|
|
168
|
+
return void 0;
|
|
169
|
+
},
|
|
170
|
+
token,
|
|
171
|
+
null
|
|
172
|
+
)
|
|
173
|
+
);
|
|
174
|
+
connection.onDocumentRangeFormatting(
|
|
175
|
+
(formattingParams, token) => runAndCatch(
|
|
176
|
+
() => {
|
|
177
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
178
|
+
if (document !== void 0) {
|
|
179
|
+
return service.formatTextDocument(
|
|
180
|
+
document,
|
|
181
|
+
formattingParams.options,
|
|
182
|
+
formattingParams.range
|
|
183
|
+
);
|
|
184
|
+
}
|
|
185
|
+
return void 0;
|
|
186
|
+
},
|
|
187
|
+
token,
|
|
188
|
+
null
|
|
189
|
+
)
|
|
190
|
+
);
|
|
191
|
+
connection.onDefinition(
|
|
192
|
+
(definitionParams, token) => runAndCatch(
|
|
193
|
+
() => {
|
|
194
|
+
const document = documents.get(definitionParams.textDocument.uri);
|
|
195
|
+
if (document !== void 0) {
|
|
196
|
+
return service.getDefinitionAtPosition(
|
|
197
|
+
document,
|
|
198
|
+
definitionParams.position
|
|
199
|
+
);
|
|
200
|
+
}
|
|
201
|
+
return void 0;
|
|
202
|
+
},
|
|
203
|
+
token,
|
|
204
|
+
null
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
connection.onInitialized(() => {
|
|
208
|
+
if (hasConfigurationCapability) {
|
|
209
|
+
connection.client.register(
|
|
210
|
+
import_vscode_languageserver2.DidChangeConfigurationNotification.type,
|
|
211
|
+
void 0
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
connection.onCodeAction((codeAction) => {
|
|
216
|
+
const document = documents.get(codeAction.textDocument.uri);
|
|
217
|
+
if (!document) {
|
|
218
|
+
return [];
|
|
219
|
+
}
|
|
220
|
+
return service.getCodeActionsInRange(document, codeAction.context);
|
|
221
|
+
});
|
|
222
|
+
documents.onDidClose((change) => {
|
|
223
|
+
service.onClose(change.document);
|
|
224
|
+
});
|
|
225
|
+
documents.onDidChangeContent((change) => {
|
|
226
|
+
validate(change.document);
|
|
227
|
+
});
|
|
228
|
+
connection.onNotification(
|
|
229
|
+
"player/setAssetBundles",
|
|
230
|
+
(assetBundles) => {
|
|
231
|
+
if (Array.isArray(assetBundles)) {
|
|
232
|
+
console.log("Updating asset type bundles");
|
|
233
|
+
service.setAssetTypes(assetBundles);
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
);
|
|
237
|
+
fileLog("Starting Player LSP Server");
|
|
238
|
+
documents.listen(connection);
|
|
239
|
+
connection.listen();
|
|
240
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
241
|
+
0 && (module.exports = {
|
|
242
|
+
runAndCatch
|
|
243
|
+
});
|
|
244
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts","../../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/utils.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { InitializeParams } from \"vscode-languageserver\";\nimport {\n createConnection,\n ProposedFeatures,\n TextDocuments,\n DidChangeConfigurationNotification,\n TextDocumentSyncKind,\n} from \"vscode-languageserver\";\nimport { TextDocument } from \"vscode-languageserver-textdocument\";\nimport { PlayerLanguageService } from \"@player-tools/json-language-service\";\nimport fs from \"fs\";\nimport { runAndCatch } from \"./utils\";\n\nexport * from \"./utils\";\n\nconst dateFormat = new Intl.DateTimeFormat(\"en\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour12: false,\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n});\n\nconst logFilePath =\n process.argv.length === 4 &&\n fs.existsSync(process.argv[3]) &&\n process.argv[3];\n\n/** Format a log message to work in the console */\nconst formatLog = (a: unknown): string => {\n const msg = typeof a === \"string\" ? a : JSON.stringify(a);\n const date = new Date();\n return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg} \\n`;\n};\n\nconst fileLog = logFilePath\n ? (a: unknown) =>\n fs.appendFile(logFilePath, formatLog(a), () => {\n /* do nothing */\n })\n : () => {\n /* do nothing */\n };\n\nconst service = new PlayerLanguageService();\n\nconst connection = createConnection(ProposedFeatures.all);\nconst documents = new TextDocuments(TextDocument);\n\nlet hasConfigurationCapability = false;\n\nprocess.on(\"unhandledRejection\", (e: Error) => {\n console.error(e.message);\n});\nprocess.on(\"uncaughtException\", (e: Error) => {\n console.error(e.message);\n});\n\nconsole.log = (a: Error) => {\n fileLog(a);\n connection.console.log(JSON.stringify(a, null, 2));\n};\n\nconsole.error = (a: Error) => {\n fileLog(a);\n connection.console.error(JSON.stringify(a, null, 2));\n};\n\n/** Handle validating a text-document and returning the response back to the extension */\nasync function validate(textDocument: TextDocument): Promise<void> {\n const diagnostics = await service.validateTextDocument(textDocument);\n\n if (diagnostics) {\n connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });\n }\n}\n\nconnection.onInitialize((params: InitializeParams) => {\n const { capabilities } = params;\n\n // Does the client support the `workspace/configuration` request?\n // If not, we will fall back using global settings\n hasConfigurationCapability = Boolean(\n capabilities.workspace && Boolean(capabilities.workspace.configuration)\n );\n\n fileLog(\"Initialized Player LSP Server\");\n return {\n capabilities: {\n textDocumentSync: TextDocumentSyncKind.Full,\n codeActionProvider: true,\n definitionProvider: true,\n completionProvider: {\n resolveProvider: false,\n triggerCharacters: ['\"', \":\"],\n },\n documentFormattingProvider: true,\n documentRangeFormattingProvider: true,\n hoverProvider: true,\n },\n };\n});\n\nconnection.onCompletion(async (textDocumentPosition, token) => {\n return runAndCatch(\n () => {\n const document = documents.get(textDocumentPosition.textDocument.uri);\n if (document !== undefined) {\n return service.getCompletionsAtPosition(\n document,\n textDocumentPosition.position\n );\n }\n\n return null;\n },\n token,\n null\n );\n});\n\nconnection.onHover(async (hoverParams, token) => {\n return runAndCatch(\n () => {\n const document = documents.get(hoverParams.textDocument.uri);\n if (document !== undefined) {\n return service.getHoverInfoAtPosition(document, hoverParams.position);\n }\n\n return null;\n },\n token,\n null\n );\n});\n\nconnection.onCompletionResolve((item, token) =>\n runAndCatch(() => service.resolveCompletionItem(item), token, item)\n);\n\nconnection.onDocumentFormatting((formattingParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(formattingParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.formatTextDocument(document, formattingParams.options);\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onDocumentRangeFormatting((formattingParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(formattingParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.formatTextDocument(\n document,\n formattingParams.options,\n formattingParams.range\n );\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onDefinition((definitionParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(definitionParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.getDefinitionAtPosition(\n document,\n definitionParams.position\n );\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onInitialized(() => {\n if (hasConfigurationCapability) {\n // Register for all configuration changes.\n connection.client.register(\n DidChangeConfigurationNotification.type,\n undefined\n );\n }\n});\n\nconnection.onCodeAction((codeAction) => {\n const document = documents.get(codeAction.textDocument.uri);\n if (!document) {\n return [];\n }\n\n return service.getCodeActionsInRange(document, codeAction.context);\n});\n\ndocuments.onDidClose((change) => {\n service.onClose(change.document);\n});\n\ndocuments.onDidChangeContent((change) => {\n validate(change.document);\n});\n\nconnection.onNotification(\n \"player/setAssetBundles\",\n (assetBundles: Array<string>) => {\n // Don't trust data over the wire\n if (Array.isArray(assetBundles)) {\n console.log(\"Updating asset type bundles\");\n service.setAssetTypes(assetBundles);\n }\n }\n);\n\nfileLog(\"Starting Player LSP Server\");\n\ndocuments.listen(connection);\nconnection.listen();\n","import type { CancellationToken } from \"vscode-languageserver\";\nimport { ResponseError } from \"vscode-languageserver\";\n\n/** Get a cancellation error */\nfunction cancel() {\n return new ResponseError(\n -32800 /* ErrorCodes.RequestCancelled */,\n \"Request cancelled\"\n );\n}\n\n/** Run the given function and handle being cancelled */\nexport async function runAndCatch<T>(\n func: () => Promise<T> | T,\n token: CancellationToken,\n errorVal: T\n): Promise<T | ResponseError<any>> {\n if (token.isCancellationRequested) {\n return cancel();\n }\n\n try {\n const result = await func();\n if (token.isCancellationRequested) {\n return cancel();\n }\n\n return result;\n } catch (e) {\n return errorVal;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,IAAAA,gCAMO;AACP,gDAA6B;AAC7B,mCAAsC;AACtC,gBAAe;;;ACVf,mCAA8B;AAG9B,SAAS,SAAS;AAChB,SAAO,IAAI;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;AAGA,eAAsB,YACpB,MACA,OACA,UACiC;AACjC,MAAI,MAAM,yBAAyB;AACjC,WAAO,OAAO;AAAA,EAChB;AAEA,MAAI;AACF,UAAM,SAAS,MAAM,KAAK;AAC1B,QAAI,MAAM,yBAAyB;AACjC,aAAO,OAAO;AAAA,IAChB;AAEA,WAAO;AAAA,EACT,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;;;ADfA,IAAM,aAAa,IAAI,KAAK,eAAe,MAAM;AAAA,EAC/C,MAAM;AAAA,EACN,OAAO;AAAA,EACP,KAAK;AAAA,EACL,QAAQ;AAAA,E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;AACzC,cAAQ,cAAc,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAEA,QAAQ,4BAA4B;AAEpC,UAAU,OAAO,UAAU;AAC3B,WAAW,OAAO;","names":["import_vscode_languageserver","fs"]}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
createConnection,
|
|
4
|
+
ProposedFeatures,
|
|
5
|
+
TextDocuments,
|
|
6
|
+
DidChangeConfigurationNotification,
|
|
7
|
+
TextDocumentSyncKind
|
|
8
|
+
} from "vscode-languageserver";
|
|
9
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
10
|
+
import { PlayerLanguageService } from "@player-tools/json-language-service";
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
|
|
13
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/utils.ts
|
|
14
|
+
import { ResponseError } from "vscode-languageserver";
|
|
15
|
+
function cancel() {
|
|
16
|
+
return new ResponseError(
|
|
17
|
+
-32800,
|
|
18
|
+
"Request cancelled"
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
async function runAndCatch(func, token, errorVal) {
|
|
22
|
+
if (token.isCancellationRequested) {
|
|
23
|
+
return cancel();
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const result = await func();
|
|
27
|
+
if (token.isCancellationRequested) {
|
|
28
|
+
return cancel();
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return errorVal;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
37
|
+
var dateFormat = new Intl.DateTimeFormat("en", {
|
|
38
|
+
year: "numeric",
|
|
39
|
+
month: "2-digit",
|
|
40
|
+
day: "2-digit",
|
|
41
|
+
hour12: false,
|
|
42
|
+
hour: "2-digit",
|
|
43
|
+
minute: "2-digit",
|
|
44
|
+
second: "2-digit"
|
|
45
|
+
});
|
|
46
|
+
var logFilePath = process.argv.length === 4 && fs.existsSync(process.argv[3]) && process.argv[3];
|
|
47
|
+
var formatLog = (a) => {
|
|
48
|
+
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
49
|
+
const date = /* @__PURE__ */ new Date();
|
|
50
|
+
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg}
|
|
51
|
+
`;
|
|
52
|
+
};
|
|
53
|
+
var fileLog = logFilePath ? (a) => fs.appendFile(logFilePath, formatLog(a), () => {
|
|
54
|
+
}) : () => {
|
|
55
|
+
};
|
|
56
|
+
var service = new PlayerLanguageService();
|
|
57
|
+
var connection = createConnection(ProposedFeatures.all);
|
|
58
|
+
var documents = new TextDocuments(TextDocument);
|
|
59
|
+
var hasConfigurationCapability = false;
|
|
60
|
+
process.on("unhandledRejection", (e) => {
|
|
61
|
+
console.error(e.message);
|
|
62
|
+
});
|
|
63
|
+
process.on("uncaughtException", (e) => {
|
|
64
|
+
console.error(e.message);
|
|
65
|
+
});
|
|
66
|
+
console.log = (a) => {
|
|
67
|
+
fileLog(a);
|
|
68
|
+
connection.console.log(JSON.stringify(a, null, 2));
|
|
69
|
+
};
|
|
70
|
+
console.error = (a) => {
|
|
71
|
+
fileLog(a);
|
|
72
|
+
connection.console.error(JSON.stringify(a, null, 2));
|
|
73
|
+
};
|
|
74
|
+
async function validate(textDocument) {
|
|
75
|
+
const diagnostics = await service.validateTextDocument(textDocument);
|
|
76
|
+
if (diagnostics) {
|
|
77
|
+
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
connection.onInitialize((params) => {
|
|
81
|
+
const { capabilities } = params;
|
|
82
|
+
hasConfigurationCapability = Boolean(
|
|
83
|
+
capabilities.workspace && Boolean(capabilities.workspace.configuration)
|
|
84
|
+
);
|
|
85
|
+
fileLog("Initialized Player LSP Server");
|
|
86
|
+
return {
|
|
87
|
+
capabilities: {
|
|
88
|
+
textDocumentSync: TextDocumentSyncKind.Full,
|
|
89
|
+
codeActionProvider: true,
|
|
90
|
+
definitionProvider: true,
|
|
91
|
+
completionProvider: {
|
|
92
|
+
resolveProvider: false,
|
|
93
|
+
triggerCharacters: ['"', ":"]
|
|
94
|
+
},
|
|
95
|
+
documentFormattingProvider: true,
|
|
96
|
+
documentRangeFormattingProvider: true,
|
|
97
|
+
hoverProvider: true
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
connection.onCompletion(async (textDocumentPosition, token) => {
|
|
102
|
+
return runAndCatch(
|
|
103
|
+
() => {
|
|
104
|
+
const document = documents.get(textDocumentPosition.textDocument.uri);
|
|
105
|
+
if (document !== void 0) {
|
|
106
|
+
return service.getCompletionsAtPosition(
|
|
107
|
+
document,
|
|
108
|
+
textDocumentPosition.position
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
token,
|
|
114
|
+
null
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
connection.onHover(async (hoverParams, token) => {
|
|
118
|
+
return runAndCatch(
|
|
119
|
+
() => {
|
|
120
|
+
const document = documents.get(hoverParams.textDocument.uri);
|
|
121
|
+
if (document !== void 0) {
|
|
122
|
+
return service.getHoverInfoAtPosition(document, hoverParams.position);
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
},
|
|
126
|
+
token,
|
|
127
|
+
null
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
connection.onCompletionResolve(
|
|
131
|
+
(item, token) => runAndCatch(() => service.resolveCompletionItem(item), token, item)
|
|
132
|
+
);
|
|
133
|
+
connection.onDocumentFormatting(
|
|
134
|
+
(formattingParams, token) => runAndCatch(
|
|
135
|
+
() => {
|
|
136
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
137
|
+
if (document !== void 0) {
|
|
138
|
+
return service.formatTextDocument(document, formattingParams.options);
|
|
139
|
+
}
|
|
140
|
+
return void 0;
|
|
141
|
+
},
|
|
142
|
+
token,
|
|
143
|
+
null
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
connection.onDocumentRangeFormatting(
|
|
147
|
+
(formattingParams, token) => runAndCatch(
|
|
148
|
+
() => {
|
|
149
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
150
|
+
if (document !== void 0) {
|
|
151
|
+
return service.formatTextDocument(
|
|
152
|
+
document,
|
|
153
|
+
formattingParams.options,
|
|
154
|
+
formattingParams.range
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return void 0;
|
|
158
|
+
},
|
|
159
|
+
token,
|
|
160
|
+
null
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
connection.onDefinition(
|
|
164
|
+
(definitionParams, token) => runAndCatch(
|
|
165
|
+
() => {
|
|
166
|
+
const document = documents.get(definitionParams.textDocument.uri);
|
|
167
|
+
if (document !== void 0) {
|
|
168
|
+
return service.getDefinitionAtPosition(
|
|
169
|
+
document,
|
|
170
|
+
definitionParams.position
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return void 0;
|
|
174
|
+
},
|
|
175
|
+
token,
|
|
176
|
+
null
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
connection.onInitialized(() => {
|
|
180
|
+
if (hasConfigurationCapability) {
|
|
181
|
+
connection.client.register(
|
|
182
|
+
DidChangeConfigurationNotification.type,
|
|
183
|
+
void 0
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
connection.onCodeAction((codeAction) => {
|
|
188
|
+
const document = documents.get(codeAction.textDocument.uri);
|
|
189
|
+
if (!document) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
return service.getCodeActionsInRange(document, codeAction.context);
|
|
193
|
+
});
|
|
194
|
+
documents.onDidClose((change) => {
|
|
195
|
+
service.onClose(change.document);
|
|
196
|
+
});
|
|
197
|
+
documents.onDidChangeContent((change) => {
|
|
198
|
+
validate(change.document);
|
|
199
|
+
});
|
|
200
|
+
connection.onNotification(
|
|
201
|
+
"player/setAssetBundles",
|
|
202
|
+
(assetBundles) => {
|
|
203
|
+
if (Array.isArray(assetBundles)) {
|
|
204
|
+
console.log("Updating asset type bundles");
|
|
205
|
+
service.setAssetTypes(assetBundles);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
fileLog("Starting Player LSP Server");
|
|
210
|
+
documents.listen(connection);
|
|
211
|
+
connection.listen();
|
|
212
|
+
export {
|
|
213
|
+
runAndCatch
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
2
|
+
import {
|
|
3
|
+
createConnection,
|
|
4
|
+
ProposedFeatures,
|
|
5
|
+
TextDocuments,
|
|
6
|
+
DidChangeConfigurationNotification,
|
|
7
|
+
TextDocumentSyncKind
|
|
8
|
+
} from "vscode-languageserver";
|
|
9
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
10
|
+
import { PlayerLanguageService } from "@player-tools/json-language-service";
|
|
11
|
+
import fs from "fs";
|
|
12
|
+
|
|
13
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/utils.ts
|
|
14
|
+
import { ResponseError } from "vscode-languageserver";
|
|
15
|
+
function cancel() {
|
|
16
|
+
return new ResponseError(
|
|
17
|
+
-32800,
|
|
18
|
+
"Request cancelled"
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
async function runAndCatch(func, token, errorVal) {
|
|
22
|
+
if (token.isCancellationRequested) {
|
|
23
|
+
return cancel();
|
|
24
|
+
}
|
|
25
|
+
try {
|
|
26
|
+
const result = await func();
|
|
27
|
+
if (token.isCancellationRequested) {
|
|
28
|
+
return cancel();
|
|
29
|
+
}
|
|
30
|
+
return result;
|
|
31
|
+
} catch (e) {
|
|
32
|
+
return errorVal;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// ../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts
|
|
37
|
+
var dateFormat = new Intl.DateTimeFormat("en", {
|
|
38
|
+
year: "numeric",
|
|
39
|
+
month: "2-digit",
|
|
40
|
+
day: "2-digit",
|
|
41
|
+
hour12: false,
|
|
42
|
+
hour: "2-digit",
|
|
43
|
+
minute: "2-digit",
|
|
44
|
+
second: "2-digit"
|
|
45
|
+
});
|
|
46
|
+
var logFilePath = process.argv.length === 4 && fs.existsSync(process.argv[3]) && process.argv[3];
|
|
47
|
+
var formatLog = (a) => {
|
|
48
|
+
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
49
|
+
const date = /* @__PURE__ */ new Date();
|
|
50
|
+
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg}
|
|
51
|
+
`;
|
|
52
|
+
};
|
|
53
|
+
var fileLog = logFilePath ? (a) => fs.appendFile(logFilePath, formatLog(a), () => {
|
|
54
|
+
}) : () => {
|
|
55
|
+
};
|
|
56
|
+
var service = new PlayerLanguageService();
|
|
57
|
+
var connection = createConnection(ProposedFeatures.all);
|
|
58
|
+
var documents = new TextDocuments(TextDocument);
|
|
59
|
+
var hasConfigurationCapability = false;
|
|
60
|
+
process.on("unhandledRejection", (e) => {
|
|
61
|
+
console.error(e.message);
|
|
62
|
+
});
|
|
63
|
+
process.on("uncaughtException", (e) => {
|
|
64
|
+
console.error(e.message);
|
|
65
|
+
});
|
|
66
|
+
console.log = (a) => {
|
|
67
|
+
fileLog(a);
|
|
68
|
+
connection.console.log(JSON.stringify(a, null, 2));
|
|
69
|
+
};
|
|
70
|
+
console.error = (a) => {
|
|
71
|
+
fileLog(a);
|
|
72
|
+
connection.console.error(JSON.stringify(a, null, 2));
|
|
73
|
+
};
|
|
74
|
+
async function validate(textDocument) {
|
|
75
|
+
const diagnostics = await service.validateTextDocument(textDocument);
|
|
76
|
+
if (diagnostics) {
|
|
77
|
+
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
connection.onInitialize((params) => {
|
|
81
|
+
const { capabilities } = params;
|
|
82
|
+
hasConfigurationCapability = Boolean(
|
|
83
|
+
capabilities.workspace && Boolean(capabilities.workspace.configuration)
|
|
84
|
+
);
|
|
85
|
+
fileLog("Initialized Player LSP Server");
|
|
86
|
+
return {
|
|
87
|
+
capabilities: {
|
|
88
|
+
textDocumentSync: TextDocumentSyncKind.Full,
|
|
89
|
+
codeActionProvider: true,
|
|
90
|
+
definitionProvider: true,
|
|
91
|
+
completionProvider: {
|
|
92
|
+
resolveProvider: false,
|
|
93
|
+
triggerCharacters: ['"', ":"]
|
|
94
|
+
},
|
|
95
|
+
documentFormattingProvider: true,
|
|
96
|
+
documentRangeFormattingProvider: true,
|
|
97
|
+
hoverProvider: true
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
});
|
|
101
|
+
connection.onCompletion(async (textDocumentPosition, token) => {
|
|
102
|
+
return runAndCatch(
|
|
103
|
+
() => {
|
|
104
|
+
const document = documents.get(textDocumentPosition.textDocument.uri);
|
|
105
|
+
if (document !== void 0) {
|
|
106
|
+
return service.getCompletionsAtPosition(
|
|
107
|
+
document,
|
|
108
|
+
textDocumentPosition.position
|
|
109
|
+
);
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
},
|
|
113
|
+
token,
|
|
114
|
+
null
|
|
115
|
+
);
|
|
116
|
+
});
|
|
117
|
+
connection.onHover(async (hoverParams, token) => {
|
|
118
|
+
return runAndCatch(
|
|
119
|
+
() => {
|
|
120
|
+
const document = documents.get(hoverParams.textDocument.uri);
|
|
121
|
+
if (document !== void 0) {
|
|
122
|
+
return service.getHoverInfoAtPosition(document, hoverParams.position);
|
|
123
|
+
}
|
|
124
|
+
return null;
|
|
125
|
+
},
|
|
126
|
+
token,
|
|
127
|
+
null
|
|
128
|
+
);
|
|
129
|
+
});
|
|
130
|
+
connection.onCompletionResolve(
|
|
131
|
+
(item, token) => runAndCatch(() => service.resolveCompletionItem(item), token, item)
|
|
132
|
+
);
|
|
133
|
+
connection.onDocumentFormatting(
|
|
134
|
+
(formattingParams, token) => runAndCatch(
|
|
135
|
+
() => {
|
|
136
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
137
|
+
if (document !== void 0) {
|
|
138
|
+
return service.formatTextDocument(document, formattingParams.options);
|
|
139
|
+
}
|
|
140
|
+
return void 0;
|
|
141
|
+
},
|
|
142
|
+
token,
|
|
143
|
+
null
|
|
144
|
+
)
|
|
145
|
+
);
|
|
146
|
+
connection.onDocumentRangeFormatting(
|
|
147
|
+
(formattingParams, token) => runAndCatch(
|
|
148
|
+
() => {
|
|
149
|
+
const document = documents.get(formattingParams.textDocument.uri);
|
|
150
|
+
if (document !== void 0) {
|
|
151
|
+
return service.formatTextDocument(
|
|
152
|
+
document,
|
|
153
|
+
formattingParams.options,
|
|
154
|
+
formattingParams.range
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
return void 0;
|
|
158
|
+
},
|
|
159
|
+
token,
|
|
160
|
+
null
|
|
161
|
+
)
|
|
162
|
+
);
|
|
163
|
+
connection.onDefinition(
|
|
164
|
+
(definitionParams, token) => runAndCatch(
|
|
165
|
+
() => {
|
|
166
|
+
const document = documents.get(definitionParams.textDocument.uri);
|
|
167
|
+
if (document !== void 0) {
|
|
168
|
+
return service.getDefinitionAtPosition(
|
|
169
|
+
document,
|
|
170
|
+
definitionParams.position
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return void 0;
|
|
174
|
+
},
|
|
175
|
+
token,
|
|
176
|
+
null
|
|
177
|
+
)
|
|
178
|
+
);
|
|
179
|
+
connection.onInitialized(() => {
|
|
180
|
+
if (hasConfigurationCapability) {
|
|
181
|
+
connection.client.register(
|
|
182
|
+
DidChangeConfigurationNotification.type,
|
|
183
|
+
void 0
|
|
184
|
+
);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
connection.onCodeAction((codeAction) => {
|
|
188
|
+
const document = documents.get(codeAction.textDocument.uri);
|
|
189
|
+
if (!document) {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
return service.getCodeActionsInRange(document, codeAction.context);
|
|
193
|
+
});
|
|
194
|
+
documents.onDidClose((change) => {
|
|
195
|
+
service.onClose(change.document);
|
|
196
|
+
});
|
|
197
|
+
documents.onDidChangeContent((change) => {
|
|
198
|
+
validate(change.document);
|
|
199
|
+
});
|
|
200
|
+
connection.onNotification(
|
|
201
|
+
"player/setAssetBundles",
|
|
202
|
+
(assetBundles) => {
|
|
203
|
+
if (Array.isArray(assetBundles)) {
|
|
204
|
+
console.log("Updating asset type bundles");
|
|
205
|
+
service.setAssetTypes(assetBundles);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
);
|
|
209
|
+
fileLog("Starting Player LSP Server");
|
|
210
|
+
documents.listen(connection);
|
|
211
|
+
connection.listen();
|
|
212
|
+
export {
|
|
213
|
+
runAndCatch
|
|
214
|
+
};
|
|
215
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/index.ts","../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/language/json-language-server/src/utils.ts"],"sourcesContent":["/* eslint-disable no-console */\nimport type { InitializeParams } from \"vscode-languageserver\";\nimport {\n createConnection,\n ProposedFeatures,\n TextDocuments,\n DidChangeConfigurationNotification,\n TextDocumentSyncKind,\n} from \"vscode-languageserver\";\nimport { TextDocument } from \"vscode-languageserver-textdocument\";\nimport { PlayerLanguageService } from \"@player-tools/json-language-service\";\nimport fs from \"fs\";\nimport { runAndCatch } from \"./utils\";\n\nexport * from \"./utils\";\n\nconst dateFormat = new Intl.DateTimeFormat(\"en\", {\n year: \"numeric\",\n month: \"2-digit\",\n day: \"2-digit\",\n hour12: false,\n hour: \"2-digit\",\n minute: \"2-digit\",\n second: \"2-digit\",\n});\n\nconst logFilePath =\n process.argv.length === 4 &&\n fs.existsSync(process.argv[3]) &&\n process.argv[3];\n\n/** Format a log message to work in the console */\nconst formatLog = (a: unknown): string => {\n const msg = typeof a === \"string\" ? a : JSON.stringify(a);\n const date = new Date();\n return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg} \\n`;\n};\n\nconst fileLog = logFilePath\n ? (a: unknown) =>\n fs.appendFile(logFilePath, formatLog(a), () => {\n /* do nothing */\n })\n : () => {\n /* do nothing */\n };\n\nconst service = new PlayerLanguageService();\n\nconst connection = createConnection(ProposedFeatures.all);\nconst documents = new TextDocuments(TextDocument);\n\nlet hasConfigurationCapability = false;\n\nprocess.on(\"unhandledRejection\", (e: Error) => {\n console.error(e.message);\n});\nprocess.on(\"uncaughtException\", (e: Error) => {\n console.error(e.message);\n});\n\nconsole.log = (a: Error) => {\n fileLog(a);\n connection.console.log(JSON.stringify(a, null, 2));\n};\n\nconsole.error = (a: Error) => {\n fileLog(a);\n connection.console.error(JSON.stringify(a, null, 2));\n};\n\n/** Handle validating a text-document and returning the response back to the extension */\nasync function validate(textDocument: TextDocument): Promise<void> {\n const diagnostics = await service.validateTextDocument(textDocument);\n\n if (diagnostics) {\n connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });\n }\n}\n\nconnection.onInitialize((params: InitializeParams) => {\n const { capabilities } = params;\n\n // Does the client support the `workspace/configuration` request?\n // If not, we will fall back using global settings\n hasConfigurationCapability = Boolean(\n capabilities.workspace && Boolean(capabilities.workspace.configuration)\n );\n\n fileLog(\"Initialized Player LSP Server\");\n return {\n capabilities: {\n textDocumentSync: TextDocumentSyncKind.Full,\n codeActionProvider: true,\n definitionProvider: true,\n completionProvider: {\n resolveProvider: false,\n triggerCharacters: ['\"', \":\"],\n },\n documentFormattingProvider: true,\n documentRangeFormattingProvider: true,\n hoverProvider: true,\n },\n };\n});\n\nconnection.onCompletion(async (textDocumentPosition, token) => {\n return runAndCatch(\n () => {\n const document = documents.get(textDocumentPosition.textDocument.uri);\n if (document !== undefined) {\n return service.getCompletionsAtPosition(\n document,\n textDocumentPosition.position\n );\n }\n\n return null;\n },\n token,\n null\n );\n});\n\nconnection.onHover(async (hoverParams, token) => {\n return runAndCatch(\n () => {\n const document = documents.get(hoverParams.textDocument.uri);\n if (document !== undefined) {\n return service.getHoverInfoAtPosition(document, hoverParams.position);\n }\n\n return null;\n },\n token,\n null\n );\n});\n\nconnection.onCompletionResolve((item, token) =>\n runAndCatch(() => service.resolveCompletionItem(item), token, item)\n);\n\nconnection.onDocumentFormatting((formattingParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(formattingParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.formatTextDocument(document, formattingParams.options);\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onDocumentRangeFormatting((formattingParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(formattingParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.formatTextDocument(\n document,\n formattingParams.options,\n formattingParams.range\n );\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onDefinition((definitionParams, token) =>\n runAndCatch(\n () => {\n const document = documents.get(definitionParams.textDocument.uri);\n\n if (document !== undefined) {\n return service.getDefinitionAtPosition(\n document,\n definitionParams.position\n );\n }\n\n return undefined;\n },\n token,\n null\n )\n);\n\nconnection.onInitialized(() => {\n if (hasConfigurationCapability) {\n // Register for all configuration changes.\n connection.client.register(\n DidChangeConfigurationNotification.type,\n undefined\n );\n }\n});\n\nconnection.onCodeAction((codeAction) => {\n const document = documents.get(codeAction.textDocument.uri);\n if (!document) {\n return [];\n }\n\n return service.getCodeActionsInRange(document, codeAction.context);\n});\n\ndocuments.onDidClose((change) => {\n service.onClose(change.document);\n});\n\ndocuments.onDidChangeContent((change) => {\n validate(change.document);\n});\n\nconnection.onNotification(\n \"player/setAssetBundles\",\n (assetBundles: Array<string>) => {\n // Don't trust data over the wire\n if (Array.isArray(assetBundles)) {\n console.log(\"Updating asset type bundles\");\n service.setAssetTypes(assetBundles);\n }\n }\n);\n\nfileLog(\"Starting Player LSP Server\");\n\ndocuments.listen(connection);\nconnection.listen();\n","import type { CancellationToken } from \"vscode-languageserver\";\nimport { ResponseError } from \"vscode-languageserver\";\n\n/** Get a cancellation error */\nfunction cancel() {\n return new ResponseError(\n -32800 /* ErrorCodes.RequestCancelled */,\n \"Request cancelled\"\n );\n}\n\n/** Run the given function and handle being cancelled */\nexport async function runAndCatch<T>(\n func: () => Promise<T> | T,\n token: CancellationToken,\n errorVal: T\n): Promise<T | ResponseError<any>> {\n if (token.isCancellationRequested) {\n return cancel();\n }\n\n try {\n const result = await func();\n if (token.isCancellationRequested) {\n return cancel();\n }\n\n return result;\n } catch (e) {\n return errorVal;\n }\n}\n"],"mappings":";AAEA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,oBAAoB;AAC7B,SAAS,6BAA6B;AACtC,OAAO,QAAQ;;;ACVf,SAAS,qBAAqB;AAG9B,SAAS,SAAS;AAChB,SAAO,IAAI;AAAA,IACT;AAAA,IACA;AAAA,EACF;AACF;AAGA,eAAsB,YACpB,MACA,OACA,UACiC;AACjC,MAAI,MAAM,yBAAyB;AACjC,WAAO,OAAO;AAAA,EAChB;AAEA,MAAI;AACF,UAAM,SAAS,MAAM,KAAK;AAC1B,QAAI,MAAM,yBAAyB;AACjC,aAAO,OAAO;AAAA,IAChB;AAEA,WAAO;AAAA,EACT,SAAS,GAAG;AACV,WAAO;AAAA,EACT;AACF;;;ADfA,IAAM,aAAa,IAAI,KAA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iBAAgC;AAE/B,QAAI,MAAM,QAAQ,YAAY,GAAG;AAC/B,cAAQ,IAAI,6BAA6B;AACzC,cAAQ,cAAc,YAAY;AAAA,IACpC;AAAA,EACF;AACF;AAEA,QAAQ,4BAA4B;AAEpC,UAAU,OAAO,UAAU;AAC3B,WAAW,OAAO;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,34 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@player-tools/json-language-server",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"publishConfig": {
|
|
6
|
-
"registry": "https://registry.npmjs.org"
|
|
7
|
-
},
|
|
8
|
-
"peerDependencies": {},
|
|
3
|
+
"version": "0.5.0-next.0",
|
|
4
|
+
"main": "dist/cjs/index.cjs",
|
|
9
5
|
"dependencies": {
|
|
10
|
-
"@player-tools/json-language-service": "0.
|
|
6
|
+
"@player-tools/json-language-service": "0.5.0-next.0",
|
|
11
7
|
"vscode-languageserver": "^6.1.1",
|
|
12
8
|
"vscode-languageserver-textdocument": "^1.0.1",
|
|
13
|
-
"
|
|
9
|
+
"tslib": "^2.6.2"
|
|
14
10
|
},
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"typings": "dist/index.d.ts",
|
|
11
|
+
"module": "dist/index.legacy-esm.js",
|
|
12
|
+
"types": "types/index.d.ts",
|
|
18
13
|
"sideEffects": false,
|
|
19
|
-
"
|
|
20
|
-
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"url": "https://github.com/player-ui/tools/issues"
|
|
26
|
-
},
|
|
27
|
-
"homepage": "https://player-ui.github.io",
|
|
28
|
-
"contributors": [
|
|
29
|
-
{
|
|
30
|
-
"name": "Ketan Reddy",
|
|
31
|
-
"url": "https://github.com/KetanReddy"
|
|
14
|
+
"exports": {
|
|
15
|
+
"./package.json": "./package.json",
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./types/index.d.ts",
|
|
18
|
+
"import": "./dist/index.mjs",
|
|
19
|
+
"default": "./dist/cjs/index.cjs"
|
|
32
20
|
}
|
|
33
|
-
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist",
|
|
24
|
+
"src",
|
|
25
|
+
"types"
|
|
26
|
+
],
|
|
27
|
+
"peerDependencies": {}
|
|
34
28
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
/* eslint-disable no-console */
|
|
2
|
-
import type { InitializeParams } from
|
|
2
|
+
import type { InitializeParams } from "vscode-languageserver";
|
|
3
3
|
import {
|
|
4
4
|
createConnection,
|
|
5
5
|
ProposedFeatures,
|
|
6
6
|
TextDocuments,
|
|
7
7
|
DidChangeConfigurationNotification,
|
|
8
8
|
TextDocumentSyncKind,
|
|
9
|
-
} from
|
|
10
|
-
import { TextDocument } from
|
|
11
|
-
import { PlayerLanguageService } from
|
|
12
|
-
import fs from
|
|
13
|
-
import { runAndCatch } from
|
|
14
|
-
|
|
15
|
-
export * from
|
|
16
|
-
|
|
17
|
-
const dateFormat = new Intl.DateTimeFormat(
|
|
18
|
-
year:
|
|
19
|
-
month:
|
|
20
|
-
day:
|
|
9
|
+
} from "vscode-languageserver";
|
|
10
|
+
import { TextDocument } from "vscode-languageserver-textdocument";
|
|
11
|
+
import { PlayerLanguageService } from "@player-tools/json-language-service";
|
|
12
|
+
import fs from "fs";
|
|
13
|
+
import { runAndCatch } from "./utils";
|
|
14
|
+
|
|
15
|
+
export * from "./utils";
|
|
16
|
+
|
|
17
|
+
const dateFormat = new Intl.DateTimeFormat("en", {
|
|
18
|
+
year: "numeric",
|
|
19
|
+
month: "2-digit",
|
|
20
|
+
day: "2-digit",
|
|
21
21
|
hour12: false,
|
|
22
|
-
hour:
|
|
23
|
-
minute:
|
|
24
|
-
second:
|
|
22
|
+
hour: "2-digit",
|
|
23
|
+
minute: "2-digit",
|
|
24
|
+
second: "2-digit",
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
const logFilePath =
|
|
@@ -31,7 +31,7 @@ const logFilePath =
|
|
|
31
31
|
|
|
32
32
|
/** Format a log message to work in the console */
|
|
33
33
|
const formatLog = (a: unknown): string => {
|
|
34
|
-
const msg = typeof a ===
|
|
34
|
+
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
35
35
|
const date = new Date();
|
|
36
36
|
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg} \n`;
|
|
37
37
|
};
|
|
@@ -52,10 +52,10 @@ const documents = new TextDocuments(TextDocument);
|
|
|
52
52
|
|
|
53
53
|
let hasConfigurationCapability = false;
|
|
54
54
|
|
|
55
|
-
process.on(
|
|
55
|
+
process.on("unhandledRejection", (e: Error) => {
|
|
56
56
|
console.error(e.message);
|
|
57
57
|
});
|
|
58
|
-
process.on(
|
|
58
|
+
process.on("uncaughtException", (e: Error) => {
|
|
59
59
|
console.error(e.message);
|
|
60
60
|
});
|
|
61
61
|
|
|
@@ -87,7 +87,7 @@ connection.onInitialize((params: InitializeParams) => {
|
|
|
87
87
|
capabilities.workspace && Boolean(capabilities.workspace.configuration)
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
fileLog(
|
|
90
|
+
fileLog("Initialized Player LSP Server");
|
|
91
91
|
return {
|
|
92
92
|
capabilities: {
|
|
93
93
|
textDocumentSync: TextDocumentSyncKind.Full,
|
|
@@ -95,7 +95,7 @@ connection.onInitialize((params: InitializeParams) => {
|
|
|
95
95
|
definitionProvider: true,
|
|
96
96
|
completionProvider: {
|
|
97
97
|
resolveProvider: false,
|
|
98
|
-
triggerCharacters: ['"',
|
|
98
|
+
triggerCharacters: ['"', ":"],
|
|
99
99
|
},
|
|
100
100
|
documentFormattingProvider: true,
|
|
101
101
|
documentRangeFormattingProvider: true,
|
|
@@ -224,17 +224,17 @@ documents.onDidChangeContent((change) => {
|
|
|
224
224
|
});
|
|
225
225
|
|
|
226
226
|
connection.onNotification(
|
|
227
|
-
|
|
227
|
+
"player/setAssetBundles",
|
|
228
228
|
(assetBundles: Array<string>) => {
|
|
229
229
|
// Don't trust data over the wire
|
|
230
230
|
if (Array.isArray(assetBundles)) {
|
|
231
|
-
console.log(
|
|
231
|
+
console.log("Updating asset type bundles");
|
|
232
232
|
service.setAssetTypes(assetBundles);
|
|
233
233
|
}
|
|
234
234
|
}
|
|
235
235
|
);
|
|
236
236
|
|
|
237
|
-
fileLog(
|
|
237
|
+
fileLog("Starting Player LSP Server");
|
|
238
238
|
|
|
239
239
|
documents.listen(connection);
|
|
240
240
|
connection.listen();
|
package/src/utils.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { CancellationToken } from
|
|
2
|
-
import { ResponseError } from
|
|
1
|
+
import type { CancellationToken } from "vscode-languageserver";
|
|
2
|
+
import { ResponseError } from "vscode-languageserver";
|
|
3
3
|
|
|
4
4
|
/** Get a cancellation error */
|
|
5
5
|
function cancel() {
|
|
6
6
|
return new ResponseError(
|
|
7
7
|
-32800 /* ErrorCodes.RequestCancelled */,
|
|
8
|
-
|
|
8
|
+
"Request cancelled"
|
|
9
9
|
);
|
|
10
10
|
}
|
|
11
11
|
|
package/types/index.d.ts
ADDED
package/types/utils.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { CancellationToken } from "vscode-languageserver";
|
|
2
|
+
import { ResponseError } from "vscode-languageserver";
|
|
3
|
+
/** Run the given function and handle being cancelled */
|
|
4
|
+
export declare function runAndCatch<T>(func: () => Promise<T> | T, token: CancellationToken, errorVal: T): Promise<T | ResponseError<any>>;
|
|
5
|
+
//# sourceMappingURL=utils.d.ts.map
|
package/README.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
# @player-tools/json-language-server
|
|
2
|
-
|
|
3
|
-
This package starts a node JSON-RPC server which maps LSP requests to the [@player-language/service](https://github.intuit.com/player/language/tree/master/packages/service). This is typically started by an IDE and used in conjunction with a client to receive the language features.
|
package/dist/index.cjs.js
DELETED
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
var vscodeLanguageserver = require('vscode-languageserver');
|
|
6
|
-
var vscodeLanguageserverTextdocument = require('vscode-languageserver-textdocument');
|
|
7
|
-
var jsonLanguageService = require('@player-tools/json-language-service');
|
|
8
|
-
var fs = require('fs');
|
|
9
|
-
|
|
10
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
11
|
-
|
|
12
|
-
var fs__default = /*#__PURE__*/_interopDefaultLegacy(fs);
|
|
13
|
-
|
|
14
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
15
|
-
return new Promise((resolve, reject) => {
|
|
16
|
-
var fulfilled = (value) => {
|
|
17
|
-
try {
|
|
18
|
-
step(generator.next(value));
|
|
19
|
-
} catch (e) {
|
|
20
|
-
reject(e);
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
var rejected = (value) => {
|
|
24
|
-
try {
|
|
25
|
-
step(generator.throw(value));
|
|
26
|
-
} catch (e) {
|
|
27
|
-
reject(e);
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
31
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
function cancel() {
|
|
35
|
-
return new vscodeLanguageserver.ResponseError(-32800, "Request cancelled");
|
|
36
|
-
}
|
|
37
|
-
function runAndCatch(func, token, errorVal) {
|
|
38
|
-
return __async$1(this, null, function* () {
|
|
39
|
-
if (token.isCancellationRequested) {
|
|
40
|
-
return cancel();
|
|
41
|
-
}
|
|
42
|
-
try {
|
|
43
|
-
const result = yield func();
|
|
44
|
-
if (token.isCancellationRequested) {
|
|
45
|
-
return cancel();
|
|
46
|
-
}
|
|
47
|
-
return result;
|
|
48
|
-
} catch (e) {
|
|
49
|
-
return errorVal;
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
var __async = (__this, __arguments, generator) => {
|
|
55
|
-
return new Promise((resolve, reject) => {
|
|
56
|
-
var fulfilled = (value) => {
|
|
57
|
-
try {
|
|
58
|
-
step(generator.next(value));
|
|
59
|
-
} catch (e) {
|
|
60
|
-
reject(e);
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
var rejected = (value) => {
|
|
64
|
-
try {
|
|
65
|
-
step(generator.throw(value));
|
|
66
|
-
} catch (e) {
|
|
67
|
-
reject(e);
|
|
68
|
-
}
|
|
69
|
-
};
|
|
70
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
71
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
72
|
-
});
|
|
73
|
-
};
|
|
74
|
-
const dateFormat = new Intl.DateTimeFormat("en", {
|
|
75
|
-
year: "numeric",
|
|
76
|
-
month: "2-digit",
|
|
77
|
-
day: "2-digit",
|
|
78
|
-
hour12: false,
|
|
79
|
-
hour: "2-digit",
|
|
80
|
-
minute: "2-digit",
|
|
81
|
-
second: "2-digit"
|
|
82
|
-
});
|
|
83
|
-
const logFilePath = process.argv.length === 4 && fs__default["default"].existsSync(process.argv[3]) && process.argv[3];
|
|
84
|
-
const formatLog = (a) => {
|
|
85
|
-
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
86
|
-
const date = new Date();
|
|
87
|
-
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg}
|
|
88
|
-
`;
|
|
89
|
-
};
|
|
90
|
-
const fileLog = logFilePath ? (a) => fs__default["default"].appendFile(logFilePath, formatLog(a), () => {
|
|
91
|
-
}) : () => {
|
|
92
|
-
};
|
|
93
|
-
const service = new jsonLanguageService.PlayerLanguageService();
|
|
94
|
-
const connection = vscodeLanguageserver.createConnection(vscodeLanguageserver.ProposedFeatures.all);
|
|
95
|
-
const documents = new vscodeLanguageserver.TextDocuments(vscodeLanguageserverTextdocument.TextDocument);
|
|
96
|
-
let hasConfigurationCapability = false;
|
|
97
|
-
process.on("unhandledRejection", (e) => {
|
|
98
|
-
console.error(e.message);
|
|
99
|
-
});
|
|
100
|
-
process.on("uncaughtException", (e) => {
|
|
101
|
-
console.error(e.message);
|
|
102
|
-
});
|
|
103
|
-
console.log = (a) => {
|
|
104
|
-
fileLog(a);
|
|
105
|
-
connection.console.log(JSON.stringify(a, null, 2));
|
|
106
|
-
};
|
|
107
|
-
console.error = (a) => {
|
|
108
|
-
fileLog(a);
|
|
109
|
-
connection.console.error(JSON.stringify(a, null, 2));
|
|
110
|
-
};
|
|
111
|
-
function validate(textDocument) {
|
|
112
|
-
return __async(this, null, function* () {
|
|
113
|
-
const diagnostics = yield service.validateTextDocument(textDocument);
|
|
114
|
-
if (diagnostics) {
|
|
115
|
-
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
|
116
|
-
}
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
connection.onInitialize((params) => {
|
|
120
|
-
const { capabilities } = params;
|
|
121
|
-
hasConfigurationCapability = Boolean(capabilities.workspace && Boolean(capabilities.workspace.configuration));
|
|
122
|
-
fileLog("Initialized Player LSP Server");
|
|
123
|
-
return {
|
|
124
|
-
capabilities: {
|
|
125
|
-
textDocumentSync: vscodeLanguageserver.TextDocumentSyncKind.Full,
|
|
126
|
-
codeActionProvider: true,
|
|
127
|
-
definitionProvider: true,
|
|
128
|
-
completionProvider: {
|
|
129
|
-
resolveProvider: false,
|
|
130
|
-
triggerCharacters: ['"', ":"]
|
|
131
|
-
},
|
|
132
|
-
documentFormattingProvider: true,
|
|
133
|
-
documentRangeFormattingProvider: true,
|
|
134
|
-
hoverProvider: true
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
});
|
|
138
|
-
connection.onCompletion((textDocumentPosition, token) => __async(undefined, null, function* () {
|
|
139
|
-
return runAndCatch(() => {
|
|
140
|
-
const document = documents.get(textDocumentPosition.textDocument.uri);
|
|
141
|
-
if (document !== void 0) {
|
|
142
|
-
return service.getCompletionsAtPosition(document, textDocumentPosition.position);
|
|
143
|
-
}
|
|
144
|
-
return null;
|
|
145
|
-
}, token, null);
|
|
146
|
-
}));
|
|
147
|
-
connection.onHover((hoverParams, token) => __async(undefined, null, function* () {
|
|
148
|
-
return runAndCatch(() => {
|
|
149
|
-
const document = documents.get(hoverParams.textDocument.uri);
|
|
150
|
-
if (document !== void 0) {
|
|
151
|
-
return service.getHoverInfoAtPosition(document, hoverParams.position);
|
|
152
|
-
}
|
|
153
|
-
return null;
|
|
154
|
-
}, token, null);
|
|
155
|
-
}));
|
|
156
|
-
connection.onCompletionResolve((item, token) => runAndCatch(() => service.resolveCompletionItem(item), token, item));
|
|
157
|
-
connection.onDocumentFormatting((formattingParams, token) => runAndCatch(() => {
|
|
158
|
-
const document = documents.get(formattingParams.textDocument.uri);
|
|
159
|
-
if (document !== void 0) {
|
|
160
|
-
return service.formatTextDocument(document, formattingParams.options);
|
|
161
|
-
}
|
|
162
|
-
return void 0;
|
|
163
|
-
}, token, null));
|
|
164
|
-
connection.onDocumentRangeFormatting((formattingParams, token) => runAndCatch(() => {
|
|
165
|
-
const document = documents.get(formattingParams.textDocument.uri);
|
|
166
|
-
if (document !== void 0) {
|
|
167
|
-
return service.formatTextDocument(document, formattingParams.options, formattingParams.range);
|
|
168
|
-
}
|
|
169
|
-
return void 0;
|
|
170
|
-
}, token, null));
|
|
171
|
-
connection.onDefinition((definitionParams, token) => runAndCatch(() => {
|
|
172
|
-
const document = documents.get(definitionParams.textDocument.uri);
|
|
173
|
-
if (document !== void 0) {
|
|
174
|
-
return service.getDefinitionAtPosition(document, definitionParams.position);
|
|
175
|
-
}
|
|
176
|
-
return void 0;
|
|
177
|
-
}, token, null));
|
|
178
|
-
connection.onInitialized(() => {
|
|
179
|
-
if (hasConfigurationCapability) {
|
|
180
|
-
connection.client.register(vscodeLanguageserver.DidChangeConfigurationNotification.type, void 0);
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
connection.onCodeAction((codeAction) => {
|
|
184
|
-
const document = documents.get(codeAction.textDocument.uri);
|
|
185
|
-
if (!document) {
|
|
186
|
-
return [];
|
|
187
|
-
}
|
|
188
|
-
return service.getCodeActionsInRange(document, codeAction.context);
|
|
189
|
-
});
|
|
190
|
-
documents.onDidClose((change) => {
|
|
191
|
-
service.onClose(change.document);
|
|
192
|
-
});
|
|
193
|
-
documents.onDidChangeContent((change) => {
|
|
194
|
-
validate(change.document);
|
|
195
|
-
});
|
|
196
|
-
connection.onNotification("player/setAssetBundles", (assetBundles) => {
|
|
197
|
-
if (Array.isArray(assetBundles)) {
|
|
198
|
-
console.log("Updating asset type bundles");
|
|
199
|
-
service.setAssetTypes(assetBundles);
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
fileLog("Starting Player LSP Server");
|
|
203
|
-
documents.listen(connection);
|
|
204
|
-
connection.listen();
|
|
205
|
-
|
|
206
|
-
exports.runAndCatch = runAndCatch;
|
|
207
|
-
//# sourceMappingURL=index.cjs.js.map
|
package/dist/index.d.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { CancellationToken, ResponseError } from 'vscode-languageserver';
|
|
2
|
-
|
|
3
|
-
/** Run the given function and handle being cancelled */
|
|
4
|
-
declare function runAndCatch<T>(func: () => Promise<T> | T, token: CancellationToken, errorVal: T): Promise<T | ResponseError<any>>;
|
|
5
|
-
|
|
6
|
-
export { runAndCatch };
|
package/dist/index.esm.js
DELETED
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
import { ResponseError, createConnection, ProposedFeatures, TextDocuments, TextDocumentSyncKind, DidChangeConfigurationNotification } from 'vscode-languageserver';
|
|
2
|
-
import { TextDocument } from 'vscode-languageserver-textdocument';
|
|
3
|
-
import { PlayerLanguageService } from '@player-tools/json-language-service';
|
|
4
|
-
import fs from 'fs';
|
|
5
|
-
|
|
6
|
-
var __async$1 = (__this, __arguments, generator) => {
|
|
7
|
-
return new Promise((resolve, reject) => {
|
|
8
|
-
var fulfilled = (value) => {
|
|
9
|
-
try {
|
|
10
|
-
step(generator.next(value));
|
|
11
|
-
} catch (e) {
|
|
12
|
-
reject(e);
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
var rejected = (value) => {
|
|
16
|
-
try {
|
|
17
|
-
step(generator.throw(value));
|
|
18
|
-
} catch (e) {
|
|
19
|
-
reject(e);
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
23
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
function cancel() {
|
|
27
|
-
return new ResponseError(-32800, "Request cancelled");
|
|
28
|
-
}
|
|
29
|
-
function runAndCatch(func, token, errorVal) {
|
|
30
|
-
return __async$1(this, null, function* () {
|
|
31
|
-
if (token.isCancellationRequested) {
|
|
32
|
-
return cancel();
|
|
33
|
-
}
|
|
34
|
-
try {
|
|
35
|
-
const result = yield func();
|
|
36
|
-
if (token.isCancellationRequested) {
|
|
37
|
-
return cancel();
|
|
38
|
-
}
|
|
39
|
-
return result;
|
|
40
|
-
} catch (e) {
|
|
41
|
-
return errorVal;
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
var __async = (__this, __arguments, generator) => {
|
|
47
|
-
return new Promise((resolve, reject) => {
|
|
48
|
-
var fulfilled = (value) => {
|
|
49
|
-
try {
|
|
50
|
-
step(generator.next(value));
|
|
51
|
-
} catch (e) {
|
|
52
|
-
reject(e);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
var rejected = (value) => {
|
|
56
|
-
try {
|
|
57
|
-
step(generator.throw(value));
|
|
58
|
-
} catch (e) {
|
|
59
|
-
reject(e);
|
|
60
|
-
}
|
|
61
|
-
};
|
|
62
|
-
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
63
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
64
|
-
});
|
|
65
|
-
};
|
|
66
|
-
const dateFormat = new Intl.DateTimeFormat("en", {
|
|
67
|
-
year: "numeric",
|
|
68
|
-
month: "2-digit",
|
|
69
|
-
day: "2-digit",
|
|
70
|
-
hour12: false,
|
|
71
|
-
hour: "2-digit",
|
|
72
|
-
minute: "2-digit",
|
|
73
|
-
second: "2-digit"
|
|
74
|
-
});
|
|
75
|
-
const logFilePath = process.argv.length === 4 && fs.existsSync(process.argv[3]) && process.argv[3];
|
|
76
|
-
const formatLog = (a) => {
|
|
77
|
-
const msg = typeof a === "string" ? a : JSON.stringify(a);
|
|
78
|
-
const date = new Date();
|
|
79
|
-
return `${dateFormat.format(date)},$${date.getMilliseconds()} | ${msg}
|
|
80
|
-
`;
|
|
81
|
-
};
|
|
82
|
-
const fileLog = logFilePath ? (a) => fs.appendFile(logFilePath, formatLog(a), () => {
|
|
83
|
-
}) : () => {
|
|
84
|
-
};
|
|
85
|
-
const service = new PlayerLanguageService();
|
|
86
|
-
const connection = createConnection(ProposedFeatures.all);
|
|
87
|
-
const documents = new TextDocuments(TextDocument);
|
|
88
|
-
let hasConfigurationCapability = false;
|
|
89
|
-
process.on("unhandledRejection", (e) => {
|
|
90
|
-
console.error(e.message);
|
|
91
|
-
});
|
|
92
|
-
process.on("uncaughtException", (e) => {
|
|
93
|
-
console.error(e.message);
|
|
94
|
-
});
|
|
95
|
-
console.log = (a) => {
|
|
96
|
-
fileLog(a);
|
|
97
|
-
connection.console.log(JSON.stringify(a, null, 2));
|
|
98
|
-
};
|
|
99
|
-
console.error = (a) => {
|
|
100
|
-
fileLog(a);
|
|
101
|
-
connection.console.error(JSON.stringify(a, null, 2));
|
|
102
|
-
};
|
|
103
|
-
function validate(textDocument) {
|
|
104
|
-
return __async(this, null, function* () {
|
|
105
|
-
const diagnostics = yield service.validateTextDocument(textDocument);
|
|
106
|
-
if (diagnostics) {
|
|
107
|
-
connection.sendDiagnostics({ uri: textDocument.uri, diagnostics });
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
}
|
|
111
|
-
connection.onInitialize((params) => {
|
|
112
|
-
const { capabilities } = params;
|
|
113
|
-
hasConfigurationCapability = Boolean(capabilities.workspace && Boolean(capabilities.workspace.configuration));
|
|
114
|
-
fileLog("Initialized Player LSP Server");
|
|
115
|
-
return {
|
|
116
|
-
capabilities: {
|
|
117
|
-
textDocumentSync: TextDocumentSyncKind.Full,
|
|
118
|
-
codeActionProvider: true,
|
|
119
|
-
definitionProvider: true,
|
|
120
|
-
completionProvider: {
|
|
121
|
-
resolveProvider: false,
|
|
122
|
-
triggerCharacters: ['"', ":"]
|
|
123
|
-
},
|
|
124
|
-
documentFormattingProvider: true,
|
|
125
|
-
documentRangeFormattingProvider: true,
|
|
126
|
-
hoverProvider: true
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
});
|
|
130
|
-
connection.onCompletion((textDocumentPosition, token) => __async(undefined, null, function* () {
|
|
131
|
-
return runAndCatch(() => {
|
|
132
|
-
const document = documents.get(textDocumentPosition.textDocument.uri);
|
|
133
|
-
if (document !== void 0) {
|
|
134
|
-
return service.getCompletionsAtPosition(document, textDocumentPosition.position);
|
|
135
|
-
}
|
|
136
|
-
return null;
|
|
137
|
-
}, token, null);
|
|
138
|
-
}));
|
|
139
|
-
connection.onHover((hoverParams, token) => __async(undefined, null, function* () {
|
|
140
|
-
return runAndCatch(() => {
|
|
141
|
-
const document = documents.get(hoverParams.textDocument.uri);
|
|
142
|
-
if (document !== void 0) {
|
|
143
|
-
return service.getHoverInfoAtPosition(document, hoverParams.position);
|
|
144
|
-
}
|
|
145
|
-
return null;
|
|
146
|
-
}, token, null);
|
|
147
|
-
}));
|
|
148
|
-
connection.onCompletionResolve((item, token) => runAndCatch(() => service.resolveCompletionItem(item), token, item));
|
|
149
|
-
connection.onDocumentFormatting((formattingParams, token) => runAndCatch(() => {
|
|
150
|
-
const document = documents.get(formattingParams.textDocument.uri);
|
|
151
|
-
if (document !== void 0) {
|
|
152
|
-
return service.formatTextDocument(document, formattingParams.options);
|
|
153
|
-
}
|
|
154
|
-
return void 0;
|
|
155
|
-
}, token, null));
|
|
156
|
-
connection.onDocumentRangeFormatting((formattingParams, token) => runAndCatch(() => {
|
|
157
|
-
const document = documents.get(formattingParams.textDocument.uri);
|
|
158
|
-
if (document !== void 0) {
|
|
159
|
-
return service.formatTextDocument(document, formattingParams.options, formattingParams.range);
|
|
160
|
-
}
|
|
161
|
-
return void 0;
|
|
162
|
-
}, token, null));
|
|
163
|
-
connection.onDefinition((definitionParams, token) => runAndCatch(() => {
|
|
164
|
-
const document = documents.get(definitionParams.textDocument.uri);
|
|
165
|
-
if (document !== void 0) {
|
|
166
|
-
return service.getDefinitionAtPosition(document, definitionParams.position);
|
|
167
|
-
}
|
|
168
|
-
return void 0;
|
|
169
|
-
}, token, null));
|
|
170
|
-
connection.onInitialized(() => {
|
|
171
|
-
if (hasConfigurationCapability) {
|
|
172
|
-
connection.client.register(DidChangeConfigurationNotification.type, void 0);
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
connection.onCodeAction((codeAction) => {
|
|
176
|
-
const document = documents.get(codeAction.textDocument.uri);
|
|
177
|
-
if (!document) {
|
|
178
|
-
return [];
|
|
179
|
-
}
|
|
180
|
-
return service.getCodeActionsInRange(document, codeAction.context);
|
|
181
|
-
});
|
|
182
|
-
documents.onDidClose((change) => {
|
|
183
|
-
service.onClose(change.document);
|
|
184
|
-
});
|
|
185
|
-
documents.onDidChangeContent((change) => {
|
|
186
|
-
validate(change.document);
|
|
187
|
-
});
|
|
188
|
-
connection.onNotification("player/setAssetBundles", (assetBundles) => {
|
|
189
|
-
if (Array.isArray(assetBundles)) {
|
|
190
|
-
console.log("Updating asset type bundles");
|
|
191
|
-
service.setAssetTypes(assetBundles);
|
|
192
|
-
}
|
|
193
|
-
});
|
|
194
|
-
fileLog("Starting Player LSP Server");
|
|
195
|
-
documents.listen(connection);
|
|
196
|
-
connection.listen();
|
|
197
|
-
|
|
198
|
-
export { runAndCatch };
|
|
199
|
-
//# sourceMappingURL=index.esm.js.map
|