mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Add debug config option to azdata extension (#11999)
This commit is contained in:
@@ -12,6 +12,7 @@ import { HttpClient } from './common/httpClient';
|
||||
import Logger from './common/logger';
|
||||
import { getErrorMessage, searchForCmd } from './common/utils';
|
||||
import * as loc from './localizedConstants';
|
||||
import { azdataConfigSection, debugConfigKey } from './constants';
|
||||
|
||||
export const azdataHostname = 'https://aka.ms';
|
||||
export const azdataUri = 'azdata-msi';
|
||||
@@ -118,6 +119,10 @@ export class AzdataTool implements IAzdataTool {
|
||||
}
|
||||
|
||||
public async executeCommand<R>(args: string[], additionalEnvVars?: { [key: string]: string }): Promise<azdataExt.AzdataOutput<R>> {
|
||||
const debug = vscode.workspace.getConfiguration(azdataConfigSection).get(debugConfigKey);
|
||||
if (debug) {
|
||||
args.push('--debug');
|
||||
}
|
||||
try {
|
||||
const output = JSON.parse((await executeCommand(`"${this.path}"`, args.concat(['--output', 'json']), additionalEnvVars)).stdout);
|
||||
return {
|
||||
|
||||
8
extensions/azdata/src/constants.ts
Normal file
8
extensions/azdata/src/constants.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
export const azdataConfigSection = 'azdata';
|
||||
|
||||
export const debugConfigKey = 'logDebugInfo';
|
||||
Reference in New Issue
Block a user