MCPcopy Create free account
hub / github.com/microsoft/vscode-languageserver-node / ConfigurationFeature

Function ConfigurationFeature

server/src/configuration.ts:22–44  ·  view source on GitHub ↗
(Base)

Source from the content-addressed store, hash-verified

20}
21
22export const ConfigurationFeature: Feature<_RemoteWorkspace, Configuration> = (Base) => {
23 return class extends Base {
24
25 getConfiguration(arg?: string | ConfigurationItem | ConfigurationItem[]): Thenable<any> {
26 if (!arg) {
27 return this._getConfiguration({});
28 } else if (Is.string(arg)) {
29 return this._getConfiguration({ section: arg })
30 } else {
31 return this._getConfiguration(arg);
32 }
33 }
34
35 private _getConfiguration(arg: ConfigurationItem | ConfigurationItem[]): Thenable<any> {
36 let params: ConfigurationParams = {
37 items: Array.isArray(arg) ? arg : [arg]
38 };
39 return this.connection.sendRequest(ConfigurationRequest.type, params).then((result) => {
40 return Array.isArray(arg) ? result : result[0];
41 });
42 }
43 }
44}

Callers 1

main.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected