UNPKG

1.91 kBJavaScriptView Raw
1/* --------------------------------------------------------------------------------------------
2 * Copyright (c) Microsoft Corporation. All rights reserved.
3 * Licensed under the MIT License. See License.txt in the project root for license information.
4 * ------------------------------------------------------------------------------------------ */
5'use strict';
6Object.defineProperty(exports, "__esModule", { value: true });
7exports.TypeHierarchyFeature = void 0;
8const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
9const TypeHierarchyFeature = (Base) => {
10 return class extends Base {
11 get typeHierarchy() {
12 return {
13 onPrepare: (handler) => {
14 return this.connection.onRequest(vscode_languageserver_protocol_1.TypeHierarchyPrepareRequest.type, (params, cancel) => {
15 return handler(params, cancel, this.attachWorkDoneProgress(params), undefined);
16 });
17 },
18 onSupertypes: (handler) => {
19 const type = vscode_languageserver_protocol_1.TypeHierarchySupertypesRequest.type;
20 return this.connection.onRequest(type, (params, cancel) => {
21 return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
22 });
23 },
24 onSubtypes: (handler) => {
25 const type = vscode_languageserver_protocol_1.TypeHierarchySubtypesRequest.type;
26 return this.connection.onRequest(type, (params, cancel) => {
27 return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
28 });
29 }
30 };
31 }
32 };
33};
34exports.TypeHierarchyFeature = TypeHierarchyFeature;