How to use @theia/debug - 4 common examples

To help you get started, we’ve selected a few @theia/debug examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github eclipse-theia / theia / packages / plugin-ext / src / main / browser / menus / menus-contribution-handler.ts View on Github external
}
            } else if (location === 'scm/resourceGroup/context') {
                for (const menu of allMenus[location]) {
                    const inline = menu.group && /^inline/.test(menu.group) || false;
                    const menuPath = inline ? ScmWidget.RESOURCE_GROUP_INLINE_MENU : ScmWidget.RESOURCE_GROUP_CONTEXT_MENU;
                    toDispose.push(this.registerScmMenuAction(menuPath, menu));
                }
            } else if (location === 'scm/resourceState/context') {
                for (const menu of allMenus[location]) {
                    const inline = menu.group && /^inline/.test(menu.group) || false;
                    const menuPath = inline ? ScmWidget.RESOURCE_INLINE_MENU : ScmWidget.RESOURCE_CONTEXT_MENU;
                    toDispose.push(this.registerScmMenuAction(menuPath, menu));
                }
            } else if (location === 'debug/callstack/context') {
                for (const menu of allMenus[location]) {
                    for (const menuPath of [DebugStackFramesWidget.CONTEXT_MENU, DebugThreadsWidget.CONTEXT_MENU]) {
                        toDispose.push(this.registerMenuAction(menuPath, menu, command => ({
                            execute: (...args) => this.commands.executeCommand(command, args[0]),
                            isEnabled: (...args) => this.commands.isEnabled(command, args[0]),
                            isVisible: (...args) => this.commands.isVisible(command, args[0])
                        })));
                    }
                }
            } else if (allMenus.hasOwnProperty(location)) {
                const menuPaths = MenusContributionPointHandler.parseMenuPaths(location);
                if (!menuPaths.length) {
                    this.logger.warn(`Plugin contributes items to a menu with invalid identifier: ${location}`);
                    continue;
                }
                const menus = allMenus[location];
                menus.forEach(menu => {
                    for (const menuPath of menuPaths) {
github eclipse-theia / theia / packages / plugin-ext / src / main / browser / view / plugin-view-registry.ts View on Github external
promises.push((async () => {
            const debug = await this.widgetManager.getWidget(DebugWidget.ID);
            if (debug instanceof DebugWidget) {
                const viewContainer = debug['sessionWidget']['viewContainer'];
                await this.prepareViewContainer('debug', viewContainer);
            }
        })().catch(console.error));
        await Promise.all(promises);
github eclipse-theia / theia / packages / plugin-ext / src / main / browser / debug / plugin-debug-session-factory.ts View on Github external
get(sessionId: string, options: DebugSessionOptions): DebugSession {
        const connection = new DebugSessionConnection(
            sessionId,
            this.connectionFactory,
            this.getTraceOutputChannel());

        return new PluginDebugSession(
            sessionId,
            options,
            connection,
            this.terminalService,
            this.editorManager,
            this.breakpoints,
            this.labelProvider,
            this.messages,
            this.fileSystem,
            this.terminalOptionsExt);
    }
github eclipse-theia / theia / packages / plugin-ext / src / main / browser / debug / debug-main.ts View on Github external
async $removeBreakpoints(breakpoints: Breakpoint[]): Promise {
        const ids = new Set();
        breakpoints.forEach(b => ids.add(b.id));
        for (const origin of this.breakpointsManager.findMarkers({ dataFilter: data => ids.has(data.id) })) {
            const breakpoint = new DebugBreakpoint(origin.data, this.labelProvider, this.breakpointsManager, this.editorManager, this.sessionManager.currentSession);
            breakpoint.remove();
        }
    }