@codingame/monaco-languageclient-wrapper 3.1.2 → 3.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/cobol.js ADDED
@@ -0,0 +1,31 @@
1
+ import { a as api } from './index2.js';
2
+ import * as vscode from 'vscode';
3
+ import { E as ExtensionFeature } from './tools.js';
4
+
5
+ const ResolveCobolSubroutineRequestType = new api.ProtocolRequestType('cobol/resolveSubroutine');
6
+ class CobolResolveSubroutineFeature extends ExtensionFeature {
7
+ constructor(languageClient) {
8
+ super();
9
+ this.languageClient = languageClient;
10
+ }
11
+
12
+ activate(context, capabilities, documentSelector) {
13
+ context.subscriptions.push(this.languageClient.onRequest(ResolveCobolSubroutineRequestType, routineName => {
14
+ var _vscode$workspace$roo, _vscode$workspace$tex;
15
+
16
+ const constantRoutinePaths = {
17
+ 'assert-equals': "file:".concat((_vscode$workspace$roo = vscode.workspace.rootPath) !== null && _vscode$workspace$roo !== void 0 ? _vscode$workspace$roo : '/tmp/project', "/deps/assert-equals.cbl")
18
+ };
19
+ const contantRoutinePath = constantRoutinePaths[routineName.toLowerCase()];
20
+
21
+ if (contantRoutinePath != null) {
22
+ return contantRoutinePath;
23
+ }
24
+
25
+ return (_vscode$workspace$tex = vscode.workspace.textDocuments.filter(textDocument => vscode.languages.match(documentSelector, textDocument)).filter(document => document.getText().match(new RegExp("PROGRAM-ID\\.\\W+".concat(routineName, "\\."), 'gi'))).sort((a, b) => a.uri.toString().localeCompare(b.uri.toString()))[0]) === null || _vscode$workspace$tex === void 0 ? void 0 : _vscode$workspace$tex.uri.toString();
26
+ }));
27
+ }
28
+
29
+ }
30
+
31
+ export { CobolResolveSubroutineFeature, ResolveCobolSubroutineRequestType };
package/dist/index.d.ts CHANGED
@@ -1483,7 +1483,7 @@ declare type LanguageClientOptions = Pick<LanguageClientOptions$1, 'documentSele
1483
1483
  * The language server will only be considered ready after this log message was received
1484
1484
  */
1485
1485
  readinessMessageMatcher?: RegExp;
1486
- createAdditionalFeatures?(client: MonacoLanguageClient): (StaticFeature | DynamicFeature<unknown>)[];
1486
+ createAdditionalFeatures?(client: MonacoLanguageClient): Promise<(StaticFeature | DynamicFeature<unknown>)[]>;
1487
1487
  };
1488
1488
  declare function registerLanguageClient(id: string, options: LanguageClientOptions): Disposable;
1489
1489
  declare type LanguageClientId = StaticLanguageClientId | string;