Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename debugger uiMessages to strings, and document in package.json #161326

Merged
merged 1 commit into from Sep 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -15,7 +15,7 @@ import { IModelDecorationOptions, TrackedRangeStickiness, ITextModel, OverviewRu
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
import { IContextKeyService, IContextKey } from 'vs/platform/contextkey/common/contextkey';
import { IContextMenuService } from 'vs/platform/contextview/browser/contextView';
import { IDebugService, IBreakpoint, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, BreakpointWidgetContext, IBreakpointEditorContribution, IBreakpointUpdateData, IDebugConfiguration, State, IDebugSession, DebuggerUiMessage } from 'vs/workbench/contrib/debug/common/debug';
import { IDebugService, IBreakpoint, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, BreakpointWidgetContext, IBreakpointEditorContribution, IBreakpointUpdateData, IDebugConfiguration, State, IDebugSession, DebuggerString } from 'vs/workbench/contrib/debug/common/debug';
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { BreakpointWidget } from 'vs/workbench/contrib/debug/browser/breakpointWidget';
import { IDisposable, dispose, disposeIfDisposable } from 'vs/base/common/lifecycle';
Expand Down Expand Up @@ -86,7 +86,7 @@ function getBreakpointDecorationOptions(accessor: ServicesAccessor, model: IText
let langId: string | undefined;
unverifiedMessage = debugService.getModel().getSessions().map(s => {
const dbg = debugService.getAdapterManager().getDebugger(s.configuration.type);
const message = dbg?.uiMessages?.[DebuggerUiMessage.UnverifiedBreakpoints];
const message = dbg?.strings?.[DebuggerString.UnverifiedBreakpoints];
if (message) {
if (!langId) {
// Lazily compute this, only if needed for some debug adapter
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/debug/browser/breakpointsView.ts
Expand Up @@ -45,7 +45,7 @@ import { IEditorPane } from 'vs/workbench/common/editor';
import { IViewDescriptorService } from 'vs/workbench/common/views';
import * as icons from 'vs/workbench/contrib/debug/browser/debugIcons';
import { DisassemblyView } from 'vs/workbench/contrib/debug/browser/disassemblyView';
import { BREAKPOINTS_VIEW_ID, BREAKPOINT_EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_BREAKPOINT_INPUT_FOCUSED, CONTEXT_BREAKPOINT_ITEM_TYPE, CONTEXT_BREAKPOINT_SUPPORTS_CONDITION, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_IN_DEBUG_MODE, DebuggerUiMessage, DEBUG_SCHEME, IBaseBreakpoint, IBreakpoint, IBreakpointEditorContribution, IDataBreakpoint, IDebugModel, IDebugService, IEnablement, IExceptionBreakpoint, IFunctionBreakpoint, IInstructionBreakpoint, State } from 'vs/workbench/contrib/debug/common/debug';
import { BREAKPOINTS_VIEW_ID, BREAKPOINT_EDITOR_CONTRIBUTION_ID, CONTEXT_BREAKPOINTS_EXIST, CONTEXT_BREAKPOINTS_FOCUSED, CONTEXT_BREAKPOINT_INPUT_FOCUSED, CONTEXT_BREAKPOINT_ITEM_TYPE, CONTEXT_BREAKPOINT_SUPPORTS_CONDITION, CONTEXT_DEBUGGERS_AVAILABLE, CONTEXT_IN_DEBUG_MODE, DebuggerString, DEBUG_SCHEME, IBaseBreakpoint, IBreakpoint, IBreakpointEditorContribution, IDataBreakpoint, IDebugModel, IDebugService, IEnablement, IExceptionBreakpoint, IFunctionBreakpoint, IInstructionBreakpoint, State } from 'vs/workbench/contrib/debug/common/debug';
import { Breakpoint, DataBreakpoint, ExceptionBreakpoint, FunctionBreakpoint, InstructionBreakpoint } from 'vs/workbench/contrib/debug/common/debugModel';
import { DisassemblyViewInput } from 'vs/workbench/contrib/debug/common/disassemblyViewInput';
import { ACTIVE_GROUP, IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
Expand Down Expand Up @@ -284,7 +284,7 @@ export class BreakpointsView extends ViewPane {

const currentType = this.debugService.getViewModel().focusedSession?.configuration.type;
const dbg = currentType ? this.debugService.getAdapterManager().getDebugger(currentType) : undefined;
const message = dbg?.uiMessages && dbg.uiMessages[DebuggerUiMessage.UnverifiedBreakpoints];
const message = dbg?.strings?.[DebuggerString.UnverifiedBreakpoints];
const debuggerHasUnverifiedBps = message && this.debugService.getModel().getBreakpoints().filter(bp => {
if (bp.verified || !bp.enabled) {
return false;
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/debug/common/debug.ts
Expand Up @@ -163,7 +163,7 @@ export interface IDebugger {
export interface IDebuggerMetadata {
label: string;
type: string;
uiMessages?: { [key in DebuggerUiMessage]: string };
strings?: { [key in DebuggerString]: string };
interestedInLanguage(languageId: string): boolean;
}

Expand Down Expand Up @@ -786,7 +786,7 @@ export interface IDebuggerContribution extends IPlatformSpecificAdapterContribut
variables?: { [key: string]: string };
when?: string;
deprecated?: string;
uiMessages?: { [key in DebuggerUiMessage]: string };
strings?: { [key in DebuggerString]: string };
}

export interface IBreakpointContribution {
Expand Down Expand Up @@ -862,7 +862,7 @@ export interface IConfigurationManager {
resolveConfigurationByProviders(folderUri: uri | undefined, type: string | undefined, debugConfiguration: any, token: CancellationToken): Promise<any>;
}

export enum DebuggerUiMessage {
export enum DebuggerString {
UnverifiedBreakpoints = 'unverifiedBreakpoints'
}

Expand Down
10 changes: 10 additions & 0 deletions src/vs/workbench/contrib/debug/common/debugSchemas.ts
Expand Up @@ -106,6 +106,16 @@ export const debuggersExtPoint = extensionsRegistry.ExtensionsRegistry.registerE
type: 'string'
}
}
},
strings: {
description: nls.localize('vscode.extension.contributes.debuggers.strings', "UI strings contributed by this debug adapter."),
type: 'object',
properties: {
unverifiedBreakpoints: {
description: nls.localize('vscode.extension.contributes.debuggers.strings.unverifiedBreakpoints', "When there are unverified breakpoints in a language supported by this debug adapter, this message will appear on the breakpoint hover and in the breakpoints view. Markdown and command links are supported."),
type: 'string'
}
}
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/vs/workbench/contrib/debug/common/debugger.ts
Expand Up @@ -147,8 +147,8 @@ export class Debugger implements IDebugger, IDebuggerMetadata {
return !this.debuggerWhen || this.contextKeyService.contextMatchesRules(this.debuggerWhen);
}

get uiMessages() {
return this.debuggerContribution.uiMessages;
get strings() {
return this.debuggerContribution.strings ?? (this.debuggerContribution as any).uiMessages;
}

interestedInLanguage(languageId: string): boolean {
Expand Down