@codingame/monaco-vscode-json-language-features-default-extension 1.82.6 → 1.83.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/index.js +1 -1
- package/jsonClientMain.js +3 -21
- package/jsonClientMain.js.map +1 -1
- package/jsonServerMain.js +18 -2
- package/jsonServerMain.js.map +1 -1
- package/package.json +2 -2
package/jsonServerMain.js
CHANGED
|
@@ -10241,6 +10241,7 @@ const validation_1 = __webpack_require__(73);
|
|
|
10241
10241
|
const vscode_json_languageservice_1 = __webpack_require__(74);
|
|
10242
10242
|
const languageModelCache_1 = __webpack_require__(102);
|
|
10243
10243
|
const vscode_uri_1 = __webpack_require__(95);
|
|
10244
|
+
const l10n = __webpack_require__(1);
|
|
10244
10245
|
var SchemaAssociationNotification;
|
|
10245
10246
|
(function (SchemaAssociationNotification) {
|
|
10246
10247
|
SchemaAssociationNotification.type = new vscode_languageserver_1.NotificationType('json/schemaAssociations');
|
|
@@ -10354,7 +10355,7 @@ function startServer(connection, runtime) {
|
|
|
10354
10355
|
const capabilities = {
|
|
10355
10356
|
textDocumentSync: vscode_languageserver_1.TextDocumentSyncKind.Incremental,
|
|
10356
10357
|
completionProvider: clientSnippetSupport ? {
|
|
10357
|
-
resolveProvider: false,
|
|
10358
|
+
resolveProvider: false, // turn off resolving as the current language service doesn't do anything on resolve. Also fixes #91747
|
|
10358
10359
|
triggerCharacters: ['"', ':']
|
|
10359
10360
|
} : undefined,
|
|
10360
10361
|
hoverProvider: true,
|
|
@@ -10369,7 +10370,8 @@ function startServer(connection, runtime) {
|
|
|
10369
10370
|
documentSelector: null,
|
|
10370
10371
|
interFileDependencies: false,
|
|
10371
10372
|
workspaceDiagnostics: false
|
|
10372
|
-
}
|
|
10373
|
+
},
|
|
10374
|
+
codeActionProvider: true
|
|
10373
10375
|
};
|
|
10374
10376
|
return { capabilities };
|
|
10375
10377
|
});
|
|
@@ -10560,6 +10562,20 @@ function startServer(connection, runtime) {
|
|
|
10560
10562
|
return [];
|
|
10561
10563
|
}, [], `Error while computing document symbols for ${documentSymbolParams.textDocument.uri}`, token);
|
|
10562
10564
|
});
|
|
10565
|
+
connection.onCodeAction((codeActionParams, token) => {
|
|
10566
|
+
return (0, runner_1.runSafeAsync)(runtime, async () => {
|
|
10567
|
+
const document = documents.get(codeActionParams.textDocument.uri);
|
|
10568
|
+
if (document) {
|
|
10569
|
+
const sortCodeAction = vscode_languageserver_1.CodeAction.create('Sort JSON', vscode_languageserver_1.CodeActionKind.Source.concat('.sort', '.json'));
|
|
10570
|
+
sortCodeAction.command = {
|
|
10571
|
+
command: 'json.sort',
|
|
10572
|
+
title: l10n.t('Sort JSON')
|
|
10573
|
+
};
|
|
10574
|
+
return [sortCodeAction];
|
|
10575
|
+
}
|
|
10576
|
+
return [];
|
|
10577
|
+
}, [], `Error while computing code actions for ${codeActionParams.textDocument.uri}`, token);
|
|
10578
|
+
});
|
|
10563
10579
|
function onFormat(textDocument, range, options) {
|
|
10564
10580
|
options.keepLines = keepLinesEnabled;
|
|
10565
10581
|
const document = documents.get(textDocument.uri);
|