Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
clean up handling of legacy useApiV1 per feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
jhendrixMSFT committed Mar 29, 2019
1 parent ed7e86d commit fd242dd
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/goDebugConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
});

const dlvConfig: { [key: string]: any } = goConfig.get('delveConfig');
if (!debugConfiguration.hasOwnProperty('useApiV1') && dlvConfig.hasOwnProperty('useApiV1')) {
if (typeof dlvConfig['useApiV1'] === 'boolean' && dlvConfig['useApiV1'] === true) {
debugConfiguration['apiVersion'] = 1;
}
let useApiV1 = false;
if (debugConfiguration.hasOwnProperty('useApiV1')) {
useApiV1 = debugConfiguration['useApiV1'] === true;
} else if (dlvConfig.hasOwnProperty('useApiV1')) {
useApiV1 = dlvConfig['useApiV1'] === true;
}
if (useApiV1) {
debugConfiguration['apiVersion'] = 1;
}
if (!debugConfiguration.hasOwnProperty('apiVersion') && dlvConfig.hasOwnProperty('apiVersion')) {
debugConfiguration['apiVersion'] = dlvConfig['apiVersion'];
Expand Down

0 comments on commit fd242dd

Please sign in to comment.