UNPKG

2.08 kBJavaScriptView Raw
1"use strict";
2/* --------------------------------------------------------------------------------------------
3 * Copyright (c) Microsoft Corporation. All rights reserved.
4 * Licensed under the MIT License. See License.txt in the project root for license information.
5 * ------------------------------------------------------------------------------------------ */
6Object.defineProperty(exports, "__esModule", { value: true });
7exports.FileOperationsFeature = void 0;
8const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
9const FileOperationsFeature = (Base) => {
10 return class extends Base {
11 onDidCreateFiles(handler) {
12 return this.connection.onNotification(vscode_languageserver_protocol_1.DidCreateFilesNotification.type, (params) => {
13 handler(params);
14 });
15 }
16 onDidRenameFiles(handler) {
17 return this.connection.onNotification(vscode_languageserver_protocol_1.DidRenameFilesNotification.type, (params) => {
18 handler(params);
19 });
20 }
21 onDidDeleteFiles(handler) {
22 return this.connection.onNotification(vscode_languageserver_protocol_1.DidDeleteFilesNotification.type, (params) => {
23 handler(params);
24 });
25 }
26 onWillCreateFiles(handler) {
27 return this.connection.onRequest(vscode_languageserver_protocol_1.WillCreateFilesRequest.type, (params, cancel) => {
28 return handler(params, cancel);
29 });
30 }
31 onWillRenameFiles(handler) {
32 return this.connection.onRequest(vscode_languageserver_protocol_1.WillRenameFilesRequest.type, (params, cancel) => {
33 return handler(params, cancel);
34 });
35 }
36 onWillDeleteFiles(handler) {
37 return this.connection.onRequest(vscode_languageserver_protocol_1.WillDeleteFilesRequest.type, (params, cancel) => {
38 return handler(params, cancel);
39 });
40 }
41 };
42};
43exports.FileOperationsFeature = FileOperationsFeature;