1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | Object.defineProperty(exports, "__esModule", { value: true });
|
7 | exports.ConfigurationFeature = void 0;
|
8 | const vscode_languageserver_protocol_1 = require("vscode-languageserver-protocol");
|
9 | const Is = require("./utils/is");
|
10 | const ConfigurationFeature = (Base) => {
|
11 | return class extends Base {
|
12 | getConfiguration(arg) {
|
13 | if (!arg) {
|
14 | return this._getConfiguration({});
|
15 | }
|
16 | else if (Is.string(arg)) {
|
17 | return this._getConfiguration({ section: arg });
|
18 | }
|
19 | else {
|
20 | return this._getConfiguration(arg);
|
21 | }
|
22 | }
|
23 | _getConfiguration(arg) {
|
24 | let params = {
|
25 | items: Array.isArray(arg) ? arg : [arg]
|
26 | };
|
27 | return this.connection.sendRequest(vscode_languageserver_protocol_1.ConfigurationRequest.type, params).then((result) => {
|
28 | if (Array.isArray(result)) {
|
29 | return Array.isArray(arg) ? result : result[0];
|
30 | }
|
31 | else {
|
32 | return Array.isArray(arg) ? [] : null;
|
33 | }
|
34 | });
|
35 | }
|
36 | };
|
37 | };
|
38 | exports.ConfigurationFeature = ConfigurationFeature;
|