@difizen/libro-language-client 0.1.18
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/LICENSE +21 -0
- package/README.md +0 -0
- package/es/common/api.d.ts +38 -0
- package/es/common/api.d.ts.map +1 -0
- package/es/common/api.js +9 -0
- package/es/common/callHierarchy.d.ts +39 -0
- package/es/common/callHierarchy.d.ts.map +1 -0
- package/es/common/callHierarchy.js +139 -0
- package/es/common/client.d.ts +482 -0
- package/es/common/client.d.ts.map +1 -0
- package/es/common/client.js +2731 -0
- package/es/common/codeAction.d.ts +22 -0
- package/es/common/codeAction.d.ts.map +1 -0
- package/es/common/codeAction.js +149 -0
- package/es/common/codeConverter.d.ts +81 -0
- package/es/common/codeConverter.d.ts.map +1 -0
- package/es/common/codeConverter.js +1040 -0
- package/es/common/codeLens.d.ts +26 -0
- package/es/common/codeLens.d.ts.map +1 -0
- package/es/common/codeLens.js +125 -0
- package/es/common/colorProvider.d.ts +27 -0
- package/es/common/colorProvider.d.ts.map +1 -0
- package/es/common/colorProvider.js +104 -0
- package/es/common/completion.d.ts +22 -0
- package/es/common/completion.d.ts.map +1 -0
- package/es/common/completion.js +130 -0
- package/es/common/configuration.d.ts +71 -0
- package/es/common/configuration.d.ts.map +1 -0
- package/es/common/configuration.js +292 -0
- package/es/common/declaration.d.ts +18 -0
- package/es/common/declaration.d.ts.map +1 -0
- package/es/common/declaration.js +88 -0
- package/es/common/definition.d.ts +18 -0
- package/es/common/definition.d.ts.map +1 -0
- package/es/common/definition.js +80 -0
- package/es/common/diagnostic.d.ts +125 -0
- package/es/common/diagnostic.d.ts.map +1 -0
- package/es/common/diagnostic.js +1442 -0
- package/es/common/documentHighlight.d.ts +17 -0
- package/es/common/documentHighlight.d.ts.map +1 -0
- package/es/common/documentHighlight.js +73 -0
- package/es/common/documentLink.d.ts +21 -0
- package/es/common/documentLink.d.ts.map +1 -0
- package/es/common/documentLink.js +90 -0
- package/es/common/documentSymbol.d.ts +20 -0
- package/es/common/documentSymbol.d.ts.map +1 -0
- package/es/common/documentSymbol.js +134 -0
- package/es/common/executeCommand.d.ts +22 -0
- package/es/common/executeCommand.d.ts.map +1 -0
- package/es/common/executeCommand.js +117 -0
- package/es/common/features.d.ts +421 -0
- package/es/common/features.d.ts.map +1 -0
- package/es/common/features.js +576 -0
- package/es/common/fileOperations.d.ts +118 -0
- package/es/common/fileOperations.d.ts.map +1 -0
- package/es/common/fileOperations.js +705 -0
- package/es/common/fileSystemWatcher.d.ts +19 -0
- package/es/common/fileSystemWatcher.d.ts.map +1 -0
- package/es/common/fileSystemWatcher.js +173 -0
- package/es/common/foldingRange.d.ts +22 -0
- package/es/common/foldingRange.d.ts.map +1 -0
- package/es/common/foldingRange.js +127 -0
- package/es/common/formatting.d.ts +41 -0
- package/es/common/formatting.d.ts.map +1 -0
- package/es/common/formatting.js +233 -0
- package/es/common/hover.d.ts +18 -0
- package/es/common/hover.d.ts.map +1 -0
- package/es/common/hover.js +80 -0
- package/es/common/implementation.d.ts +18 -0
- package/es/common/implementation.d.ts.map +1 -0
- package/es/common/implementation.js +88 -0
- package/es/common/inlayHint.d.ts +23 -0
- package/es/common/inlayHint.d.ts.map +1 -0
- package/es/common/inlayHint.js +187 -0
- package/es/common/inlineCompletion.d.ts +20 -0
- package/es/common/inlineCompletion.d.ts.map +1 -0
- package/es/common/inlineCompletion.js +74 -0
- package/es/common/inlineValue.d.ts +21 -0
- package/es/common/inlineValue.d.ts.map +1 -0
- package/es/common/inlineValue.js +124 -0
- package/es/common/linkedEditingRange.d.ts +23 -0
- package/es/common/linkedEditingRange.d.ts.map +1 -0
- package/es/common/linkedEditingRange.js +94 -0
- package/es/common/notebook.d.ts +97 -0
- package/es/common/notebook.d.ts.map +1 -0
- package/es/common/notebook.js +1444 -0
- package/es/common/progress.d.ts +12 -0
- package/es/common/progress.d.ts.map +1 -0
- package/es/common/progress.js +75 -0
- package/es/common/progressPart.d.ts +25 -0
- package/es/common/progressPart.d.ts.map +1 -0
- package/es/common/progressPart.js +147 -0
- package/es/common/protocolCallHierarchyItem.d.ts +9 -0
- package/es/common/protocolCallHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolCallHierarchyItem.js +34 -0
- package/es/common/protocolCodeAction.d.ts +7 -0
- package/es/common/protocolCodeAction.d.ts.map +1 -0
- package/es/common/protocolCodeAction.js +32 -0
- package/es/common/protocolCodeLens.d.ts +7 -0
- package/es/common/protocolCodeLens.d.ts.map +1 -0
- package/es/common/protocolCodeLens.js +29 -0
- package/es/common/protocolCompletionItem.d.ts +13 -0
- package/es/common/protocolCompletionItem.d.ts.map +1 -0
- package/es/common/protocolCompletionItem.js +29 -0
- package/es/common/protocolConverter.d.ts +174 -0
- package/es/common/protocolConverter.d.ts.map +1 -0
- package/es/common/protocolConverter.js +1982 -0
- package/es/common/protocolDiagnostic.d.ts +20 -0
- package/es/common/protocolDiagnostic.d.ts.map +1 -0
- package/es/common/protocolDiagnostic.js +46 -0
- package/es/common/protocolDocumentLink.d.ts +8 -0
- package/es/common/protocolDocumentLink.d.ts.map +1 -0
- package/es/common/protocolDocumentLink.js +29 -0
- package/es/common/protocolInlayHint.d.ts +8 -0
- package/es/common/protocolInlayHint.d.ts.map +1 -0
- package/es/common/protocolInlayHint.js +29 -0
- package/es/common/protocolTypeHierarchyItem.d.ts +9 -0
- package/es/common/protocolTypeHierarchyItem.d.ts.map +1 -0
- package/es/common/protocolTypeHierarchyItem.js +34 -0
- package/es/common/protocolWorkspaceSymbol.d.ts +9 -0
- package/es/common/protocolWorkspaceSymbol.d.ts.map +1 -0
- package/es/common/protocolWorkspaceSymbol.js +36 -0
- package/es/common/reference.d.ts +22 -0
- package/es/common/reference.d.ts.map +1 -0
- package/es/common/reference.js +78 -0
- package/es/common/rename.d.ts +29 -0
- package/es/common/rename.d.ts.map +1 -0
- package/es/common/rename.js +132 -0
- package/es/common/selectionRange.d.ts +18 -0
- package/es/common/selectionRange.d.ts.map +1 -0
- package/es/common/selectionRange.js +108 -0
- package/es/common/semanticTokens.d.ts +36 -0
- package/es/common/semanticTokens.d.ts.map +1 -0
- package/es/common/semanticTokens.js +226 -0
- package/es/common/signatureHelp.d.ts +18 -0
- package/es/common/signatureHelp.d.ts.map +1 -0
- package/es/common/signatureHelp.js +103 -0
- package/es/common/textSynchronization.d.ts +104 -0
- package/es/common/textSynchronization.d.ts.map +1 -0
- package/es/common/textSynchronization.js +771 -0
- package/es/common/typeDefinition.d.ts +18 -0
- package/es/common/typeDefinition.d.ts.map +1 -0
- package/es/common/typeDefinition.js +89 -0
- package/es/common/typeHierarchy.d.ts +33 -0
- package/es/common/typeHierarchy.d.ts.map +1 -0
- package/es/common/typeHierarchy.js +138 -0
- package/es/common/utils/async.d.ts +42 -0
- package/es/common/utils/async.d.ts.map +1 -0
- package/es/common/utils/async.js +441 -0
- package/es/common/utils/is.d.ts +13 -0
- package/es/common/utils/is.d.ts.map +1 -0
- package/es/common/utils/is.js +52 -0
- package/es/common/utils/uuid.d.ts +23 -0
- package/es/common/utils/uuid.d.ts.map +1 -0
- package/es/common/utils/uuid.js +85 -0
- package/es/common/vscodeAdaptor/convertor.d.ts +7 -0
- package/es/common/vscodeAdaptor/convertor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/convertor.js +66 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts +33 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/diagnosticCollection.js +310 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts +1496 -0
- package/es/common/vscodeAdaptor/extHostTypes.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/extHostTypes.js +3825 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts +19 -0
- package/es/common/vscodeAdaptor/fileWatcher.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/fileWatcher.js +45 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts +192 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/hostTypeUtil.js +566 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts +21 -0
- package/es/common/vscodeAdaptor/libro-fs.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libro-fs.js +64 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts +21 -0
- package/es/common/vscodeAdaptor/libroWindow.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWindow.js +75 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts +33 -0
- package/es/common/vscodeAdaptor/libroWorkspace.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/libroWorkspace.js +250 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts +8 -0
- package/es/common/vscodeAdaptor/lspEnv.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/lspEnv.js +31 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts +229 -0
- package/es/common/vscodeAdaptor/monaco-converter.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monaco-converter.js +1613 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts +48 -0
- package/es/common/vscodeAdaptor/monacoLanguages.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/monacoLanguages.js +484 -0
- package/es/common/vscodeAdaptor/services.d.ts +85 -0
- package/es/common/vscodeAdaptor/services.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/services.js +3 -0
- package/es/common/vscodeAdaptor/typings.d.ts +10 -0
- package/es/common/vscodeAdaptor/util.d.ts +3 -0
- package/es/common/vscodeAdaptor/util.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/util.js +6 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts +77 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.d.ts.map +1 -0
- package/es/common/vscodeAdaptor/vscodeAdaptor.js +124 -0
- package/es/common/workspaceFolder.d.ts +32 -0
- package/es/common/workspaceFolder.d.ts.map +1 -0
- package/es/common/workspaceFolder.js +204 -0
- package/es/common/workspaceSymbol.d.ts +21 -0
- package/es/common/workspaceSymbol.d.ts.map +1 -0
- package/es/common/workspaceSymbol.js +101 -0
- package/es/constants.d.ts +2 -0
- package/es/constants.d.ts.map +1 -0
- package/es/constants.js +1 -0
- package/es/index.d.ts +6 -0
- package/es/index.d.ts.map +1 -0
- package/es/index.js +5 -0
- package/es/libro-language-client-contribution.d.ts +10 -0
- package/es/libro-language-client-contribution.d.ts.map +1 -0
- package/es/libro-language-client-contribution.js +143 -0
- package/es/libro-language-client-manager.d.ts +34 -0
- package/es/libro-language-client-manager.d.ts.map +1 -0
- package/es/libro-language-client-manager.js +277 -0
- package/es/libro-language-client.d.ts +27 -0
- package/es/libro-language-client.d.ts.map +1 -0
- package/es/libro-language-client.js +141 -0
- package/es/module.d.ts +3 -0
- package/es/module.d.ts.map +1 -0
- package/es/module.js +13 -0
- package/package.json +69 -0
- package/src/common/api.ts +155 -0
- package/src/common/callHierarchy.ts +269 -0
- package/src/common/client.ts +3192 -0
- package/src/common/codeAction.ts +237 -0
- package/src/common/codeConverter.ts +1409 -0
- package/src/common/codeLens.ts +188 -0
- package/src/common/colorProvider.ts +192 -0
- package/src/common/completion.ts +281 -0
- package/src/common/configuration.ts +338 -0
- package/src/common/declaration.ts +140 -0
- package/src/common/definition.ts +138 -0
- package/src/common/diagnostic.ts +1408 -0
- package/src/common/documentHighlight.ts +140 -0
- package/src/common/documentLink.ts +180 -0
- package/src/common/documentSymbol.ts +186 -0
- package/src/common/executeCommand.ts +129 -0
- package/src/common/features.ts +1157 -0
- package/src/common/fileOperations.ts +635 -0
- package/src/common/fileSystemWatcher.ts +184 -0
- package/src/common/foldingRange.ts +160 -0
- package/src/common/formatting.ts +465 -0
- package/src/common/hover.ts +133 -0
- package/src/common/implementation.ts +142 -0
- package/src/common/inlayHint.ts +201 -0
- package/src/common/inlineCompletion.ts +160 -0
- package/src/common/inlineValue.ts +158 -0
- package/src/common/linkedEditingRange.ts +141 -0
- package/src/common/notebook.ts +1443 -0
- package/src/common/progress.ts +61 -0
- package/src/common/progressPart.ts +151 -0
- package/src/common/protocolCallHierarchyItem.ts +29 -0
- package/src/common/protocolCodeAction.ts +17 -0
- package/src/common/protocolCodeLens.ts +15 -0
- package/src/common/protocolCompletionItem.ts +22 -0
- package/src/common/protocolConverter.ts +2627 -0
- package/src/common/protocolDiagnostic.ts +47 -0
- package/src/common/protocolDocumentLink.ts +17 -0
- package/src/common/protocolInlayHint.ts +21 -0
- package/src/common/protocolTypeHierarchyItem.ts +29 -0
- package/src/common/protocolWorkspaceSymbol.ts +39 -0
- package/src/common/reference.ts +144 -0
- package/src/common/rename.ts +230 -0
- package/src/common/selectionRange.ts +136 -0
- package/src/common/semanticTokens.ts +383 -0
- package/src/common/signatureHelp.ts +170 -0
- package/src/common/textSynchronization.ts +819 -0
- package/src/common/typeDefinition.ts +146 -0
- package/src/common/typeHierarchy.ts +248 -0
- package/src/common/utils/async.ts +354 -0
- package/src/common/utils/is.ts +63 -0
- package/src/common/utils/uuid.ts +136 -0
- package/src/common/vscodeAdaptor/convertor.ts +73 -0
- package/src/common/vscodeAdaptor/diagnosticCollection.ts +238 -0
- package/src/common/vscodeAdaptor/extHostTypes.ts +4498 -0
- package/src/common/vscodeAdaptor/fileWatcher.ts +36 -0
- package/src/common/vscodeAdaptor/hostTypeUtil.ts +539 -0
- package/src/common/vscodeAdaptor/libro-fs.ts +51 -0
- package/src/common/vscodeAdaptor/libroWindow.ts +85 -0
- package/src/common/vscodeAdaptor/libroWorkspace.ts +261 -0
- package/src/common/vscodeAdaptor/lspEnv.ts +16 -0
- package/src/common/vscodeAdaptor/monaco-converter.ts +1800 -0
- package/src/common/vscodeAdaptor/monacoLanguages.ts +511 -0
- package/src/common/vscodeAdaptor/services.ts +278 -0
- package/src/common/vscodeAdaptor/typings.d.ts +10 -0
- package/src/common/vscodeAdaptor/util.ts +7 -0
- package/src/common/vscodeAdaptor/vscodeAdaptor.ts +122 -0
- package/src/common/workspaceFolder.ts +236 -0
- package/src/common/workspaceSymbol.ts +166 -0
- package/src/constants.ts +1 -0
- package/src/index.spec.ts +7 -0
- package/src/index.ts +5 -0
- package/src/libro-language-client-contribution.ts +49 -0
- package/src/libro-language-client-manager.ts +131 -0
- package/src/libro-language-client.ts +100 -0
- package/src/module.ts +19 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { LSPAny } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { Range, DiagnosticSeverity } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
3
|
+
import { Diagnostic } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
4
|
+
/**
|
|
5
|
+
* We keep this for a while to not break servers which adopted
|
|
6
|
+
* proposed API.
|
|
7
|
+
*/
|
|
8
|
+
export interface DiagnosticCode {
|
|
9
|
+
value: string | number;
|
|
10
|
+
target: string;
|
|
11
|
+
}
|
|
12
|
+
export declare namespace DiagnosticCode {
|
|
13
|
+
function is(value: any): value is DiagnosticCode;
|
|
14
|
+
}
|
|
15
|
+
export declare class ProtocolDiagnostic extends Diagnostic {
|
|
16
|
+
readonly data: LSPAny | undefined;
|
|
17
|
+
hasDiagnosticCode: boolean;
|
|
18
|
+
constructor(range: Range, message: string, severity: DiagnosticSeverity, data: LSPAny | undefined);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=protocolDiagnostic.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolDiagnostic.d.ts","sourceRoot":"","sources":["../../src/common/protocolDiagnostic.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AAGtE,OAAO,KAAK,EAAE,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,yBAAiB,cAAc,CAAC;IAC9B,SAAgB,EAAE,CAAC,KAAK,EAAE,GAAG,GAAG,KAAK,IAAI,cAAc,CAQtD;CACF;AAED,qBAAa,kBAAmB,SAAQ,UAAU;IAChD,SAAgB,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,iBAAiB,EAAE,OAAO,CAAC;gBAGhC,KAAK,EAAE,KAAK,EACZ,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE,kBAAkB,EAC5B,IAAI,EAAE,MAAM,GAAG,SAAS;CAM3B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import * as Is from "./utils/is.js";
|
|
20
|
+
import { Diagnostic } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* We keep this for a while to not break servers which adopted
|
|
24
|
+
* proposed API.
|
|
25
|
+
*/
|
|
26
|
+
export var DiagnosticCode;
|
|
27
|
+
(function (_DiagnosticCode) {
|
|
28
|
+
function is(value) {
|
|
29
|
+
var candidate = value;
|
|
30
|
+
return candidate !== undefined && candidate !== null && (Is.number(candidate.value) || Is.string(candidate.value)) && Is.string(candidate.target);
|
|
31
|
+
}
|
|
32
|
+
_DiagnosticCode.is = is;
|
|
33
|
+
})(DiagnosticCode || (DiagnosticCode = {}));
|
|
34
|
+
export var ProtocolDiagnostic = /*#__PURE__*/function (_Diagnostic) {
|
|
35
|
+
_inherits(ProtocolDiagnostic, _Diagnostic);
|
|
36
|
+
var _super = _createSuper(ProtocolDiagnostic);
|
|
37
|
+
function ProtocolDiagnostic(range, message, severity, data) {
|
|
38
|
+
var _this;
|
|
39
|
+
_classCallCheck(this, ProtocolDiagnostic);
|
|
40
|
+
_this = _super.call(this, range, message, severity);
|
|
41
|
+
_this.data = data;
|
|
42
|
+
_this.hasDiagnosticCode = false;
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
return _createClass(ProtocolDiagnostic);
|
|
46
|
+
}(Diagnostic);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Uri } from 'vscode';
|
|
2
|
+
import type { Range } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
3
|
+
import { DocumentLink } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
4
|
+
export default class ProtocolDocumentLink extends DocumentLink {
|
|
5
|
+
data: any;
|
|
6
|
+
constructor(range: Range, target?: Uri | undefined);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=protocolDocumentLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolDocumentLink.d.ts","sourceRoot":"","sources":["../../src/common/protocolDocumentLink.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAElC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAEhE,MAAM,CAAC,OAAO,OAAO,oBAAqB,SAAQ,YAAY;IACrD,IAAI,EAAE,GAAG,CAAC;gBAEL,KAAK,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,SAAS;CAGnD"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { DocumentLink } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
20
|
+
var ProtocolDocumentLink = /*#__PURE__*/function (_DocumentLink) {
|
|
21
|
+
_inherits(ProtocolDocumentLink, _DocumentLink);
|
|
22
|
+
var _super = _createSuper(ProtocolDocumentLink);
|
|
23
|
+
function ProtocolDocumentLink(range, target) {
|
|
24
|
+
_classCallCheck(this, ProtocolDocumentLink);
|
|
25
|
+
return _super.call(this, range, target);
|
|
26
|
+
}
|
|
27
|
+
return _createClass(ProtocolDocumentLink);
|
|
28
|
+
}(DocumentLink);
|
|
29
|
+
export { ProtocolDocumentLink as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InlayHintKind } from 'vscode';
|
|
2
|
+
import type { InlayHintLabelPart, Position } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
3
|
+
import { InlayHint } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
4
|
+
export default class ProtocolInlayHint extends InlayHint {
|
|
5
|
+
data: any;
|
|
6
|
+
constructor(position: Position, label: string | InlayHintLabelPart[], kind?: InlayHintKind);
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=protocolInlayHint.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolInlayHint.d.ts","sourceRoot":"","sources":["../../src/common/protocolInlayHint.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AAE5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AACrF,OAAO,EAAE,SAAS,EAAE,MAAM,kCAAkC,CAAC;AAE7D,MAAM,CAAC,OAAO,OAAO,iBAAkB,SAAQ,SAAS;IAC/C,IAAI,EAAE,GAAG,CAAC;gBAGf,QAAQ,EAAE,QAAQ,EAClB,KAAK,EAAE,MAAM,GAAG,kBAAkB,EAAE,EACpC,IAAI,CAAC,EAAE,aAAa;CAIvB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { InlayHint } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
20
|
+
var ProtocolInlayHint = /*#__PURE__*/function (_InlayHint) {
|
|
21
|
+
_inherits(ProtocolInlayHint, _InlayHint);
|
|
22
|
+
var _super = _createSuper(ProtocolInlayHint);
|
|
23
|
+
function ProtocolInlayHint(position, label, kind) {
|
|
24
|
+
_classCallCheck(this, ProtocolInlayHint);
|
|
25
|
+
return _super.call(this, position, label, kind);
|
|
26
|
+
}
|
|
27
|
+
return _createClass(ProtocolInlayHint);
|
|
28
|
+
}(InlayHint);
|
|
29
|
+
export { ProtocolInlayHint as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LSPAny } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { SymbolKind, Uri } from 'vscode';
|
|
3
|
+
import type { Range } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
4
|
+
import { TypeHierarchyItem } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
5
|
+
export default class ProtocolTypeHierarchyItem extends TypeHierarchyItem {
|
|
6
|
+
data?: LSPAny;
|
|
7
|
+
constructor(kind: SymbolKind, name: string, detail: string, uri: Uri, range: Range, selectionRange: Range, data?: LSPAny);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=protocolTypeHierarchyItem.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolTypeHierarchyItem.d.ts","sourceRoot":"","sources":["../../src/common/protocolTypeHierarchyItem.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,kCAAkC,CAAC;AAC9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAErE,MAAM,CAAC,OAAO,OAAO,yBAA0B,SAAQ,iBAAiB;IAC/D,IAAI,CAAC,EAAE,MAAM,CAAC;gBAGnB,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,cAAc,EAAE,KAAK,EACrB,IAAI,CAAC,EAAE,MAAM;CAOhB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { TypeHierarchyItem } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
20
|
+
var ProtocolTypeHierarchyItem = /*#__PURE__*/function (_TypeHierarchyItem) {
|
|
21
|
+
_inherits(ProtocolTypeHierarchyItem, _TypeHierarchyItem);
|
|
22
|
+
var _super = _createSuper(ProtocolTypeHierarchyItem);
|
|
23
|
+
function ProtocolTypeHierarchyItem(kind, name, detail, uri, range, selectionRange, data) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, ProtocolTypeHierarchyItem);
|
|
26
|
+
_this = _super.call(this, kind, name, detail, uri, range, selectionRange);
|
|
27
|
+
if (data !== undefined) {
|
|
28
|
+
_this.data = data;
|
|
29
|
+
}
|
|
30
|
+
return _this;
|
|
31
|
+
}
|
|
32
|
+
return _createClass(ProtocolTypeHierarchyItem);
|
|
33
|
+
}(TypeHierarchyItem);
|
|
34
|
+
export { ProtocolTypeHierarchyItem as default };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { LSPAny } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { SymbolKind } from 'vscode';
|
|
3
|
+
import { SymbolInformation, Location, Uri } from './vscodeAdaptor/vscodeAdaptor.js';
|
|
4
|
+
export default class WorkspaceSymbol extends SymbolInformation {
|
|
5
|
+
data?: LSPAny;
|
|
6
|
+
readonly hasRange: boolean;
|
|
7
|
+
constructor(name: string, kind: SymbolKind, containerName: string, locationOrUri: Location | Uri, data: LSPAny | undefined);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=protocolWorkspaceSymbol.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocolWorkspaceSymbol.d.ts","sourceRoot":"","sources":["../../src/common/protocolWorkspaceSymbol.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,yCAAyC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,QAAQ,CAAC;AAEzC,OAAO,EACL,iBAAiB,EACjB,QAAQ,EAER,GAAG,EACJ,MAAM,kCAAkC,CAAC;AAE1C,MAAM,CAAC,OAAO,OAAO,eAAgB,SAAQ,iBAAiB;IACrD,IAAI,CAAC,EAAE,MAAM,CAAC;IACrB,SAAgB,QAAQ,EAAE,OAAO,CAAC;gBAGhC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,UAAU,EAChB,aAAa,EAAE,MAAM,EACrB,aAAa,EAAE,QAAQ,GAAG,GAAG,EAC7B,IAAI,EAAE,MAAM,GAAG,SAAS;CAc3B"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
5
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
6
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { SymbolInformation, Location, Range, Uri } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
20
|
+
var WorkspaceSymbol = /*#__PURE__*/function (_SymbolInformation) {
|
|
21
|
+
_inherits(WorkspaceSymbol, _SymbolInformation);
|
|
22
|
+
var _super = _createSuper(WorkspaceSymbol);
|
|
23
|
+
function WorkspaceSymbol(name, kind, containerName, locationOrUri, data) {
|
|
24
|
+
var _this;
|
|
25
|
+
_classCallCheck(this, WorkspaceSymbol);
|
|
26
|
+
var hasRange = !(locationOrUri instanceof Uri);
|
|
27
|
+
_this = _super.call(this, name, kind, containerName, hasRange ? locationOrUri : new Location(locationOrUri, new Range(0, 0, 0, 0)));
|
|
28
|
+
_this.hasRange = hasRange;
|
|
29
|
+
if (data !== undefined) {
|
|
30
|
+
_this.data = data;
|
|
31
|
+
}
|
|
32
|
+
return _this;
|
|
33
|
+
}
|
|
34
|
+
return _createClass(WorkspaceSymbol);
|
|
35
|
+
}(SymbolInformation);
|
|
36
|
+
export { WorkspaceSymbol as default };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ClientCapabilities, DocumentSelector, ReferenceOptions, ReferenceRegistrationOptions, ServerCapabilities, TextDocumentRegistrationOptions } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { TextDocument, Disposable, Position as VPosition, CancellationToken, ProviderResult, ReferenceProvider, Location as VLocation } from 'vscode';
|
|
3
|
+
import type { FeatureClient } from './features.js';
|
|
4
|
+
import { TextDocumentLanguageFeature } from './features.js';
|
|
5
|
+
export interface ProvideReferencesSignature {
|
|
6
|
+
(this: void, document: TextDocument, position: VPosition, options: {
|
|
7
|
+
includeDeclaration: boolean;
|
|
8
|
+
}, token: CancellationToken): ProviderResult<VLocation[]>;
|
|
9
|
+
}
|
|
10
|
+
export interface ReferencesMiddleware {
|
|
11
|
+
provideReferences?: (this: void, document: TextDocument, position: VPosition, options: {
|
|
12
|
+
includeDeclaration: boolean;
|
|
13
|
+
}, token: CancellationToken, next: ProvideReferencesSignature) => ProviderResult<VLocation[]>;
|
|
14
|
+
}
|
|
15
|
+
export declare class ReferencesFeature extends TextDocumentLanguageFeature<boolean | ReferenceOptions, ReferenceRegistrationOptions, ReferenceProvider, ReferencesMiddleware> {
|
|
16
|
+
constructor(client: FeatureClient<ReferencesMiddleware>);
|
|
17
|
+
fillClientCapabilities(capabilities: ClientCapabilities): void;
|
|
18
|
+
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
|
19
|
+
protected registerLanguageProvider(options: TextDocumentRegistrationOptions): [Disposable, ReferenceProvider];
|
|
20
|
+
private registerProvider;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=reference.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reference.d.ts","sourceRoot":"","sources":["../../src/common/reference.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EAChB,gBAAgB,EAChB,4BAA4B,EAC5B,kBAAkB,EAClB,+BAA+B,EAChC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,YAAY,EACZ,UAAU,EACV,QAAQ,IAAI,SAAS,EACrB,iBAAiB,EACjB,cAAc,EACd,iBAAiB,EACjB,QAAQ,IAAI,SAAS,EACtB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAU,2BAA2B,EAAE,MAAM,eAAe,CAAC;AAIpE,MAAM,WAAW,0BAA0B;IACzC,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE;QAAE,kBAAkB,EAAE,OAAO,CAAA;KAAE,EACxC,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;CAChC;AAED,MAAM,WAAW,oBAAoB;IACnC,iBAAiB,CAAC,EAAE,CAClB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE;QAAE,kBAAkB,EAAE,OAAO,CAAA;KAAE,EACxC,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,0BAA0B,KAC7B,cAAc,CAAC,SAAS,EAAE,CAAC,CAAC;CAClC;AAED,qBAAa,iBAAkB,SAAQ,2BAA2B,CAChE,OAAO,GAAG,gBAAgB,EAC1B,4BAA4B,EAC5B,iBAAiB,EACjB,oBAAoB,CACrB;gBACa,MAAM,EAAE,aAAa,CAAC,oBAAoB,CAAC;IAIhD,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAK9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAWP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,+BAA+B,GACvC,CAAC,UAAU,EAAE,iBAAiB,CAAC;IAqDlC,OAAO,CAAC,gBAAgB;CASzB"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { ReferencesRequest } from '@difizen/vscode-languageserver-protocol';
|
|
20
|
+
import { ensure, TextDocumentLanguageFeature } from "./features.js";
|
|
21
|
+
import * as UUID from "./utils/uuid.js";
|
|
22
|
+
import { languages as Languages } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
23
|
+
export var ReferencesFeature = /*#__PURE__*/function (_TextDocumentLanguage) {
|
|
24
|
+
_inherits(ReferencesFeature, _TextDocumentLanguage);
|
|
25
|
+
var _super = _createSuper(ReferencesFeature);
|
|
26
|
+
function ReferencesFeature(client) {
|
|
27
|
+
_classCallCheck(this, ReferencesFeature);
|
|
28
|
+
return _super.call(this, client, ReferencesRequest.type);
|
|
29
|
+
}
|
|
30
|
+
_createClass(ReferencesFeature, [{
|
|
31
|
+
key: "fillClientCapabilities",
|
|
32
|
+
value: function fillClientCapabilities(capabilities) {
|
|
33
|
+
ensure(ensure(capabilities, 'textDocument'), 'references').dynamicRegistration = true;
|
|
34
|
+
}
|
|
35
|
+
}, {
|
|
36
|
+
key: "initialize",
|
|
37
|
+
value: function initialize(capabilities, documentSelector) {
|
|
38
|
+
var options = this.getRegistrationOptions(documentSelector, capabilities.referencesProvider);
|
|
39
|
+
if (!options) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
this.register({
|
|
43
|
+
id: UUID.generateUuid(),
|
|
44
|
+
registerOptions: options
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
}, {
|
|
48
|
+
key: "registerLanguageProvider",
|
|
49
|
+
value: function registerLanguageProvider(options) {
|
|
50
|
+
var _this = this;
|
|
51
|
+
var selector = options.documentSelector;
|
|
52
|
+
var provider = {
|
|
53
|
+
provideReferences: function provideReferences(document, position, options, token) {
|
|
54
|
+
var client = _this._client;
|
|
55
|
+
var _providerReferences = function _providerReferences(document, position, options, token) {
|
|
56
|
+
return client.sendRequest(ReferencesRequest.type, client.code2ProtocolConverter.asReferenceParams(document, position, options), token).then(function (result) {
|
|
57
|
+
if (token.isCancellationRequested) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
return client.protocol2CodeConverter.asReferences(result, token);
|
|
61
|
+
}, function (error) {
|
|
62
|
+
return client.handleFailedRequest(ReferencesRequest.type, token, error, null);
|
|
63
|
+
});
|
|
64
|
+
};
|
|
65
|
+
var middleware = client.middleware;
|
|
66
|
+
return middleware.provideReferences ? middleware.provideReferences(document, position, options, token, _providerReferences) : _providerReferences(document, position, options, token);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
return [this.registerProvider(selector, provider), provider];
|
|
70
|
+
}
|
|
71
|
+
}, {
|
|
72
|
+
key: "registerProvider",
|
|
73
|
+
value: function registerProvider(selector, provider) {
|
|
74
|
+
return Languages.registerReferenceProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);
|
|
75
|
+
}
|
|
76
|
+
}]);
|
|
77
|
+
return ReferencesFeature;
|
|
78
|
+
}(TextDocumentLanguageFeature);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, RenameOptions, RenameRegistrationOptions } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { Disposable, TextDocument, ProviderResult, Range as VRange, Position as VPosition, WorkspaceEdit as VWorkspaceEdit, RenameProvider } from 'vscode';
|
|
3
|
+
import type { FeatureClient, DocumentSelectorOptions } from './features.js';
|
|
4
|
+
import { TextDocumentLanguageFeature } from './features.js';
|
|
5
|
+
export interface ProvideRenameEditsSignature {
|
|
6
|
+
(this: void, document: TextDocument, position: VPosition, newName: string, token: CancellationToken): ProviderResult<VWorkspaceEdit>;
|
|
7
|
+
}
|
|
8
|
+
export interface PrepareRenameSignature {
|
|
9
|
+
(this: void, document: TextDocument, position: VPosition, token: CancellationToken): ProviderResult<VRange | {
|
|
10
|
+
range: VRange;
|
|
11
|
+
placeholder: string;
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export interface RenameMiddleware {
|
|
15
|
+
provideRenameEdits?: (this: void, document: TextDocument, position: VPosition, newName: string, token: CancellationToken, next: ProvideRenameEditsSignature) => ProviderResult<VWorkspaceEdit>;
|
|
16
|
+
prepareRename?: (this: void, document: TextDocument, position: VPosition, token: CancellationToken, next: PrepareRenameSignature) => ProviderResult<VRange | {
|
|
17
|
+
range: VRange;
|
|
18
|
+
placeholder: string;
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
export declare class RenameFeature extends TextDocumentLanguageFeature<boolean | RenameOptions, RenameRegistrationOptions, RenameProvider, RenameMiddleware> {
|
|
22
|
+
constructor(client: FeatureClient<RenameMiddleware>);
|
|
23
|
+
fillClientCapabilities(capabilities: ClientCapabilities): void;
|
|
24
|
+
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
|
25
|
+
protected registerLanguageProvider(options: RenameRegistrationOptions & DocumentSelectorOptions): [Disposable, RenameProvider];
|
|
26
|
+
private registerProvider;
|
|
27
|
+
private isDefaultBehavior;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=rename.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename.d.ts","sourceRoot":"","sources":["../../src/common/rename.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,yBAAyB,EAI1B,MAAM,yCAAyC,CAAC;AAOjD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,KAAK,IAAI,MAAM,EACf,QAAQ,IAAI,SAAS,EACrB,aAAa,IAAI,cAAc,EAC/B,cAAc,EACf,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAC5E,OAAO,EAAE,2BAA2B,EAAU,MAAM,eAAe,CAAC;AAKpE,MAAM,WAAW,2BAA2B;IAC1C,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,cAAc,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,sBAAsB;IACrC,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACpE;AAED,MAAM,WAAW,gBAAgB;IAC/B,kBAAkB,CAAC,EAAE,CACnB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,2BAA2B,KAC9B,cAAc,CAAC,cAAc,CAAC,CAAC;IACpC,aAAa,CAAC,EAAE,CACd,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,QAAQ,EAAE,SAAS,EACnB,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,sBAAsB,KACzB,cAAc,CAAC,MAAM,GAAG;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtE;AAMD,qBAAa,aAAc,SAAQ,2BAA2B,CAC5D,OAAO,GAAG,aAAa,EACvB,yBAAyB,EACzB,cAAc,EACd,gBAAgB,CACjB;gBACa,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC;IAI5C,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAQ9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAcP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,yBAAyB,GAAG,uBAAuB,GAC3D,CAAC,UAAU,EAAE,cAAc,CAAC;IAmG/B,OAAO,CAAC,gBAAgB;IAUxB,OAAO,CAAC,iBAAiB;CAI1B"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
4
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
9
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
11
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
+
/* --------------------------------------------------------------------------------------------
|
|
15
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
16
|
+
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
17
|
+
* ------------------------------------------------------------------------------------------ */
|
|
18
|
+
|
|
19
|
+
import { RenameRequest, PrepareSupportDefaultBehavior, PrepareRenameRequest, Range } from '@difizen/vscode-languageserver-protocol';
|
|
20
|
+
import { TextDocumentLanguageFeature, ensure } from "./features.js";
|
|
21
|
+
import * as Is from "./utils/is.js";
|
|
22
|
+
import * as UUID from "./utils/uuid.js";
|
|
23
|
+
import { languages as Languages } from "./vscodeAdaptor/vscodeAdaptor.js";
|
|
24
|
+
export var RenameFeature = /*#__PURE__*/function (_TextDocumentLanguage) {
|
|
25
|
+
_inherits(RenameFeature, _TextDocumentLanguage);
|
|
26
|
+
var _super = _createSuper(RenameFeature);
|
|
27
|
+
function RenameFeature(client) {
|
|
28
|
+
_classCallCheck(this, RenameFeature);
|
|
29
|
+
return _super.call(this, client, RenameRequest.type);
|
|
30
|
+
}
|
|
31
|
+
_createClass(RenameFeature, [{
|
|
32
|
+
key: "fillClientCapabilities",
|
|
33
|
+
value: function fillClientCapabilities(capabilities) {
|
|
34
|
+
var rename = ensure(ensure(capabilities, 'textDocument'), 'rename');
|
|
35
|
+
rename.dynamicRegistration = true;
|
|
36
|
+
rename.prepareSupport = true;
|
|
37
|
+
rename.prepareSupportDefaultBehavior = PrepareSupportDefaultBehavior.Identifier;
|
|
38
|
+
rename.honorsChangeAnnotations = true;
|
|
39
|
+
}
|
|
40
|
+
}, {
|
|
41
|
+
key: "initialize",
|
|
42
|
+
value: function initialize(capabilities, documentSelector) {
|
|
43
|
+
var options = this.getRegistrationOptions(documentSelector, capabilities.renameProvider);
|
|
44
|
+
if (!options) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (Is.boolean(capabilities.renameProvider)) {
|
|
48
|
+
options.prepareProvider = false;
|
|
49
|
+
}
|
|
50
|
+
this.register({
|
|
51
|
+
id: UUID.generateUuid(),
|
|
52
|
+
registerOptions: options
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}, {
|
|
56
|
+
key: "registerLanguageProvider",
|
|
57
|
+
value: function registerLanguageProvider(options) {
|
|
58
|
+
var _this = this;
|
|
59
|
+
var selector = options.documentSelector;
|
|
60
|
+
var provider = {
|
|
61
|
+
provideRenameEdits: function provideRenameEdits(document, position, newName, token) {
|
|
62
|
+
var client = _this._client;
|
|
63
|
+
var provideRenameEdits = function provideRenameEdits(document, position, newName, token) {
|
|
64
|
+
var params = {
|
|
65
|
+
textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
|
|
66
|
+
position: client.code2ProtocolConverter.asPosition(position),
|
|
67
|
+
newName: newName
|
|
68
|
+
};
|
|
69
|
+
return client.sendRequest(RenameRequest.type, params, token).then(function (result) {
|
|
70
|
+
if (token.isCancellationRequested) {
|
|
71
|
+
return null;
|
|
72
|
+
}
|
|
73
|
+
return client.protocol2CodeConverter.asWorkspaceEdit(result, token);
|
|
74
|
+
}, function (error) {
|
|
75
|
+
return client.handleFailedRequest(RenameRequest.type, token, error, null, false);
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
var middleware = client.middleware;
|
|
79
|
+
return middleware.provideRenameEdits ? middleware.provideRenameEdits(document, position, newName, token, provideRenameEdits) : provideRenameEdits(document, position, newName, token);
|
|
80
|
+
},
|
|
81
|
+
prepareRename: options.prepareProvider ? function (document, position, token) {
|
|
82
|
+
var client = _this._client;
|
|
83
|
+
var prepareRename = function prepareRename(document, position, token) {
|
|
84
|
+
var params = {
|
|
85
|
+
textDocument: client.code2ProtocolConverter.asTextDocumentIdentifier(document),
|
|
86
|
+
position: client.code2ProtocolConverter.asPosition(position)
|
|
87
|
+
};
|
|
88
|
+
return client.sendRequest(PrepareRenameRequest.type, params, token).then(function (result) {
|
|
89
|
+
if (token.isCancellationRequested) {
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
if (Range.is(result)) {
|
|
93
|
+
return client.protocol2CodeConverter.asRange(result);
|
|
94
|
+
} else if (_this.isDefaultBehavior(result)) {
|
|
95
|
+
return result.defaultBehavior === true ? null : Promise.reject(new Error("The element can't be renamed."));
|
|
96
|
+
} else if (result && Range.is(result.range)) {
|
|
97
|
+
return {
|
|
98
|
+
range: client.protocol2CodeConverter.asRange(result.range),
|
|
99
|
+
placeholder: result.placeholder
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// To cancel the rename vscode API expects a rejected promise.
|
|
103
|
+
// eslint-disable-next-line promise/no-return-wrap
|
|
104
|
+
return Promise.reject(new Error("The element can't be renamed."));
|
|
105
|
+
}, function (error) {
|
|
106
|
+
if (typeof error.message === 'string') {
|
|
107
|
+
throw new Error(error.message);
|
|
108
|
+
} else {
|
|
109
|
+
throw new Error("The element can't be renamed.");
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
var middleware = client.middleware;
|
|
114
|
+
return middleware.prepareRename ? middleware.prepareRename(document, position, token, prepareRename) : prepareRename(document, position, token);
|
|
115
|
+
} : undefined
|
|
116
|
+
};
|
|
117
|
+
return [this.registerProvider(selector, provider), provider];
|
|
118
|
+
}
|
|
119
|
+
}, {
|
|
120
|
+
key: "registerProvider",
|
|
121
|
+
value: function registerProvider(selector, provider) {
|
|
122
|
+
return Languages.registerRenameProvider(this._client.protocol2CodeConverter.asDocumentSelector(selector), provider);
|
|
123
|
+
}
|
|
124
|
+
}, {
|
|
125
|
+
key: "isDefaultBehavior",
|
|
126
|
+
value: function isDefaultBehavior(value) {
|
|
127
|
+
var candidate = value;
|
|
128
|
+
return candidate && Is.boolean(candidate.defaultBehavior);
|
|
129
|
+
}
|
|
130
|
+
}]);
|
|
131
|
+
return RenameFeature;
|
|
132
|
+
}(TextDocumentLanguageFeature);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ClientCapabilities, CancellationToken, ServerCapabilities, DocumentSelector, SelectionRangeOptions, SelectionRangeRegistrationOptions } from '@difizen/vscode-languageserver-protocol';
|
|
2
|
+
import type { Disposable, TextDocument, ProviderResult, Position as VPosition, SelectionRange as VSelectionRange, SelectionRangeProvider } from 'vscode';
|
|
3
|
+
import type { FeatureClient } from './features.js';
|
|
4
|
+
import { TextDocumentLanguageFeature } from './features.js';
|
|
5
|
+
export interface ProvideSelectionRangeSignature {
|
|
6
|
+
(this: void, document: TextDocument, positions: readonly VPosition[], token: CancellationToken): ProviderResult<VSelectionRange[]>;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectionRangeProviderMiddleware {
|
|
9
|
+
provideSelectionRanges?: (this: void, document: TextDocument, positions: readonly VPosition[], token: CancellationToken, next: ProvideSelectionRangeSignature) => ProviderResult<VSelectionRange[]>;
|
|
10
|
+
}
|
|
11
|
+
export declare class SelectionRangeFeature extends TextDocumentLanguageFeature<boolean | SelectionRangeOptions, SelectionRangeRegistrationOptions, SelectionRangeProvider, SelectionRangeProviderMiddleware> {
|
|
12
|
+
constructor(client: FeatureClient<SelectionRangeProviderMiddleware>);
|
|
13
|
+
fillClientCapabilities(capabilities: ClientCapabilities): void;
|
|
14
|
+
initialize(capabilities: ServerCapabilities, documentSelector: DocumentSelector): void;
|
|
15
|
+
protected registerLanguageProvider(options: SelectionRangeRegistrationOptions): [Disposable, SelectionRangeProvider];
|
|
16
|
+
private registerProvider;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=selectionRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"selectionRange.d.ts","sourceRoot":"","sources":["../../src/common/selectionRange.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EACV,kBAAkB,EAClB,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAEhB,qBAAqB,EACrB,iCAAiC,EAClC,MAAM,yCAAyC,CAAC;AAEjD,OAAO,KAAK,EACV,UAAU,EACV,YAAY,EACZ,cAAc,EACd,QAAQ,IAAI,SAAS,EACrB,cAAc,IAAI,eAAe,EACjC,sBAAsB,EACvB,MAAM,QAAQ,CAAC;AAEhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAU,MAAM,eAAe,CAAC;AAGpE,MAAM,WAAW,8BAA8B;IAC7C,CACE,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,SAAS,EAAE,EAC/B,KAAK,EAAE,iBAAiB,GACvB,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,gCAAgC;IAC/C,sBAAsB,CAAC,EAAE,CACvB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,YAAY,EACtB,SAAS,EAAE,SAAS,SAAS,EAAE,EAC/B,KAAK,EAAE,iBAAiB,EACxB,IAAI,EAAE,8BAA8B,KACjC,cAAc,CAAC,eAAe,EAAE,CAAC,CAAC;CACxC;AAED,qBAAa,qBAAsB,SAAQ,2BAA2B,CACpE,OAAO,GAAG,qBAAqB,EAC/B,iCAAiC,EACjC,sBAAsB,EACtB,gCAAgC,CACjC;gBACa,MAAM,EAAE,aAAa,CAAC,gCAAgC,CAAC;IAI5D,sBAAsB,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI;IAK9D,UAAU,CACf,YAAY,EAAE,kBAAkB,EAChC,gBAAgB,EAAE,gBAAgB,GACjC,IAAI;IAWP,SAAS,CAAC,wBAAwB,CAChC,OAAO,EAAE,iCAAiC,GACzC,CAAC,UAAU,EAAE,sBAAsB,CAAC;IAgDvC,OAAO,CAAC,gBAAgB;CASzB"}
|