4
A
回答
0
現在看來,這是不正式支持:https://github.com/Microsoft/vscode/issues/10077
無論如何,我發現這個代碼和平,不知道有多好,它是:
function startedInDebugMode() {
let args = process.execArgv;
if (args) {
return args.some((arg) => /^--debug=?/.test(arg) || /^--debug-brk=?/.test(arg));
}
return false;
}
0
現在這是officially支持:
https://github.com/Microsoft/vscode/blob/master/src/vs/vscode.d.ts#L6431
export namespace debug {
/**
* The currently active [debug session](#DebugSession) or `undefined`. The active debug session is the one
* represented by the debug action floating window or the one currently shown in the drop down menu of the debug action floating window.
* If no debug session is active, the value is `undefined`.
*/
export let activeDebugSession: DebugSession | undefined;
/**
* The currently active [debug console](#DebugConsole).
*/
export let activeDebugConsole: DebugConsole;
/**
* List of breakpoints.
*/
export let breakpoints: Breakpoint[];
/**
* An [event](#Event) which fires when the [active debug session](#debug.activeDebugSession)
* has changed. *Note* that the event also fires when the active debug session changes
* to `undefined`.
*/
export const onDidChangeActiveDebugSession: Event<DebugSession | undefined>;
/**
* An [event](#Event) which fires when a new [debug session](#DebugSession) has been started.
*/
export const onDidStartDebugSession: Event<DebugSession>;
/**
* An [event](#Event) which fires when a custom DAP event is received from the [debug session](#DebugSession).
*/
export const onDidReceiveDebugSessionCustomEvent: Event<DebugSessionCustomEvent>;
/**
* An [event](#Event) which fires when a [debug session](#DebugSession) has terminated.
*/
export const onDidTerminateDebugSession: Event<DebugSession>;
/**
* An [event](#Event) that is emitted when the set of breakpoints is added, removed, or changed.
*/
export const onDidChangeBreakpoints: Event<BreakpointsChangeEvent>;
/**
* Register a [debug configuration provider](#DebugConfigurationProvider) for a specifc debug type.
* More than one provider can be registered for the same type.
*
* @param type The debug type for which the provider is registered.
* @param provider The [debug configuration provider](#DebugConfigurationProvider) to register.
* @return A [disposable](#Disposable) that unregisters this provider when being disposed.
*/
export function registerDebugConfigurationProvider(debugType: string, provider: DebugConfigurationProvider): Disposable;
/**
* Start debugging by using either a named launch or named compound configuration,
* or by directly passing a [DebugConfiguration](#DebugConfiguration).
* The named configurations are looked up in '.vscode/launch.json' found in the given folder.
* Before debugging starts, all unsaved files are saved and the launch configurations are brought up-to-date.
* Folder specific variables used in the configuration (e.g. '${workspaceFolder}') are resolved against the given folder.
* @param folder The [workspace folder](#WorkspaceFolder) for looking up named configurations and resolving variables or `undefined` for a non-folder setup.
* @param nameOrConfiguration Either the name of a debug or compound configuration or a [DebugConfiguration](#DebugConfiguration) object.
* @return A thenable that resolves when debugging could be successfully started.
*/
export function startDebugging(folder: WorkspaceFolder | undefined, nameOrConfiguration: string | DebugConfiguration): Thenable<boolean>;
/**
* Add breakpoints.
* @param breakpoints The breakpoints to add.
*/
export function addBreakpoints(breakpoints: Breakpoint[]): void;
/**
* Remove breakpoints.
* @param breakpoints The breakpoints to remove.
*/
export function removeBreakpoints(breakpoints: Breakpoint[]): void;
}
相關問題
- 1. 在vscode擴展
- 2. Sagepay magento擴展。測試模式
- 3. VSCode擴展 - 使用F5調試,複製到擴展文件夾後失敗
- 4. 如何調試已安裝的VSCode擴展?
- 5. 發佈VSCode擴展時檢測圖標出錯
- 6. vscode一飲而盡/咕嚕腳本運行vscode鉻調試器擴展
- 7. VSCode的Python語言擴展
- 8. Geb Reporter /擴展檢索測試狀態
- 9. 檢測leiningen測試模式
- 10. Chrome擴展測試
- 11. 測試擴展AbstractPdfView
- 12. 測試Swift擴展
- 13. 如何從擴展背景中檢測隱身模式
- 14. 什麼按鍵vscode擴展
- 15. 無法安裝vscode擴展
- 16. 出版vscode擴展失敗
- 17. 擴展如何擴展VSCode中的配置變量?
- 18. 在調試Chrome擴展時檢查chrome.storage.sync
- 19. 如何檢測調試擴展選項卡?
- 20. 如何在調試Firefox擴展時檢測語法錯誤
- 21. 如何使用.Net Core和VSCode在調試模式下執行測試?
- 22. 調試Chrome擴展
- 23. 調試Firefox擴展
- 24. Python擴展調試
- 25. 調試Firefox擴展
- 26. 如何在vscode中配置eslint擴展?
- 27. 在VSCode擴展中使用JavaScript DOMD
- 28. 調試Chrome擴展的popup.html?
- 29. 擴展中的Chrome擴展檢測按鈕
- 30. 如何檢測WPF中的TreeNode擴展?