UNPKG

1.32 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.FoldingRangeFeature = void 0;
8const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
9const FoldingRangeFeature = (Base) => {
10 return class extends Base {
11 get foldingRange() {
12 return {
13 refresh: () => {
14 return this.connection.sendRequest(vscode_languageserver_protocol_1.FoldingRangeRefreshRequest.type);
15 },
16 on: (handler) => {
17 const type = vscode_languageserver_protocol_1.FoldingRangeRequest.type;
18 return this.connection.onRequest(type, (params, cancel) => {
19 return handler(params, cancel, this.attachWorkDoneProgress(params), this.attachPartialResultProgress(type, params));
20 });
21 }
22 };
23 }
24 };
25};
26exports.FoldingRangeFeature = FoldingRangeFeature;