Skip to content

Commit f60fba0

Browse files
committed
make providers the same
1 parent d1cd07f commit f60fba0

File tree

2 files changed

+22
-23
lines changed

2 files changed

+22
-23
lines changed

src/providers/moduleCalls.ts

+20-21
Original file line numberDiff line numberDiff line change
@@ -135,32 +135,31 @@ export class ModuleCallsDataProvider implements vscode.TreeDataProvider<ModuleCa
135135
if (handler === undefined) {
136136
return [];
137137
}
138+
await handler.onReady();
138139

139-
return await handler.onReady().then(async () => {
140-
const moduleCallsSupported = this.handler.clientSupportsCommand(`terraform-ls.module.calls`);
141-
if (!moduleCallsSupported) {
142-
return Promise.resolve([]);
143-
}
140+
const commandSupported = this.handler.clientSupportsCommand(`terraform-ls.module.calls`);
141+
if (!commandSupported) {
142+
return Promise.resolve([]);
143+
}
144144

145-
const params: ExecuteCommandParams = {
146-
command: `terraform-ls.module.calls`,
147-
arguments: [`uri=${documentURI}`],
148-
};
145+
const params: ExecuteCommandParams = {
146+
command: `terraform-ls.module.calls`,
147+
arguments: [`uri=${documentURI}`],
148+
};
149149

150-
const response = await handler.sendRequest<ExecuteCommandParams, ModuleCallsResponse, void>(
151-
ExecuteCommandRequest.type,
152-
params,
153-
);
154-
if (response === null) {
155-
return Promise.resolve([]);
156-
}
150+
const response = await handler.sendRequest<ExecuteCommandParams, ModuleCallsResponse, void>(
151+
ExecuteCommandRequest.type,
152+
params,
153+
);
154+
if (response === null) {
155+
return Promise.resolve([]);
156+
}
157157

158-
const list = response.module_calls.map((m) =>
159-
this.toModuleCall(m.name, m.source_addr, m.version, m.source_type, m.docs_link, this.svg, m.dependent_modules),
160-
);
158+
const list = response.module_calls.map((m) =>
159+
this.toModuleCall(m.name, m.source_addr, m.version, m.source_type, m.docs_link, this.svg, m.dependent_modules),
160+
);
161161

162-
return list;
163-
});
162+
return list;
164163
}
165164

166165
toModuleCall(

src/providers/moduleProviders.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ export class ModuleProvidersDataProvider implements vscode.TreeDataProvider<Modu
102102
}
103103
await handler.onReady();
104104

105-
const moduleCallsSupported = this.handler.clientSupportsCommand(`terraform-ls.module.providers`);
106-
if (!moduleCallsSupported) {
105+
const commandSupported = this.handler.clientSupportsCommand(`terraform-ls.module.providers`);
106+
if (!commandSupported) {
107107
return [];
108108
}
109109

0 commit comments

Comments
 (0)