massive update, probably broken
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-json / node_modules / vscode-languageserver / lib / common / workspaceFolders.js
diff --git a/.config/coc/extensions/node_modules/coc-json/node_modules/vscode-languageserver/lib/common/workspaceFolders.js b/.config/coc/extensions/node_modules/coc-json/node_modules/vscode-languageserver/lib/common/workspaceFolders.js
new file mode 100644 (file)
index 0000000..fe50a10
--- /dev/null
@@ -0,0 +1,35 @@
+/* --------------------------------------------------------------------------------------------
+ * Copyright (c) Microsoft Corporation. All rights reserved.
+ * Licensed under the MIT License. See License.txt in the project root for license information.
+ * ------------------------------------------------------------------------------------------ */
+'use strict';
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.WorkspaceFoldersFeature = void 0;
+const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
+const WorkspaceFoldersFeature = (Base) => {
+    return class extends Base {
+        initialize(capabilities) {
+            let workspaceCapabilities = capabilities.workspace;
+            if (workspaceCapabilities && workspaceCapabilities.workspaceFolders) {
+                this._onDidChangeWorkspaceFolders = new vscode_languageserver_protocol_1.Emitter();
+                this.connection.onNotification(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type, (params) => {
+                    this._onDidChangeWorkspaceFolders.fire(params.event);
+                });
+            }
+        }
+        getWorkspaceFolders() {
+            return this.connection.sendRequest(vscode_languageserver_protocol_1.WorkspaceFoldersRequest.type);
+        }
+        get onDidChangeWorkspaceFolders() {
+            if (!this._onDidChangeWorkspaceFolders) {
+                throw new Error('Client doesn\'t support sending workspace folder change events.');
+            }
+            if (!this._unregistration) {
+                this._unregistration = this.connection.client.register(vscode_languageserver_protocol_1.DidChangeWorkspaceFoldersNotification.type);
+            }
+            return this._onDidChangeWorkspaceFolders.event;
+        }
+    };
+};
+exports.WorkspaceFoldersFeature = WorkspaceFoldersFeature;
+//# sourceMappingURL=workspaceFolders.js.map
\ No newline at end of file