mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-09 09:42:34 -05:00
Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 (#9385)
* Merge from vscode e5834d3280fcd04898efeac32b9cf1b893f9b127 * distro
This commit is contained in:
@@ -16,6 +16,7 @@ export interface IBulkEditOptions {
|
||||
progress?: IProgress<IProgressStep>;
|
||||
showPreview?: boolean;
|
||||
label?: string;
|
||||
quotableLabel?: string;
|
||||
}
|
||||
|
||||
export interface IBulkEditResult {
|
||||
|
||||
@@ -46,7 +46,7 @@ class MinimapOptions {
|
||||
|
||||
public readonly renderMinimap: RenderMinimap;
|
||||
|
||||
public readonly mode: 'actual' | 'cover' | 'contain';
|
||||
public readonly size: 'proportional' | 'fill' | 'fit';
|
||||
|
||||
public readonly minimapHeightIsEditorHeight: boolean;
|
||||
|
||||
@@ -108,7 +108,7 @@ class MinimapOptions {
|
||||
const minimapOpts = options.get(EditorOption.minimap);
|
||||
|
||||
this.renderMinimap = layoutInfo.renderMinimap | 0;
|
||||
this.mode = minimapOpts.mode;
|
||||
this.size = minimapOpts.size;
|
||||
this.minimapHeightIsEditorHeight = layoutInfo.minimapHeightIsEditorHeight;
|
||||
this.scrollBeyondLastLine = options.get(EditorOption.scrollBeyondLastLine);
|
||||
this.showSlider = minimapOpts.showSlider;
|
||||
@@ -144,7 +144,7 @@ class MinimapOptions {
|
||||
|
||||
public equals(other: MinimapOptions): boolean {
|
||||
return (this.renderMinimap === other.renderMinimap
|
||||
&& this.mode === other.mode
|
||||
&& this.size === other.size
|
||||
&& this.minimapHeightIsEditorHeight === other.minimapHeightIsEditorHeight
|
||||
&& this.scrollBeyondLastLine === other.scrollBeyondLastLine
|
||||
&& this.showSlider === other.showSlider
|
||||
@@ -1111,7 +1111,7 @@ class InnerMinimap extends Disposable {
|
||||
if (!this._lastRenderData) {
|
||||
return;
|
||||
}
|
||||
if (this._model.options.minimapHeightIsEditorHeight) {
|
||||
if (this._model.options.size !== 'proportional') {
|
||||
if (e.leftButton && this._lastRenderData) {
|
||||
// pretend the click occured in the center of the slider
|
||||
const position = dom.getDomNodePagePosition(this._slider.domNode);
|
||||
|
||||
@@ -617,10 +617,11 @@ export class DiffReview extends Disposable {
|
||||
header.setAttribute('role', 'listitem');
|
||||
container.appendChild(header);
|
||||
|
||||
const lineHeight = modifiedOptions.get(EditorOption.lineHeight);
|
||||
let modLine = minModifiedLine;
|
||||
for (let i = 0, len = diffs.length; i < len; i++) {
|
||||
const diffEntry = diffs[i];
|
||||
DiffReview._renderSection(container, diffEntry, modLine, this._width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts);
|
||||
DiffReview._renderSection(container, diffEntry, modLine, lineHeight, this._width, originalOptions, originalModel, originalModelOpts, modifiedOptions, modifiedModel, modifiedModelOpts);
|
||||
if (diffEntry.modifiedLineStart !== 0) {
|
||||
modLine = diffEntry.modifiedLineEnd;
|
||||
}
|
||||
@@ -632,7 +633,7 @@ export class DiffReview extends Disposable {
|
||||
}
|
||||
|
||||
private static _renderSection(
|
||||
dest: HTMLElement, diffEntry: DiffEntry, modLine: number, width: number,
|
||||
dest: HTMLElement, diffEntry: DiffEntry, modLine: number, lineHeight: number, width: number,
|
||||
originalOptions: IComputedEditorOptions, originalModel: ITextModel, originalModelOpts: TextModelResolvedOptions,
|
||||
modifiedOptions: IComputedEditorOptions, modifiedModel: ITextModel, modifiedModelOpts: TextModelResolvedOptions
|
||||
): void {
|
||||
@@ -641,17 +642,18 @@ export class DiffReview extends Disposable {
|
||||
|
||||
let rowClassName: string = 'diff-review-row';
|
||||
let lineNumbersExtraClassName: string = '';
|
||||
let spacerClassName: string = 'diff-review-spacer';
|
||||
const spacerClassName: string = 'diff-review-spacer';
|
||||
let spacerCodiconName: string | null = null;
|
||||
switch (type) {
|
||||
case DiffEntryType.Insert:
|
||||
rowClassName = 'diff-review-row line-insert';
|
||||
lineNumbersExtraClassName = ' char-insert';
|
||||
spacerClassName = 'diff-review-spacer insert-sign';
|
||||
spacerCodiconName = 'codicon codicon-add';
|
||||
break;
|
||||
case DiffEntryType.Delete:
|
||||
rowClassName = 'diff-review-row line-delete';
|
||||
lineNumbersExtraClassName = ' char-delete';
|
||||
spacerClassName = 'diff-review-spacer delete-sign';
|
||||
spacerCodiconName = 'codicon codicon-remove';
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -686,6 +688,7 @@ export class DiffReview extends Disposable {
|
||||
|
||||
let cell = document.createElement('div');
|
||||
cell.className = 'diff-review-cell';
|
||||
cell.style.height = `${lineHeight}px`;
|
||||
row.appendChild(cell);
|
||||
|
||||
const originalLineNumber = document.createElement('span');
|
||||
@@ -713,7 +716,15 @@ export class DiffReview extends Disposable {
|
||||
|
||||
const spacer = document.createElement('span');
|
||||
spacer.className = spacerClassName;
|
||||
spacer.innerHTML = '  ';
|
||||
|
||||
if (spacerCodiconName) {
|
||||
const spacerCodicon = document.createElement('span');
|
||||
spacerCodicon.className = spacerCodiconName;
|
||||
spacerCodicon.innerHTML = '  ';
|
||||
spacer.appendChild(spacerCodicon);
|
||||
} else {
|
||||
spacer.innerHTML = '  ';
|
||||
}
|
||||
cell.appendChild(spacer);
|
||||
|
||||
let lineContent: string;
|
||||
|
||||
@@ -37,13 +37,14 @@
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.monaco-diff-editor .diff-review-cell {
|
||||
display: table-cell;
|
||||
}
|
||||
|
||||
.monaco-diff-editor .diff-review-spacer {
|
||||
display: inline-block;
|
||||
width: 10px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.monaco-diff-editor .diff-review-spacer > .codicon {
|
||||
font-size: 9px !important;
|
||||
}
|
||||
|
||||
.monaco-diff-editor .diff-review-actions {
|
||||
|
||||
@@ -510,7 +510,7 @@ export interface IEditorOptions {
|
||||
* Controls whether clicking on the empty content after a folded line will unfold the line.
|
||||
* Defaults to false.
|
||||
*/
|
||||
unfoldOnClickInEmptyContent?: boolean;
|
||||
unfoldOnClickAfterEndOfLine?: boolean;
|
||||
/**
|
||||
* Enable highlighting of matching brackets.
|
||||
* Defaults to 'always'.
|
||||
@@ -1808,7 +1808,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
|
||||
const minimapRenderCharacters = minimap.renderCharacters;
|
||||
let minimapScale = (pixelRatio >= 2 ? Math.round(minimap.scale * 2) : minimap.scale);
|
||||
const minimapMaxColumn = minimap.maxColumn | 0;
|
||||
const minimapMode = minimap.mode;
|
||||
const minimapSize = minimap.size;
|
||||
|
||||
const scrollbar = options.get(EditorOption.scrollbar);
|
||||
const verticalScrollbarWidth = scrollbar.verticalScrollbarSize | 0;
|
||||
@@ -1872,7 +1872,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
|
||||
let minimapCharWidth = minimapScale / pixelRatio;
|
||||
let minimapWidthMultiplier: number = 1;
|
||||
|
||||
if (minimapMode === 'cover' || minimapMode === 'contain') {
|
||||
if (minimapSize === 'fill' || minimapSize === 'fit') {
|
||||
const viewLineCount = env.viewLineCount;
|
||||
const { typicalViewportLineCount, extraLinesBeyondLastLine, desiredRatio, minimapLineCount } = EditorLayoutInfoComputer.computeContainedMinimapLineCount({
|
||||
viewLineCount: viewLineCount,
|
||||
@@ -1893,7 +1893,7 @@ export class EditorLayoutInfoComputer extends ComputedEditorOption<EditorOption.
|
||||
minimapCharWidth = minimapScale / pixelRatio;
|
||||
} else {
|
||||
const effectiveMinimapHeight = Math.ceil((viewLineCount + extraLinesBeyondLastLine) * minimapLineHeight);
|
||||
if (minimapMode === 'cover' || effectiveMinimapHeight > minimapCanvasInnerHeight) {
|
||||
if (minimapSize === 'fill' || effectiveMinimapHeight > minimapCanvasInnerHeight) {
|
||||
minimapHeightIsEditorHeight = true;
|
||||
const configuredFontScale = minimapScale;
|
||||
minimapLineHeight = Math.min(lineHeight * pixelRatio, Math.max(1, Math.floor(1 / desiredRatio)));
|
||||
@@ -2080,7 +2080,7 @@ export interface IEditorMinimapOptions {
|
||||
* Control the minimap rendering mode.
|
||||
* Defaults to 'actual'.
|
||||
*/
|
||||
mode?: 'actual' | 'cover' | 'contain';
|
||||
size?: 'proportional' | 'fill' | 'fit';
|
||||
/**
|
||||
* Control the rendering of the minimap slider.
|
||||
* Defaults to 'mouseover'.
|
||||
@@ -2109,7 +2109,7 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
|
||||
constructor() {
|
||||
const defaults: EditorMinimapOptions = {
|
||||
enabled: false, // {{SQL CARBON EDIT}} disable minimap by default
|
||||
mode: 'actual',
|
||||
size: 'proportional',
|
||||
side: 'right',
|
||||
showSlider: 'mouseover',
|
||||
renderCharacters: true,
|
||||
@@ -2124,16 +2124,16 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
|
||||
default: defaults.enabled,
|
||||
description: nls.localize('minimap.enabled', "Controls whether the minimap is shown.")
|
||||
},
|
||||
'editor.minimap.mode': {
|
||||
'editor.minimap.size': {
|
||||
type: 'string',
|
||||
enum: ['actual', 'cover', 'contain'],
|
||||
enum: ['proportional', 'fill', 'fit'],
|
||||
enumDescriptions: [
|
||||
nls.localize('minimap.mode.actual', "The minimap will be displayed in its original size, so it might be higher than the editor."),
|
||||
nls.localize('minimap.mode.cover', "The minimap will always have the height of the editor and will stretch or shrink as necessary."),
|
||||
nls.localize('minimap.mode.contain', "The minimap will shrink as necessary to never be higher than the editor."),
|
||||
nls.localize('minimap.size.proportional', "The minimap has the same size as the editor contents (and might scroll)."),
|
||||
nls.localize('minimap.size.fill', "The minimap will stretch or shrink as necessary to fill the height of the editor (no scrolling)."),
|
||||
nls.localize('minimap.size.fit', "The minimap will shrink as necessary to never be larger than the editor (no scrolling)."),
|
||||
],
|
||||
default: defaults.mode,
|
||||
description: nls.localize('minimap.mode', "Controls the rendering mode of the minimap.")
|
||||
default: defaults.size,
|
||||
description: nls.localize('minimap.size', "Controls the size of the minimap.")
|
||||
},
|
||||
'editor.minimap.side': {
|
||||
type: 'string',
|
||||
@@ -2152,7 +2152,8 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
|
||||
default: defaults.scale,
|
||||
minimum: 1,
|
||||
maximum: 3,
|
||||
description: nls.localize('minimap.scale', "Scale of content drawn in the minimap.")
|
||||
enum: [1, 2, 3],
|
||||
description: nls.localize('minimap.scale', "Scale of content drawn in the minimap: 1, 2 or 3.")
|
||||
},
|
||||
'editor.minimap.renderCharacters': {
|
||||
type: 'boolean',
|
||||
@@ -2175,7 +2176,7 @@ class EditorMinimap extends BaseEditorOption<EditorOption.minimap, EditorMinimap
|
||||
const input = _input as IEditorMinimapOptions;
|
||||
return {
|
||||
enabled: EditorBooleanOption.boolean(input.enabled, this.defaultValue.enabled),
|
||||
mode: EditorStringEnumOption.stringSet<'actual' | 'cover' | 'contain'>(input.mode, this.defaultValue.mode, ['actual', 'cover', 'contain']),
|
||||
size: EditorStringEnumOption.stringSet<'proportional' | 'fill' | 'fit'>(input.size, this.defaultValue.size, ['proportional', 'fill', 'fit']),
|
||||
side: EditorStringEnumOption.stringSet<'right' | 'left'>(input.side, this.defaultValue.side, ['right', 'left']),
|
||||
showSlider: EditorStringEnumOption.stringSet<'always' | 'mouseover'>(input.showSlider, this.defaultValue.showSlider, ['always', 'mouseover']),
|
||||
renderCharacters: EditorBooleanOption.boolean(input.renderCharacters, this.defaultValue.renderCharacters),
|
||||
@@ -2840,9 +2841,14 @@ export interface ISuggestOptions {
|
||||
*/
|
||||
showSnippets?: boolean;
|
||||
/**
|
||||
* Controls the visibility of the status bar at the bottom of the suggest widget.
|
||||
* Status bar related settings.
|
||||
*/
|
||||
hideStatusBar?: boolean;
|
||||
statusBar?: {
|
||||
/**
|
||||
* Controls the visibility of the status bar at the bottom of the suggest widget.
|
||||
*/
|
||||
visible?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export type InternalSuggestOptions = Readonly<Required<ISuggestOptions>>;
|
||||
@@ -2884,7 +2890,9 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
|
||||
showFolders: true,
|
||||
showTypeParameters: true,
|
||||
showSnippets: true,
|
||||
hideStatusBar: true
|
||||
statusBar: {
|
||||
visible: false
|
||||
}
|
||||
};
|
||||
super(
|
||||
EditorOption.suggest, 'suggest', defaults,
|
||||
@@ -3070,10 +3078,10 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
|
||||
default: true,
|
||||
markdownDescription: nls.localize('editor.suggest.showSnippets', "When enabled IntelliSense shows `snippet`-suggestions.")
|
||||
},
|
||||
'editor.suggest.hideStatusBar': {
|
||||
'editor.suggest.statusBar.visible': {
|
||||
type: 'boolean',
|
||||
default: true,
|
||||
markdownDescription: nls.localize('editor.suggest.hideStatusBar', "Controls the visibility of the status bar at the bottom of the suggest widget.")
|
||||
default: false,
|
||||
markdownDescription: nls.localize('editor.suggest.statusBar.visible', "Controls the visibility of the status bar at the bottom of the suggest widget.")
|
||||
}
|
||||
}
|
||||
);
|
||||
@@ -3118,7 +3126,9 @@ class EditorSuggest extends BaseEditorOption<EditorOption.suggest, InternalSugge
|
||||
showFolders: EditorBooleanOption.boolean(input.showFolders, this.defaultValue.showFolders),
|
||||
showTypeParameters: EditorBooleanOption.boolean(input.showTypeParameters, this.defaultValue.showTypeParameters),
|
||||
showSnippets: EditorBooleanOption.boolean(input.showSnippets, this.defaultValue.showSnippets),
|
||||
hideStatusBar: EditorBooleanOption.boolean(input.hideStatusBar, this.defaultValue.hideStatusBar),
|
||||
statusBar: {
|
||||
visible: EditorBooleanOption.boolean(input.statusBar?.visible, !!this.defaultValue.statusBar.visible)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -3333,7 +3343,7 @@ export const enum EditorOption {
|
||||
folding,
|
||||
foldingStrategy,
|
||||
foldingHighlight,
|
||||
unfoldOnClickInEmptyContent,
|
||||
unfoldOnClickAfterEndOfLine,
|
||||
fontFamily,
|
||||
fontInfo,
|
||||
fontLigatures,
|
||||
@@ -3633,9 +3643,9 @@ export const EditorOptions = {
|
||||
EditorOption.foldingHighlight, 'foldingHighlight', true,
|
||||
{ description: nls.localize('foldingHighlight', "Controls whether the editor should highlight folded ranges.") }
|
||||
)),
|
||||
unfoldOnClickInEmptyContent: register(new EditorBooleanOption(
|
||||
EditorOption.unfoldOnClickInEmptyContent, 'unfoldOnClickInEmptyContent', false,
|
||||
{ description: nls.localize('unfoldOnClickInEmptyContent', "Controls whether clicking on the empty content after a folded line will unfold the line.") }
|
||||
unfoldOnClickAfterEndOfLine: register(new EditorBooleanOption(
|
||||
EditorOption.unfoldOnClickAfterEndOfLine, 'unfoldOnClickAfterEndOfLine', false,
|
||||
{ description: nls.localize('unfoldOnClickAfterEndOfLine', "Controls whether clicking on the empty content after a folded line will unfold the line.") }
|
||||
)),
|
||||
fontFamily: register(new EditorStringOption(
|
||||
EditorOption.fontFamily, 'fontFamily', EDITOR_FONT_DEFAULTS.fontFamily,
|
||||
@@ -3777,7 +3787,7 @@ export const EditorOptions = {
|
||||
)),
|
||||
definitionLinkOpensInPeek: register(new EditorBooleanOption(
|
||||
EditorOption.definitionLinkOpensInPeek, 'definitionLinkOpensInPeek', false,
|
||||
{ description: nls.localize('definitionLinkOpensInPeek', "Controls whether the definition link opens element in the peek widget.") }
|
||||
{ description: nls.localize('definitionLinkOpensInPeek', "Controls whether the Go to Definition mouse gesture always opens the peek widget.") }
|
||||
)),
|
||||
quickSuggestions: register(new EditorQuickSuggestions()),
|
||||
quickSuggestionsDelay: register(new EditorIntOption(
|
||||
|
||||
@@ -430,15 +430,14 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
|
||||
return this._columnSelectData;
|
||||
}
|
||||
const primaryCursor = this._cursors.getPrimaryCursor();
|
||||
const primaryPos = primaryCursor.viewState.selectionStart.getStartPosition();
|
||||
const viewLineNumber = primaryPos.lineNumber;
|
||||
const viewVisualColumn = CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, primaryPos);
|
||||
const viewSelectionStart = primaryCursor.viewState.selectionStart.getStartPosition();
|
||||
const viewPosition = primaryCursor.viewState.position;
|
||||
return {
|
||||
isReal: false,
|
||||
fromViewLineNumber: viewLineNumber,
|
||||
fromViewVisualColumn: viewVisualColumn,
|
||||
toViewLineNumber: viewLineNumber,
|
||||
toViewVisualColumn: viewVisualColumn,
|
||||
fromViewLineNumber: viewSelectionStart.lineNumber,
|
||||
fromViewVisualColumn: CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, viewSelectionStart),
|
||||
toViewLineNumber: viewPosition.lineNumber,
|
||||
toViewVisualColumn: CursorColumns.visibleColumnFromColumn2(this.context.config, this.context.viewModel, viewPosition),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -494,7 +494,7 @@ export interface CompletionItem {
|
||||
preselect?: boolean;
|
||||
/**
|
||||
* A string or snippet that should be inserted in a document when selecting
|
||||
* this completion. When `falsy` the [label](#CompletionItem.label)
|
||||
* this completion.
|
||||
* is used.
|
||||
*/
|
||||
insertText: string;
|
||||
@@ -1373,7 +1373,7 @@ export interface RenameProvider {
|
||||
*/
|
||||
export interface AuthenticationSession {
|
||||
id: string;
|
||||
accessToken(): Promise<string>;
|
||||
getAccessToken(): Thenable<string>;
|
||||
accountName: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ export enum EditorOption {
|
||||
folding = 31,
|
||||
foldingStrategy = 32,
|
||||
foldingHighlight = 33,
|
||||
unfoldOnClickInEmptyContent = 34,
|
||||
unfoldOnClickAfterEndOfLine = 34,
|
||||
fontFamily = 35,
|
||||
fontInfo = 36,
|
||||
fontLigatures = 37,
|
||||
|
||||
@@ -161,6 +161,7 @@ class ExecCommandPasteAction extends ExecCommandAction {
|
||||
kbExpr: EditorContextKeys.textInputFocus,
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_V,
|
||||
win: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
|
||||
linux: { primary: KeyMod.CtrlCmd | KeyCode.KEY_V, secondary: [KeyMod.Shift | KeyCode.Insert] },
|
||||
weight: KeybindingWeight.EditorContrib
|
||||
};
|
||||
// Do not bind paste keybindings in the browser,
|
||||
|
||||
@@ -164,7 +164,7 @@ export async function applyCodeAction(
|
||||
});
|
||||
|
||||
if (action.edit) {
|
||||
await bulkEditService.apply(action.edit, { editor });
|
||||
await bulkEditService.apply(action.edit, { editor, label: action.title });
|
||||
}
|
||||
|
||||
if (action.command) {
|
||||
|
||||
@@ -62,7 +62,7 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
private readonly editor: ICodeEditor;
|
||||
private _isEnabled: boolean;
|
||||
private _useFoldingProviders: boolean;
|
||||
private _unfoldOnClickInEmptyContent: boolean;
|
||||
private _unfoldOnClickAfterEndOfLine: boolean;
|
||||
|
||||
private readonly foldingDecorationProvider: FoldingDecorationProvider;
|
||||
|
||||
@@ -92,7 +92,7 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
const options = this.editor.getOptions();
|
||||
this._isEnabled = options.get(EditorOption.folding);
|
||||
this._useFoldingProviders = options.get(EditorOption.foldingStrategy) !== 'indentation';
|
||||
this._unfoldOnClickInEmptyContent = options.get(EditorOption.unfoldOnClickInEmptyContent);
|
||||
this._unfoldOnClickAfterEndOfLine = options.get(EditorOption.unfoldOnClickAfterEndOfLine);
|
||||
|
||||
this.foldingModel = null;
|
||||
this.hiddenRangeModel = null;
|
||||
@@ -114,8 +114,7 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
|
||||
this._register(this.editor.onDidChangeConfiguration((e: ConfigurationChangedEvent) => {
|
||||
if (e.hasChanged(EditorOption.folding)) {
|
||||
const options = this.editor.getOptions();
|
||||
this._isEnabled = options.get(EditorOption.folding);
|
||||
this._isEnabled = this.editor.getOptions().get(EditorOption.folding);
|
||||
this.foldingEnabled.set(this._isEnabled);
|
||||
this.onModelChanged();
|
||||
}
|
||||
@@ -126,12 +125,11 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
this.onModelContentChanged();
|
||||
}
|
||||
if (e.hasChanged(EditorOption.foldingStrategy)) {
|
||||
const options = this.editor.getOptions();
|
||||
this._useFoldingProviders = options.get(EditorOption.foldingStrategy) !== 'indentation';
|
||||
this._useFoldingProviders = this.editor.getOptions().get(EditorOption.foldingStrategy) !== 'indentation';
|
||||
this.onFoldingStrategyChanged();
|
||||
}
|
||||
if (e.hasChanged(EditorOption.unfoldOnClickInEmptyContent)) {
|
||||
this._unfoldOnClickInEmptyContent = options.get(EditorOption.unfoldOnClickInEmptyContent);
|
||||
if (e.hasChanged(EditorOption.unfoldOnClickAfterEndOfLine)) {
|
||||
this._unfoldOnClickAfterEndOfLine = this.editor.getOptions().get(EditorOption.unfoldOnClickAfterEndOfLine);
|
||||
}
|
||||
}));
|
||||
this.onModelChanged();
|
||||
@@ -370,7 +368,7 @@ export class FoldingController extends Disposable implements IEditorContribution
|
||||
iconClicked = true;
|
||||
break;
|
||||
case MouseTargetType.CONTENT_EMPTY: {
|
||||
if (this._unfoldOnClickInEmptyContent && this.hiddenRangeModel.hasRanges()) {
|
||||
if (this._unfoldOnClickAfterEndOfLine && this.hiddenRangeModel.hasRanges()) {
|
||||
const data = e.target.detail as IEmptyContentData;
|
||||
if (!data.isAfterLines) {
|
||||
break;
|
||||
|
||||
@@ -338,9 +338,8 @@ export class GotoDefinitionAtPositionEditorContribution implements IEditorContri
|
||||
|
||||
private gotoDefinition(position: Position, openToSide: boolean): Promise<any> {
|
||||
this.editor.setPosition(position);
|
||||
const definitionLinkOpensInPeek = this.editor.getOption(EditorOption.definitionLinkOpensInPeek);
|
||||
return this.editor.invokeWithinContext((accessor) => {
|
||||
const canPeek = definitionLinkOpensInPeek && !this.isInPeekEditor(accessor);
|
||||
const canPeek = !openToSide && this.editor.getOption(EditorOption.definitionLinkOpensInPeek) && !this.isInPeekEditor(accessor);
|
||||
const action = new DefinitionAction({ openToSide, openInPeek: canPeek, muteMessage: true }, { alias: '', label: '', id: '', precondition: undefined });
|
||||
return action.run(accessor, this.editor);
|
||||
});
|
||||
|
||||
@@ -77,8 +77,8 @@ export class LinksList extends Disposable {
|
||||
const newLinks = list.links.map(link => new Link(link, provider));
|
||||
links = LinksList._union(links, newLinks);
|
||||
// register disposables
|
||||
if (isDisposable(provider)) {
|
||||
this._register(provider);
|
||||
if (isDisposable(list)) {
|
||||
this._register(list);
|
||||
}
|
||||
}
|
||||
this.links = links;
|
||||
|
||||
@@ -206,7 +206,8 @@ class RenameController implements IEditorContribution {
|
||||
this._bulkEditService.apply(renameResult, {
|
||||
editor: this.editor,
|
||||
showPreview: inputFieldResult.wantsPreview,
|
||||
label: nls.localize('label', "Renaming '{0}'", loc?.text)
|
||||
label: nls.localize('label', "Renaming '{0}'", loc?.text),
|
||||
quotableLabel: nls.localize('quotableLabel', "Renaming {0}", loc?.text),
|
||||
}).then(result => {
|
||||
if (result.ariaSummary) {
|
||||
alert(nls.localize('aria', "Successfully renamed '{0}' to '{1}'. Summary: {2}", loc!.text, inputFieldResult.newName, result.ariaSummary));
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row:not(.string-label) > .contents > .main > .left > .monaco-icon-label {
|
||||
max-width: 80%;
|
||||
max-width: 100%;
|
||||
}
|
||||
.monaco-editor .suggest-widget .monaco-list .monaco-list-row.string-label > .contents > .main > .left > .monaco-icon-label {
|
||||
flex-shrink: 1;
|
||||
@@ -392,6 +392,10 @@
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > .docs.markdown-docs .codicon {
|
||||
vertical-align: sub;
|
||||
}
|
||||
|
||||
.monaco-editor .suggest-widget .details > .monaco-scrollable-element > .body > p:empty {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
this.messageElement = append(this.element, $('.message'));
|
||||
this.listElement = append(this.element, $('.tree'));
|
||||
|
||||
const applyStatusBarStyle = () => toggleClass(this.element, 'with-status-bar', !this.editor.getOption(EditorOption.suggest).hideStatusBar);
|
||||
const applyStatusBarStyle = () => toggleClass(this.element, 'with-status-bar', this.editor.getOption(EditorOption.suggest).statusBar.visible);
|
||||
applyStatusBarStyle();
|
||||
|
||||
this.statusBarElement = append(this.element, $('.suggest-status-bar'));
|
||||
|
||||
@@ -33,7 +33,7 @@ interface IEditorLayoutProviderOpts {
|
||||
readonly minimapSide: 'left' | 'right';
|
||||
readonly minimapRenderCharacters: boolean;
|
||||
readonly minimapMaxColumn: number;
|
||||
minimapMode?: 'actual' | 'cover' | 'contain';
|
||||
minimapSize?: 'proportional' | 'fill' | 'fit';
|
||||
readonly pixelRatio: number;
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
|
||||
options._write(EditorOption.folding, false);
|
||||
const minimapOptions: EditorMinimapOptions = {
|
||||
enabled: input.minimap,
|
||||
mode: input.minimapMode || 'actual',
|
||||
size: input.minimapSize || 'proportional',
|
||||
side: input.minimapSide,
|
||||
renderCharacters: input.minimapRenderCharacters,
|
||||
maxColumn: input.minimapMaxColumn,
|
||||
@@ -978,7 +978,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
|
||||
minimapSide: 'right',
|
||||
minimapRenderCharacters: true,
|
||||
minimapMaxColumn: 150,
|
||||
minimapMode: 'cover',
|
||||
minimapSize: 'fill',
|
||||
pixelRatio: 2,
|
||||
}, {
|
||||
width: 1000,
|
||||
@@ -1042,7 +1042,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
|
||||
minimapSide: 'right',
|
||||
minimapRenderCharacters: true,
|
||||
minimapMaxColumn: 150,
|
||||
minimapMode: 'cover',
|
||||
minimapSize: 'fill',
|
||||
pixelRatio: 2,
|
||||
}, {
|
||||
width: 1000,
|
||||
@@ -1106,7 +1106,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
|
||||
minimapSide: 'right',
|
||||
minimapRenderCharacters: true,
|
||||
minimapMaxColumn: 150,
|
||||
minimapMode: 'contain',
|
||||
minimapSize: 'fit',
|
||||
pixelRatio: 2,
|
||||
}, {
|
||||
width: 1000,
|
||||
@@ -1170,7 +1170,7 @@ suite('Editor ViewLayout - EditorLayoutProvider', () => {
|
||||
minimapSide: 'right',
|
||||
minimapRenderCharacters: true,
|
||||
minimapMaxColumn: 150,
|
||||
minimapMode: 'contain',
|
||||
minimapSize: 'fit',
|
||||
pixelRatio: 2,
|
||||
}, {
|
||||
width: 1000,
|
||||
|
||||
Reference in New Issue
Block a user