mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 03:28:33 -05:00
Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 (#8722)
* Merge from vscode 4636be2b71c87bfb0bfe3c94278b447a5efcc1f1 * remove tests that aren't working
This commit is contained in:
@@ -95,11 +95,12 @@ function getBreakpointDecorationOptions(model: ITextModel, breakpoint: IBreakpoi
|
||||
overviewRulerDecoration = null;
|
||||
}
|
||||
|
||||
const renderInline = breakpoint.column && (breakpoint.column > model.getLineFirstNonWhitespaceColumn(breakpoint.lineNumber));
|
||||
return {
|
||||
glyphMarginClassName: `${className}`,
|
||||
glyphMarginHoverMessage,
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
beforeContentClassName: breakpoint.column ? `debug-breakpoint-placeholder` : undefined,
|
||||
beforeContentClassName: renderInline ? `debug-breakpoint-placeholder` : undefined,
|
||||
overviewRuler: overviewRulerDecoration
|
||||
};
|
||||
}
|
||||
@@ -115,9 +116,10 @@ async function createCandidateDecorations(model: ITextModel, breakpointDecoratio
|
||||
if (positions.length > 1) {
|
||||
// Do not render candidates if there is only one, since it is already covered by the line breakpoint
|
||||
const firstColumn = model.getLineFirstNonWhitespaceColumn(lineNumber);
|
||||
const lastColumn = model.getLineLastNonWhitespaceColumn(lineNumber);
|
||||
positions.forEach(p => {
|
||||
const range = new Range(p.lineNumber, p.column, p.lineNumber, p.column + 1);
|
||||
if (p.column <= firstColumn) {
|
||||
if (p.column <= firstColumn || p.column > lastColumn) {
|
||||
// Do not render candidates on the start of the line.
|
||||
return;
|
||||
}
|
||||
@@ -131,7 +133,7 @@ async function createCandidateDecorations(model: ITextModel, breakpointDecoratio
|
||||
range,
|
||||
options: {
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
beforeContentClassName: `debug-breakpoint-placeholder`
|
||||
beforeContentClassName: breakpointAtPosition ? undefined : `debug-breakpoint-placeholder`
|
||||
},
|
||||
breakpoint: breakpointAtPosition ? breakpointAtPosition.breakpoint : undefined
|
||||
});
|
||||
@@ -416,7 +418,7 @@ class BreakpointEditorContribution implements IBreakpointEditorContribution {
|
||||
this.breakpointDecorations = decorationIds.map((decorationId, index) => {
|
||||
let inlineWidget: InlineBreakpointWidget | undefined = undefined;
|
||||
const breakpoint = breakpoints[index];
|
||||
if (breakpoint.column) {
|
||||
if (desiredBreakpointDecorations[index].options.beforeContentClassName) {
|
||||
const contextMenuActions = () => this.getContextMenuActions([breakpoint], activeCodeEditor.getModel().uri, breakpoint.lineNumber, breakpoint.column);
|
||||
inlineWidget = new InlineBreakpointWidget(activeCodeEditor, decorationId, desiredBreakpointDecorations[index].options.glyphMarginClassName, breakpoint, this.debugService, this.contextMenuService, contextMenuActions);
|
||||
}
|
||||
@@ -592,7 +594,7 @@ class InlineBreakpointWidget implements IContentWidget, IDisposable {
|
||||
const lineHeight = this.editor.getOption(EditorOption.lineHeight);
|
||||
this.domNode.style.height = `${lineHeight}px`;
|
||||
this.domNode.style.width = `${Math.ceil(0.8 * lineHeight)}px`;
|
||||
this.domNode.style.marginLeft = `${Math.ceil(0.35 * lineHeight)}px`;
|
||||
this.domNode.style.marginLeft = `4px`;
|
||||
};
|
||||
updateSize();
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ export class CallStackView extends ViewPane {
|
||||
|
||||
this.dataSource = new CallStackDataSource(this.debugService);
|
||||
this.tree = this.instantiationService.createInstance<typeof WorkbenchAsyncDataTree, WorkbenchAsyncDataTree<CallStackItem | IDebugModel, CallStackItem, FuzzyScore>>(WorkbenchAsyncDataTree, 'CallStackView', treeContainer, new CallStackDelegate(), [
|
||||
new SessionsRenderer(this.instantiationService),
|
||||
new SessionsRenderer(this.instantiationService, this.debugService),
|
||||
new ThreadsRenderer(this.instantiationService),
|
||||
this.instantiationService.createInstance(StackFramesRenderer),
|
||||
new ErrorsRenderer(),
|
||||
@@ -404,7 +404,8 @@ class SessionsRenderer implements ITreeRenderer<IDebugSession, FuzzyScore, ISess
|
||||
static readonly ID = 'session';
|
||||
|
||||
constructor(
|
||||
private readonly instantiationService: IInstantiationService
|
||||
private readonly instantiationService: IInstantiationService,
|
||||
private readonly debugService: IDebugService
|
||||
) { }
|
||||
|
||||
get templateId(): string {
|
||||
@@ -426,14 +427,23 @@ class SessionsRenderer implements ITreeRenderer<IDebugSession, FuzzyScore, ISess
|
||||
const session = element.element;
|
||||
data.session.title = nls.localize({ key: 'session', comment: ['Session is a noun'] }, "Session");
|
||||
data.label.set(session.getLabel(), createMatches(element.filterData));
|
||||
const stoppedThread = session.getAllThreads().filter(t => t.stopped).pop();
|
||||
const thread = session.getAllThreads().filter(t => t.stopped).pop();
|
||||
|
||||
data.actionBar.clear();
|
||||
const actions = getActions(this.instantiationService, element.element);
|
||||
data.actionBar.push(actions, { icon: true, label: false });
|
||||
data.stateLabel.hidden = false;
|
||||
|
||||
data.stateLabel.textContent = stoppedThread ? nls.localize('paused', "Paused")
|
||||
: nls.localize({ key: 'running', comment: ['indicates state'] }, "Running");
|
||||
if (thread && thread.stoppedDetails) {
|
||||
data.stateLabel.textContent = thread.stoppedDetails.description || nls.localize('debugStopped', "Paused on {0}", thread.stoppedDetails.reason || '');
|
||||
} else {
|
||||
const hasChildSessions = this.debugService.getModel().getSessions().filter(s => s.parentSession === session).length > 0;
|
||||
if (!hasChildSessions) {
|
||||
data.stateLabel.textContent = nls.localize({ key: 'running', comment: ['indicates state'] }, "Running");
|
||||
} else {
|
||||
data.stateLabel.hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
disposeTemplate(templateData: ISessionTemplateData): void {
|
||||
|
||||
@@ -25,7 +25,7 @@ import { ServicesAccessor } from 'vs/editor/browser/editorExtensions';
|
||||
import { PanelFocusContext } from 'vs/workbench/common/panel';
|
||||
import { CommandsRegistry } from 'vs/platform/commands/common/commands';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@@ -551,7 +551,7 @@ class Launch extends AbstractLaunch implements ILaunch {
|
||||
}
|
||||
|
||||
protected getConfig(): IGlobalConfig | undefined {
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch', { resource: this.workspace.uri }).workspaceFolder;
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch', { resource: this.workspace.uri }).workspaceFolderValue;
|
||||
}
|
||||
|
||||
async openConfigFile(sideBySide: boolean, preserveFocus: boolean, type?: string, token?: CancellationToken): Promise<{ editor: IEditor | null, created: boolean }> {
|
||||
@@ -631,7 +631,7 @@ class WorkspaceLaunch extends AbstractLaunch implements ILaunch {
|
||||
}
|
||||
|
||||
protected getConfig(): IGlobalConfig | undefined {
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch').workspace;
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch').workspaceValue;
|
||||
}
|
||||
|
||||
async openConfigFile(sideBySide: boolean, preserveFocus: boolean): Promise<{ editor: IEditor | null, created: boolean }> {
|
||||
@@ -674,7 +674,7 @@ class UserLaunch extends AbstractLaunch implements ILaunch {
|
||||
}
|
||||
|
||||
protected getConfig(): IGlobalConfig | undefined {
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch').user;
|
||||
return this.configurationService.inspect<IGlobalConfig>('launch').userValue;
|
||||
}
|
||||
|
||||
async openConfigFile(_: boolean, preserveFocus: boolean): Promise<{ editor: IEditor | null, created: boolean }> {
|
||||
|
||||
@@ -158,13 +158,12 @@ export class DebugService implements IDebugService {
|
||||
this.toDispose.push(this.configurationManager.onDidSelectConfiguration(() => {
|
||||
this.debugUx.set(!!(this.state !== State.Inactive || this.configurationManager.selectedConfiguration.name) ? 'default' : 'simple');
|
||||
}));
|
||||
this.toDispose.push(Event.any(this.onDidNewSession, this.onDidEndSession)(() => {
|
||||
this.toDispose.push(this.model.onDidChangeCallStack(() => {
|
||||
const numberOfSessions = this.model.getSessions().length;
|
||||
if (numberOfSessions === 0) {
|
||||
if (this.activity) {
|
||||
this.activity.dispose();
|
||||
}
|
||||
} else {
|
||||
if (this.activity) {
|
||||
this.activity.dispose();
|
||||
}
|
||||
if (numberOfSessions > 0) {
|
||||
this.activity = this.activityService.showActivity(VIEWLET_ID, new NumberBadge(numberOfSessions, n => n === 1 ? nls.localize('1activeSession', "1 active session") : nls.localize('nActiveSessions', "{0} active sessions", n)));
|
||||
}
|
||||
}));
|
||||
|
||||
@@ -16,6 +16,10 @@
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.inline-breakpoint-widget.codicon-debug-breakpoint-disabled {
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.codicon-debug-breakpoint.codicon-debug-stackframe-focused::after,
|
||||
.codicon-debug-breakpoint.codicon-debug-stackframe::after {
|
||||
content: '\eb8a';
|
||||
@@ -32,8 +36,6 @@
|
||||
width: 0.9em;
|
||||
display: inline-flex;
|
||||
vertical-align: middle;
|
||||
margin-right: 2px;
|
||||
margin-left: 2px;
|
||||
margin-top: -1px; /* TODO @misolori: figure out a way to not use negative margin for alignment */
|
||||
}
|
||||
|
||||
@@ -52,14 +54,6 @@
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
/* Do not show call stack decoration when we plan to show breakpoint and top stack frame in one decoration */
|
||||
.monaco-editor .debug-breakpoint-placeholder ~ .debug-top-stack-frame-column::before {
|
||||
width: 0em;
|
||||
content: '';
|
||||
margin-right: 0px;
|
||||
margin-left: 0px;
|
||||
}
|
||||
|
||||
.monaco-editor .inline-breakpoint-widget {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ import { IContextMenuService, IContextViewService } from 'vs/platform/contextvie
|
||||
import { removeAnsiEscapeCodes } from 'vs/base/common/strings';
|
||||
import { WorkbenchAsyncDataTree } from 'vs/platform/list/browser/listService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { RunOnceScheduler } from 'vs/base/common/async';
|
||||
import { FuzzyScore, createMatches } from 'vs/base/common/filters';
|
||||
import { HighlightedLabel, IHighlight } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
||||
|
||||
@@ -64,8 +64,19 @@ export class StartView extends ViewPane {
|
||||
|
||||
this.debugButton.enabled = enabled;
|
||||
this.runButton.enabled = enabled;
|
||||
this.debugButton.label = this.debuggerLabels.length !== 1 ? localize('debug', "Debug") : localize('debugWith', "Debug with {0}", this.debuggerLabels[0]);
|
||||
this.runButton.label = this.debuggerLabels.length !== 1 ? localize('run', "Run") : localize('runWith', "Run with {0}", this.debuggerLabels[0]);
|
||||
const debugKeybinding = this.keybindingService.lookupKeybinding(StartAction.ID);
|
||||
let debugLabel = this.debuggerLabels.length !== 1 ? localize('debug', "Debug") : localize('debugWith', "Debug with {0}", this.debuggerLabels[0]);
|
||||
if (debugKeybinding) {
|
||||
debugLabel += ` (${debugKeybinding.getLabel()})`;
|
||||
}
|
||||
this.debugButton.label = debugLabel;
|
||||
|
||||
let runLabel = this.debuggerLabels.length !== 1 ? localize('run', "Run") : localize('runWith', "Run with {0}", this.debuggerLabels[0]);
|
||||
const runKeybinding = this.keybindingService.lookupKeybinding(RunAction.ID);
|
||||
if (runKeybinding) {
|
||||
runLabel += ` (${runKeybinding.getLabel()})`;
|
||||
}
|
||||
this.runButton.label = runLabel;
|
||||
|
||||
const emptyWorkbench = this.workspaceContextService.getWorkbenchState() === WorkbenchState.EMPTY;
|
||||
this.firstMessageContainer.innerHTML = '';
|
||||
@@ -74,12 +85,12 @@ export class StartView extends ViewPane {
|
||||
this.secondMessageContainer.appendChild(secondMessageElement);
|
||||
|
||||
const setSecondMessage = () => {
|
||||
secondMessageElement.textContent = localize('specifyHowToRun', "To futher configure Debug and Run");
|
||||
secondMessageElement.textContent = localize('specifyHowToRun', "To further configure Debug and Run");
|
||||
this.clickElement = this.createClickElement(localize('configure', " create a launch.json file."), () => this.commandService.executeCommand(ConfigureAction.ID));
|
||||
this.secondMessageContainer.appendChild(this.clickElement);
|
||||
};
|
||||
const setSecondMessageWithFolder = () => {
|
||||
secondMessageElement.textContent = localize('noLaunchConfiguration', "To futher configure Debug and Run, ");
|
||||
secondMessageElement.textContent = localize('noLaunchConfiguration', "To further configure Debug and Run, ");
|
||||
this.clickElement = this.createClickElement(localize('openFolder', " open a folder"), () => this.dialogService.pickFolderAndOpen({ forceNewWindow: false }));
|
||||
this.secondMessageContainer.appendChild(this.clickElement);
|
||||
|
||||
@@ -111,7 +122,6 @@ export class StartView extends ViewPane {
|
||||
this.firstMessageContainer.appendChild(firstMessageElement);
|
||||
firstMessageElement.textContent = localize('canBeDebuggedOrRun', " which can be debugged or run.");
|
||||
|
||||
|
||||
setSecondMessageWithFolder();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,11 +24,11 @@ import { TaskIdentifier } from 'vs/workbench/contrib/tasks/common/tasks';
|
||||
import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Extensions as ViewContainerExtensions, IViewContainersRegistry, ViewContainer } from 'vs/workbench/common/views';
|
||||
import { Extensions as ViewContainerExtensions, IViewContainersRegistry, ViewContainer, ViewContainerLocation } from 'vs/workbench/common/views';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
|
||||
export const VIEWLET_ID = 'workbench.view.debug';
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID);
|
||||
export const VIEW_CONTAINER: ViewContainer = Registry.as<IViewContainersRegistry>(ViewContainerExtensions.ViewContainersRegistry).registerViewContainer(VIEWLET_ID, ViewContainerLocation.Sidebar);
|
||||
|
||||
export const VARIABLES_VIEW_ID = 'workbench.debug.variablesView';
|
||||
export const WATCH_VIEW_ID = 'workbench.debug.watchExpressionsView';
|
||||
|
||||
@@ -17,7 +17,7 @@ import { TelemetryService } from 'vs/platform/telemetry/common/telemetryService'
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { memoize } from 'vs/base/common/decorators';
|
||||
import { TaskDefinitionRegistry } from 'vs/workbench/contrib/tasks/common/taskDefinitionRegistry';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/resourceConfiguration';
|
||||
import { ITextResourcePropertiesService } from 'vs/editor/common/services/textResourceConfigurationService';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { isDebuggerMainContribution } from 'vs/workbench/contrib/debug/common/debugUtils';
|
||||
|
||||
Reference in New Issue
Block a user