vscode APIs
- workspace
- window
- ExtensionContext
- Uri
- commands
- Range
- Position
- TextDocument
- Disposable
- CancellationToken
- languages
- TextEditor
- EventEmitter
- ViewColumn
- QuickPickItem
- Event
- OutputChannel
- MarkdownString
- extensions
- ProviderResult
- env
- StatusBarItem
- StatusBarAlignment
- WorkspaceConfiguration
- Location
- TreeItemCollapsibleState
- TreeItem
- Selection
- CompletionItem
- WorkspaceFolder
- TreeDataProvider
- TextEdit
- CompletionItemKind
- Command
- Hover
- WorkspaceEdit
- WebviewPanel
- Diagnostic
- DiagnosticSeverity
- ConfigurationTarget
- ProgressLocation
- ThemeColor
- TextEditorDecorationType
- TextDocumentChangeEvent
- CodeActionProvider
- HoverProvider
- ThemeIcon
- SnippetString
- CompletionList
- DecorationOptions
- RelativePattern
- DiagnosticCollection
- CompletionContext
- CompletionItemProvider
- CodeAction
- CodeActionKind
- InputBoxOptions
- ColorThemeKind
- ConfigurationChangeEvent
- FileSystemWatcher
- TextEditorEdit
- TextDocumentContentChangeEvent
- Extension
- CodeActionContext
- FileStat
- QuickPickOptions
- DocumentSymbol
- SymbolKind
- QuickInputButton
- Webview
- IndentAction
- debug
- FileSystemError
- TreeView
- TextEditorRevealType
- FileSystemProvider
- FileChangeEvent
- Memento
- Definition
- FormattingOptions
- DocumentFilter
- DecorationRenderOptions
- QuickPick
- WebviewView
- WebviewViewProvider
- DocumentHighlight
- DebugConfiguration
- Terminal
- FileType
- TextDocumentWillSaveEvent
- FileChangeType
- OpenDialogOptions
- DocumentSelector
- DefinitionProvider
- LocationLink
- TextDocumentShowOptions
- DecorationRangeBehavior
- OverviewRulerLane
- SignatureHelp
- SemanticTokens
- Progress
- DocumentFormattingEditProvider
- SemanticTokensBuilder
- WebviewViewResolveContext
- CustomDocument
- DebugSession
- CodeLens
- CodeLensProvider
- WebviewOptions
- WebviewPanelOptions
- FileRenameEvent
- TextDocumentSaveReason
- CancellationTokenSource
- CustomTextEditorProvider
- QuickPickItemKind
- DocumentLink
- DocumentHighlightKind
- FileDecoration
- FileDecorationProvider
- TextDocumentContentProvider
- GlobPattern
- FileDeleteEvent
- SaveDialogOptions
- SignatureInformation
- CompletionItemTag
- FileCreateEvent
- ReferenceContext
- SemanticTokensLegend
- TreeViewVisibilityChangeEvent
- QuickInput
- QuickInputButtons
- CustomReadonlyEditorProvider
- DiagnosticRelatedInformation
- DebugConfigurationProvider
- DebugAdapterExecutable
- DebugAdapterDescriptor
- DebugAdapterDescriptorFactory
- DebugAdapterServer
- FileSearchOptions
- FileSearchProvider
- FileSearchQuery
- TextSearchComplete
- TextSearchOptions
- TextSearchProvider
- TextSearchQuery
- TextSearchResult
- EndOfLine
- FileWillRenameEvent
- FoldingRangeKind
- MessageItem
- TextEditorVisibleRangesChangeEvent
- ColorTheme
- CustomEditorProvider
- CustomDocumentBackupContext
- CustomDocumentBackup
- CustomDocumentOpenContext
- CustomDocumentContentChangeEvent
- SymbolInformation
- DecorationInstanceRenderOptions
- DefinitionLink
- DocumentLinkProvider
- TerminalOptions
- CodeActionProviderMetadata
- MarkedString
- tasks
- Task
- TaskDefinition
- ShellExecution
- TaskGroup
- DocumentRangeFormattingEditProvider
- TaskScope
- TextEditorSelectionChangeKind
- RenameProvider
- TextLine
- WorkspaceFoldersChangeEvent
- TreeItemLabel
Other Related APIs
- vscode#window
- vscode#Uri
- vscode#ExtensionContext
- vscode#commands
- vscode#WorkspaceFolder
- vscode#DebugConfigurationProvider
- vscode#DebugConfiguration
- vscode#debug
- vscode#DebugSession
- vscode#DebugAdapterExecutable
- vscode#DebugAdapterDescriptor
- vscode#DebugAdapterServer
- vscode-languageclient#ExecutableOptions
vscode#DebugAdapterDescriptorFactory TypeScript Examples
The following examples show how to use
vscode#DebugAdapterDescriptorFactory.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: config-provider.ts From plugin-vscode with Apache License 2.0 | 5 votes |
class BallerinaDebugAdapterDescriptorFactory implements DebugAdapterDescriptorFactory {
private ballerinaExtInstance: BallerinaExtension;
constructor(ballerinaExtInstance: BallerinaExtension) {
this.ballerinaExtInstance = ballerinaExtInstance;
}
createDebugAdapterDescriptor(session: DebugSession, executable: DebugAdapterExecutable | undefined): Thenable<DebugAdapterDescriptor> {
const port = session.configuration.debugServer;
const cwd = this.getCurrentWorkingDir();
let args: string[] = [];
const cmd = this.getScriptPath(args);
if (ballerinaExtInstance.is12x) {
const SHOW_VSCODE_IDE_DOCS = "https://ballerina.io/1.2/learn/setting-up-visual-studio-code/run-and-debug/";
const showDetails: string = 'Learn More';
window.showWarningMessage("Ballerina Debugging is an experimental feature. Click \"Learn more\" for known limitations and workarounds.",
showDetails).then((selection) => {
if (showDetails === selection) {
commands.executeCommand('vscode.open', Uri.parse(SHOW_VSCODE_IDE_DOCS));
}
});
}
args.push(port.toString());
let opt: ExecutableOptions = { cwd: cwd };
opt.env = Object.assign({}, process.env);
const serverProcess = child_process.spawn(cmd, args, opt);
log(`Starting debug adapter: '${this.ballerinaExtInstance.getBallerinaCmd()} start-debugger-adapter ${port.toString()}`);
return new Promise<void>((resolve) => {
serverProcess.stdout.on('data', (data) => {
if (data.toString().includes('Debug server started')) {
resolve();
}
log(`${data}`);
});
serverProcess.stderr.on('data', (data) => {
debugLog(`${data}`);
});
}).then(() => {
sendTelemetryEvent(ballerinaExtInstance, TM_EVENT_START_DEBUG_SESSION, CMP_DEBUGGER);
return new DebugAdapterServer(port);
}).catch((error) => {
sendTelemetryException(ballerinaExtInstance, error, CMP_DEBUGGER);
return Promise.reject(error);
});
}
getScriptPath(args: string[]): string {
let cmd = this.ballerinaExtInstance.getBallerinaCmd();
args.push('start-debugger-adapter');
return cmd;
}
getCurrentWorkingDir(): string {
return path.join(this.ballerinaExtInstance.ballerinaHome, "bin");
}
}