@codingame/monaco-languageclient-wrapper 1.1.8 → 1.2.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/main.js CHANGED
@@ -21094,6 +21094,18 @@ const staticOptions = asLanguageClientOptionsById({
21094
21094
  language: 'sql'
21095
21095
  }]
21096
21096
  },
21097
+ 'sql-sqls': {
21098
+ documentSelector: [{
21099
+ language: 'sql'
21100
+ }],
21101
+ // Disable code actions
21102
+ middleware: {
21103
+ provideCodeActions() {
21104
+ return [];
21105
+ }
21106
+
21107
+ }
21108
+ },
21097
21109
  swift: {
21098
21110
  // https://github.com/apple/sourcekit-lsp/blob/59b5e68f7f8408b5bc44bd47f71ef1afdc63e7a6/Editors/vscode/src/extension.ts#L22
21099
21111
  documentSelector: ['swift', 'cpp', 'c', 'objective-c', 'objective-cpp'],
@@ -21206,38 +21218,71 @@ class LanguageClientManager {
21206
21218
  }
21207
21219
 
21208
21220
  start() {
21221
+ var _this$languageServerO;
21222
+
21209
21223
  const onServerResponse = new lib$1.Emitter();
21210
21224
  const languageClient = createLanguageClient(this.id, this.sessionId, this.languageServerOptions, this.languageServerAddress, this.getSecurityToken, this.libraryUrls, {
21211
21225
  error: this.handleError,
21212
21226
  closed: this.handleClose
21213
- }, {
21227
+ }, _objectSpread2(_objectSpread2({}, (_this$languageServerO = this.languageServerOptions.middleware) !== null && _this$languageServerO !== void 0 ? _this$languageServerO : {}), {}, {
21214
21228
  handleDiagnostics: (uri, diagnostics, next) => {
21215
- next(uri, diagnostics);
21229
+ var _this$languageServerO2;
21230
+
21231
+ if (((_this$languageServerO2 = this.languageServerOptions.middleware) === null || _this$languageServerO2 === void 0 ? void 0 : _this$languageServerO2.handleDiagnostics) != null) {
21232
+ this.languageServerOptions.middleware.handleDiagnostics(uri, diagnostics, next);
21233
+ } else {
21234
+ next(uri, diagnostics);
21235
+ }
21236
+
21216
21237
  onServerResponse.fire();
21217
21238
  },
21218
21239
  provideCodeActions: async (document, range, context, token, next) => {
21219
21240
  try {
21220
- return await next(document, range, context, token);
21241
+ var _this$languageServerO3;
21242
+
21243
+ if (((_this$languageServerO3 = this.languageServerOptions.middleware) === null || _this$languageServerO3 === void 0 ? void 0 : _this$languageServerO3.provideCodeActions) != null) {
21244
+ return await this.languageServerOptions.middleware.provideCodeActions(document, range, context, token, next);
21245
+ } else {
21246
+ return await next(document, range, context, token);
21247
+ }
21221
21248
  } finally {
21222
21249
  onServerResponse.fire();
21223
21250
  }
21224
21251
  },
21225
21252
  provideDocumentRangeSemanticTokens: async (document, range, token, next) => {
21226
21253
  try {
21227
- return await next(document, range, token);
21254
+ var _this$languageServerO4;
21255
+
21256
+ if (((_this$languageServerO4 = this.languageServerOptions.middleware) === null || _this$languageServerO4 === void 0 ? void 0 : _this$languageServerO4.provideDocumentRangeSemanticTokens) != null) {
21257
+ return await this.languageServerOptions.middleware.provideDocumentRangeSemanticTokens(document, range, token, next);
21258
+ } else {
21259
+ return await next(document, range, token);
21260
+ }
21228
21261
  } finally {
21229
21262
  onServerResponse.fire();
21230
21263
  }
21231
21264
  },
21232
21265
  provideDocumentSemanticTokens: async (document, token, next) => {
21233
21266
  try {
21234
- return await next(document, token);
21267
+ var _this$languageServerO5;
21268
+
21269
+ if (((_this$languageServerO5 = this.languageServerOptions.middleware) === null || _this$languageServerO5 === void 0 ? void 0 : _this$languageServerO5.provideDocumentSemanticTokens) != null) {
21270
+ return await this.languageServerOptions.middleware.provideDocumentSemanticTokens(document, token, next);
21271
+ } else {
21272
+ return await next(document, token);
21273
+ }
21235
21274
  } finally {
21236
21275
  onServerResponse.fire();
21237
21276
  }
21238
21277
  },
21239
21278
  handleWorkDoneProgress: async (token, params, next) => {
21240
- next(token, params);
21279
+ var _this$languageServerO6;
21280
+
21281
+ if (((_this$languageServerO6 = this.languageServerOptions.middleware) === null || _this$languageServerO6 === void 0 ? void 0 : _this$languageServerO6.handleWorkDoneProgress) != null) {
21282
+ this.languageServerOptions.middleware.handleWorkDoneProgress(token, params, next);
21283
+ } else {
21284
+ next(token, params);
21285
+ }
21241
21286
 
21242
21287
  if (params.kind === 'end') {
21243
21288
  onServerResponse.fire();
@@ -21245,12 +21290,18 @@ class LanguageClientManager {
21245
21290
  },
21246
21291
  provideHover: async (document, position, token, next) => {
21247
21292
  try {
21248
- return await next(document, position, token);
21293
+ var _this$languageServerO7;
21294
+
21295
+ if (((_this$languageServerO7 = this.languageServerOptions.middleware) === null || _this$languageServerO7 === void 0 ? void 0 : _this$languageServerO7.provideHover) != null) {
21296
+ return await this.languageServerOptions.middleware.provideHover(document, position, token, next);
21297
+ } else {
21298
+ return await next(document, position, token);
21299
+ }
21249
21300
  } finally {
21250
21301
  onServerResponse.fire();
21251
21302
  }
21252
21303
  }
21253
- });
21304
+ }));
21254
21305
  this.languageClient = languageClient;
21255
21306
  let readyPromise = null;
21256
21307
  languageClient.onDidChangeState(async state => {