Skip to content

Commit ab7bd14

Browse files
author
Kartik Raj
committed
Explicitly type it to be safe
1 parent f20485b commit ab7bd14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/client/proposedApi.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import {
3232
reportActiveInterpreterChangedDeprecated,
3333
reportInterpretersChanged,
3434
} from './deprecatedProposedApi';
35+
import { DeprecatedProposedAPI } from './deprecatedProposedApiTypes';
3536

3637
type ActiveEnvironmentChangeEvent = {
3738
resource: WorkspaceFolder | undefined;
@@ -157,12 +158,12 @@ export function buildProposedApi(
157158
try {
158159
deprecatedProposedApi = { ...buildDeprecatedProposedApi(discoveryApi, serviceContainer) };
159160
} catch (ex) {
160-
deprecatedProposedApi = {};
161+
deprecatedProposedApi = {} as DeprecatedProposedAPI;
161162
// Errors out only in case of testing.
162163
// Also, these APIs no longer supported, no need to log error.
163164
}
164165

165-
const proposed: ProposedExtensionAPI = {
166+
const proposed: ProposedExtensionAPI & DeprecatedProposedAPI = {
166167
...deprecatedProposedApi,
167168
environments: {
168169
getActiveEnvironmentPath(resource?: Resource) {

0 commit comments

Comments
 (0)