mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 (#14050)
* Merge from vscode 2c306f762bf9c3db82dc06c7afaa56ef46d72f79 * Fix breaks * Extension management fixes * Fix breaks in windows bundling * Fix/skip failing tests * Update distro * Add clear to nuget.config * Add hygiene task * Bump distro * Fix hygiene issue * Add build to hygiene exclusion * Update distro * Update hygiene * Hygiene exclusions * Update tsconfig * Bump distro for server breaks * Update build config * Update darwin path * Add done calls to notebook tests * Skip failing tests * Disable smoke tests
This commit is contained in:
@@ -16,12 +16,12 @@ import * as platform from 'vs/base/common/platform';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditor, IOverlayWidget, IOverlayWidgetPosition } from 'vs/editor/browser/editorBrowser';
|
||||
import { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution } from 'vs/editor/browser/editorExtensions';
|
||||
import { EditorCommand, registerEditorContribution, registerEditorCommand } from 'vs/editor/browser/editorExtensions';
|
||||
import { IEditorOptions, EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { ToggleTabFocusModeAction } from 'vs/editor/contrib/toggleTabFocusMode/toggleTabFocusMode';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
@@ -30,6 +30,10 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { contrastBorder, editorWidgetBackground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { AccessibilitySupport } from 'vs/platform/accessibility/common/accessibility';
|
||||
import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
import { ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { NEW_UNTITLED_FILE_COMMAND_ID } from 'vs/workbench/contrib/files/browser/fileCommands';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
|
||||
const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey<boolean>('accessibilityHelpWidgetVisible', false);
|
||||
|
||||
@@ -116,7 +120,7 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
|
||||
if (e.equals(KeyMod.CtrlCmd | KeyCode.KEY_E)) {
|
||||
alert(nls.localize('emergencyConfOn', "Now changing the setting `editor.accessibilitySupport` to 'on'."));
|
||||
|
||||
this._configurationService.updateValue('editor.accessibilitySupport', 'on', ConfigurationTarget.USER);
|
||||
this._configurationService.updateValue('editor.accessibilitySupport', 'on');
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
@@ -273,16 +277,15 @@ class AccessibilityHelpWidget extends Widget implements IOverlayWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class ShowAccessibilityHelpAction extends EditorAction {
|
||||
// Show Accessibility Help is a workench command so it can also be shown when there is no editor open #108850
|
||||
class ShowAccessibilityHelpAction extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'editor.action.showAccessibilityHelp',
|
||||
label: nls.localize('ShowAccessibilityHelpAction', "Show Accessibility Help"),
|
||||
alias: 'Show Accessibility Help',
|
||||
precondition: undefined,
|
||||
kbOpts: {
|
||||
kbExpr: EditorContextKeys.focus,
|
||||
title: { value: nls.localize('ShowAccessibilityHelpAction', "Show Accessibility Help"), original: 'Show Accessibility Help' },
|
||||
f1: true,
|
||||
keybinding: {
|
||||
primary: KeyMod.Alt | KeyCode.F1,
|
||||
weight: KeybindingWeight.EditorContrib,
|
||||
linux: {
|
||||
@@ -293,16 +296,26 @@ class ShowAccessibilityHelpAction extends EditorAction {
|
||||
});
|
||||
}
|
||||
|
||||
public run(accessor: ServicesAccessor, editor: ICodeEditor): void {
|
||||
let controller = AccessibilityHelpController.get(editor);
|
||||
if (controller) {
|
||||
controller.show();
|
||||
async run(accessor: ServicesAccessor): Promise<void> {
|
||||
const commandService = accessor.get(ICommandService);
|
||||
const editorService = accessor.get(ICodeEditorService);
|
||||
let activeEditor = editorService.getActiveCodeEditor();
|
||||
if (!activeEditor) {
|
||||
await commandService.executeCommand(NEW_UNTITLED_FILE_COMMAND_ID);
|
||||
}
|
||||
activeEditor = editorService.getActiveCodeEditor();
|
||||
|
||||
if (activeEditor) {
|
||||
const controller = AccessibilityHelpController.get(activeEditor);
|
||||
if (controller) {
|
||||
controller.show();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerEditorContribution(AccessibilityHelpController.ID, AccessibilityHelpController);
|
||||
registerEditorAction(ShowAccessibilityHelpAction);
|
||||
registerAction2(ShowAccessibilityHelpAction);
|
||||
|
||||
const AccessibilityHelpCommand = EditorCommand.bindToContribution<AccessibilityHelpController>(AccessibilityHelpController.get);
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ class DiffEditorHelperContribution extends Disposable implements IDiffEditorCont
|
||||
[{
|
||||
label: nls.localize('removeTimeout', "Remove limit"),
|
||||
run: () => {
|
||||
this._configurationService.updateValue('diffEditor.maxComputationTime', 0, ConfigurationTarget.USER);
|
||||
this._configurationService.updateValue('diffEditor.maxComputationTime', 0);
|
||||
}
|
||||
}],
|
||||
{}
|
||||
|
||||
@@ -12,7 +12,7 @@ import { Delayer } from 'vs/base/common/async';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { FindReplaceState, FindReplaceStateChangedEvent } from 'vs/editor/contrib/find/findState';
|
||||
import { IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { SimpleButton, findCloseIcon, findNextMatchIcon, findPreviousMatchIcon, findReplaceIcon, findReplaceAllIcon } from 'vs/editor/contrib/find/findWidget';
|
||||
import { SimpleButton, findNextMatchIcon, findPreviousMatchIcon, findReplaceIcon, findReplaceAllIcon } from 'vs/editor/contrib/find/findWidget';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { editorWidgetBackground, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, inputBackground, inputBorder, inputForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationWarningForeground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
@@ -21,6 +21,7 @@ import { ContextScopedFindInput, ContextScopedReplaceInput } from 'vs/platform/b
|
||||
import { ReplaceInput, IReplaceInputStyles } from 'vs/base/browser/ui/findinput/replaceInput';
|
||||
import { ProgressBar } from 'vs/base/browser/ui/progressbar/progressbar';
|
||||
import { attachProgressBarStyler } from 'vs/platform/theme/common/styler';
|
||||
import { widgetClose } from 'vs/platform/theme/common/iconRegistry';
|
||||
|
||||
const NLS_FIND_INPUT_LABEL = nls.localize('label.find', "Find");
|
||||
const NLS_FIND_INPUT_PLACEHOLDER = nls.localize('placeholder.find', "Find");
|
||||
@@ -140,12 +141,13 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
this._findInput.setRegex(this._state.isRegex);
|
||||
this._findInput.setWholeWords(this._state.wholeWord);
|
||||
this._findInput.setCaseSensitive(this._state.matchCase);
|
||||
this._replaceInput.setPreserveCase(this._state.preserveCase);
|
||||
this.findFirst();
|
||||
}));
|
||||
|
||||
this.prevBtn = this._register(new SimpleButton({
|
||||
label: NLS_PREVIOUS_MATCH_BTN_LABEL,
|
||||
className: findPreviousMatchIcon.classNames,
|
||||
icon: findPreviousMatchIcon,
|
||||
onTrigger: () => {
|
||||
this.find(true);
|
||||
}
|
||||
@@ -153,7 +155,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
|
||||
this.nextBtn = this._register(new SimpleButton({
|
||||
label: NLS_NEXT_MATCH_BTN_LABEL,
|
||||
className: findNextMatchIcon.classNames,
|
||||
icon: findNextMatchIcon,
|
||||
onTrigger: () => {
|
||||
this.find(false);
|
||||
}
|
||||
@@ -161,7 +163,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
|
||||
const closeBtn = this._register(new SimpleButton({
|
||||
label: NLS_CLOSE_BTN_LABEL,
|
||||
className: findCloseIcon.classNames,
|
||||
icon: widgetClose,
|
||||
onTrigger: () => {
|
||||
this.hide();
|
||||
}
|
||||
@@ -219,7 +221,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
|
||||
this._replaceBtn = this._register(new SimpleButton({
|
||||
label: NLS_REPLACE_BTN_LABEL,
|
||||
className: findReplaceIcon.classNames,
|
||||
icon: findReplaceIcon,
|
||||
onTrigger: () => {
|
||||
this.replaceOne();
|
||||
}
|
||||
@@ -228,7 +230,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
// Replace all button
|
||||
this._replaceAllBtn = this._register(new SimpleButton({
|
||||
label: NLS_REPLACE_ALL_BTN_LABEL,
|
||||
className: findReplaceAllIcon.classNames,
|
||||
icon: findReplaceAllIcon,
|
||||
onTrigger: () => {
|
||||
this.replaceAll();
|
||||
}
|
||||
@@ -314,7 +316,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
this._replaceBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
|
||||
this._replaceAllBtn.setEnabled(this._isVisible && this._isReplaceVisible && findInputIsNonEmpty);
|
||||
|
||||
dom.toggleClass(this._domNode, 'replaceToggled', this._isReplaceVisible);
|
||||
this._domNode.classList.toggle('replaceToggled', this._isReplaceVisible);
|
||||
this._toggleReplaceBtn.setExpanded(this._isReplaceVisible);
|
||||
}
|
||||
|
||||
@@ -345,8 +347,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
this.updateButtons(this.foundMatch);
|
||||
|
||||
setTimeout(() => {
|
||||
dom.addClass(this._domNode, 'visible');
|
||||
dom.addClass(this._domNode, 'visible-transition');
|
||||
this._domNode.classList.add('visible', 'visible-transition');
|
||||
this._domNode.setAttribute('aria-hidden', 'false');
|
||||
this._findInput.select();
|
||||
}, 0);
|
||||
@@ -364,8 +365,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
this._isVisible = true;
|
||||
|
||||
setTimeout(() => {
|
||||
dom.addClass(this._domNode, 'visible');
|
||||
dom.addClass(this._domNode, 'visible-transition');
|
||||
this._domNode.classList.add('visible', 'visible-transition');
|
||||
this._domNode.setAttribute('aria-hidden', 'false');
|
||||
|
||||
this.focus();
|
||||
@@ -391,8 +391,7 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
}
|
||||
|
||||
setTimeout(() => {
|
||||
dom.addClass(this._domNode, 'visible');
|
||||
dom.addClass(this._domNode, 'visible-transition');
|
||||
this._domNode.classList.add('visible', 'visible-transition');
|
||||
this._domNode.setAttribute('aria-hidden', 'false');
|
||||
this._updateButtons();
|
||||
|
||||
@@ -402,13 +401,13 @@ export abstract class SimpleFindReplaceWidget extends Widget {
|
||||
|
||||
public hide(): void {
|
||||
if (this._isVisible) {
|
||||
dom.removeClass(this._domNode, 'visible-transition');
|
||||
this._domNode.classList.remove('visible-transition');
|
||||
this._domNode.setAttribute('aria-hidden', 'true');
|
||||
// Need to delay toggling visibility until after Transition, then visibility hidden - removes from tabIndex list
|
||||
setTimeout(() => {
|
||||
this._isVisible = false;
|
||||
this.updateButtons(this.foundMatch);
|
||||
dom.removeClass(this._domNode, 'visible');
|
||||
this._domNode.classList.remove('visible');
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
@@ -454,6 +453,6 @@ registerThemingParticipant((theme, collector) => {
|
||||
|
||||
const widgetShadowColor = theme.getColor(widgetShadow);
|
||||
if (widgetShadowColor) {
|
||||
collector.addRule(`.monaco-workbench .simple-fr-find-part-wrapper { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);
|
||||
collector.addRule(`.monaco-workbench .simple-fr-find-part-wrapper { box-shadow: 0 0 8px 2px ${widgetShadowColor}; }`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -12,12 +12,13 @@ import { Delayer } from 'vs/base/common/async';
|
||||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { FindReplaceState } from 'vs/editor/contrib/find/findState';
|
||||
import { IMessage as InputBoxMessage } from 'vs/base/browser/ui/inputbox/inputBox';
|
||||
import { SimpleButton, findPreviousMatchIcon, findNextMatchIcon, findCloseIcon } from 'vs/editor/contrib/find/findWidget';
|
||||
import { SimpleButton, findPreviousMatchIcon, findNextMatchIcon } from 'vs/editor/contrib/find/findWidget';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { IContextViewService } from 'vs/platform/contextview/browser/contextView';
|
||||
import { editorWidgetBackground, inputActiveOptionBorder, inputActiveOptionBackground, inputActiveOptionForeground, inputBackground, inputBorder, inputForeground, inputValidationErrorBackground, inputValidationErrorBorder, inputValidationErrorForeground, inputValidationInfoBackground, inputValidationInfoBorder, inputValidationInfoForeground, inputValidationWarningBackground, inputValidationWarningBorder, inputValidationWarningForeground, widgetShadow, editorWidgetForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
import { IColorTheme, registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
import { ContextScopedFindInput } from 'vs/platform/browser/contextScopedHistoryWidget';
|
||||
import { widgetClose } from 'vs/platform/theme/common/iconRegistry';
|
||||
|
||||
const NLS_FIND_INPUT_LABEL = nls.localize('label.find', "Find");
|
||||
const NLS_FIND_INPUT_PLACEHOLDER = nls.localize('placeholder.find', "Find");
|
||||
@@ -94,7 +95,7 @@ export abstract class SimpleFindWidget extends Widget {
|
||||
|
||||
this.prevBtn = this._register(new SimpleButton({
|
||||
label: NLS_PREVIOUS_MATCH_BTN_LABEL,
|
||||
className: findPreviousMatchIcon.classNames,
|
||||
icon: findPreviousMatchIcon,
|
||||
onTrigger: () => {
|
||||
this.find(true);
|
||||
}
|
||||
@@ -102,7 +103,7 @@ export abstract class SimpleFindWidget extends Widget {
|
||||
|
||||
this.nextBtn = this._register(new SimpleButton({
|
||||
label: NLS_NEXT_MATCH_BTN_LABEL,
|
||||
className: findNextMatchIcon.classNames,
|
||||
icon: findNextMatchIcon,
|
||||
onTrigger: () => {
|
||||
this.find(false);
|
||||
}
|
||||
@@ -110,7 +111,7 @@ export abstract class SimpleFindWidget extends Widget {
|
||||
|
||||
const closeBtn = this._register(new SimpleButton({
|
||||
label: NLS_CLOSE_BTN_LABEL,
|
||||
className: findCloseIcon.classNames,
|
||||
icon: widgetClose,
|
||||
onTrigger: () => {
|
||||
this.hide();
|
||||
}
|
||||
@@ -212,8 +213,7 @@ export abstract class SimpleFindWidget extends Widget {
|
||||
this.updateButtons(this.foundMatch);
|
||||
|
||||
setTimeout(() => {
|
||||
dom.addClass(this._innerDomNode, 'visible');
|
||||
dom.addClass(this._innerDomNode, 'visible-transition');
|
||||
this._innerDomNode.classList.add('visible', 'visible-transition');
|
||||
this._innerDomNode.setAttribute('aria-hidden', 'false');
|
||||
this._findInput.select();
|
||||
}, 0);
|
||||
@@ -227,21 +227,20 @@ export abstract class SimpleFindWidget extends Widget {
|
||||
this._isVisible = true;
|
||||
|
||||
setTimeout(() => {
|
||||
dom.addClass(this._innerDomNode, 'visible');
|
||||
dom.addClass(this._innerDomNode, 'visible-transition');
|
||||
this._innerDomNode.classList.add('visible', 'visible-transition');
|
||||
this._innerDomNode.setAttribute('aria-hidden', 'false');
|
||||
}, 0);
|
||||
}
|
||||
|
||||
public hide(): void {
|
||||
if (this._isVisible) {
|
||||
dom.removeClass(this._innerDomNode, 'visible-transition');
|
||||
this._innerDomNode.classList.remove('visible-transition');
|
||||
this._innerDomNode.setAttribute('aria-hidden', 'true');
|
||||
// Need to delay toggling visibility until after Transition, then visibility hidden - removes from tabIndex list
|
||||
setTimeout(() => {
|
||||
this._isVisible = false;
|
||||
this.updateButtons(this.foundMatch);
|
||||
dom.removeClass(this._innerDomNode, 'visible');
|
||||
this._innerDomNode.classList.remove('visible');
|
||||
}, 200);
|
||||
}
|
||||
}
|
||||
@@ -287,6 +286,6 @@ registerThemingParticipant((theme, collector) => {
|
||||
|
||||
const widgetShadowColor = theme.getColor(widgetShadow);
|
||||
if (widgetShadowColor) {
|
||||
collector.addRule(`.monaco-workbench .simple-find-part { box-shadow: 0 2px 8px ${widgetShadowColor}; }`);
|
||||
collector.addRule(`.monaco-workbench .simple-find-part { box-shadow: 0 0 8px 2px ${widgetShadowColor}; }`);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -31,10 +31,26 @@
|
||||
|
||||
.tiw-metadata-value {
|
||||
font-family: var(--monaco-monospace-font);
|
||||
text-align: right;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.tiw-metadata-values {
|
||||
list-style: none;
|
||||
max-height: 300px;
|
||||
overflow-y: auto;
|
||||
margin-right: -10px;
|
||||
padding-left: 0;
|
||||
}
|
||||
|
||||
.tiw-metadata-values > .tiw-metadata-value {
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.tiw-metadata-key {
|
||||
width: 1px;
|
||||
min-width: 150px;
|
||||
padding-right: 10px;
|
||||
white-space: nowrap;
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
|
||||
@@ -594,11 +594,17 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
theme.resolveScopes(definition, scopesDefinition);
|
||||
const matchingRule = scopesDefinition[property];
|
||||
if (matchingRule && scopesDefinition.scope) {
|
||||
const strScopes = Array.isArray(matchingRule.scope) ? matchingRule.scope.join(', ') : String(matchingRule.scope);
|
||||
const scopes = $('ul.tiw-metadata-values');
|
||||
const strScopes = Array.isArray(matchingRule.scope) ? matchingRule.scope : [String(matchingRule.scope)];
|
||||
|
||||
for (let strScope of strScopes) {
|
||||
scopes.appendChild($('li.tiw-metadata-value.tiw-metadata-scopes', undefined, strScope));
|
||||
}
|
||||
|
||||
elements.push(
|
||||
scopesDefinition.scope.join(' '),
|
||||
$('br'),
|
||||
$('code.tiw-theme-selector', undefined, strScopes, $('br'), JSON.stringify(matchingRule.settings, null, '\t')));
|
||||
scopes,
|
||||
$('code.tiw-theme-selector', undefined, JSON.stringify(matchingRule.settings, null, '\t')));
|
||||
return elements;
|
||||
}
|
||||
return elements;
|
||||
|
||||
@@ -9,7 +9,7 @@ import { EditorAction, ServicesAccessor, registerEditorAction } from 'vs/editor/
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { CATEGORIES, Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
|
||||
@@ -53,4 +53,4 @@ class InspectKeyMapJSON extends Action {
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(InspectKeyMapJSON), 'Developer: Inspect Key Mappings (JSON)', nls.localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"));
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(InspectKeyMapJSON), 'Developer: Inspect Key Mappings (JSON)', CATEGORIES.Developer.value);
|
||||
|
||||
@@ -11,7 +11,6 @@ import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
|
||||
import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
|
||||
|
||||
/**
|
||||
* Shows a message when opening a large file which has been memory optimized (and features disabled).
|
||||
@@ -24,14 +23,9 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC
|
||||
private readonly _editor: ICodeEditor,
|
||||
@INotificationService private readonly _notificationService: INotificationService,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService,
|
||||
@IStorageKeysSyncRegistryService storageKeysSyncRegistryService: IStorageKeysSyncRegistryService
|
||||
) {
|
||||
super();
|
||||
|
||||
// opt-in to syncing
|
||||
const neverShowAgainId = 'editor.contrib.largeFileOptimizationsWarner';
|
||||
storageKeysSyncRegistryService.registerStorageKey({ key: neverShowAgainId, version: 1 });
|
||||
|
||||
this._register(this._editor.onDidChangeModel((e) => {
|
||||
const model = this._editor.getModel();
|
||||
if (!model) {
|
||||
@@ -61,7 +55,7 @@ export class LargeFileOptimizationsWarner extends Disposable implements IEditorC
|
||||
});
|
||||
}
|
||||
}
|
||||
], { neverShowAgain: { id: neverShowAgainId } });
|
||||
], { neverShowAgain: { id: 'editor.contrib.largeFileOptimizationsWarner' } });
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IKeyMods, IQuickInputService } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IEditor } from 'vs/editor/common/editorCommon';
|
||||
import { IEditorService, SIDE_GROUP } from 'vs/workbench/services/editor/common/editorService';
|
||||
import { IRange } from 'vs/editor/common/core/range';
|
||||
import { AbstractGotoLineQuickAccessProvider } from 'vs/editor/contrib/quickAccess/gotoLineQuickAccess';
|
||||
@@ -17,6 +16,7 @@ import { Action2, registerAction2 } from 'vs/platform/actions/common/actions';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/editorNavigationQuickAccess';
|
||||
|
||||
export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
||||
|
||||
@@ -41,10 +41,12 @@ export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProv
|
||||
return this.editorService.activeTextEditorControl;
|
||||
}
|
||||
|
||||
protected gotoLocation(editor: IEditor, options: { range: IRange, keyMods: IKeyMods, forceSideBySide?: boolean, preserveFocus?: boolean }): void {
|
||||
protected gotoLocation(context: IQuickAccessTextEditorContext, options: { range: IRange, keyMods: IKeyMods, forceSideBySide?: boolean, preserveFocus?: boolean }): void {
|
||||
|
||||
// Check for sideBySide use
|
||||
if ((options.keyMods.ctrlCmd || options.forceSideBySide) && this.editorService.activeEditor) {
|
||||
context.restoreViewState?.(); // since we open to the side, restore view state in this editor
|
||||
|
||||
this.editorService.openEditor(this.editorService.activeEditor, {
|
||||
selection: options.range,
|
||||
pinned: options.keyMods.alt || this.configuration.openEditorPinned,
|
||||
@@ -54,7 +56,7 @@ export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProv
|
||||
|
||||
// Otherwise let parent handle it
|
||||
else {
|
||||
super.gotoLocation(editor, options);
|
||||
super.gotoLocation(context, options);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
|
||||
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { IQuickAccessTextEditorContext } from 'vs/editor/contrib/quickAccess/editorNavigationQuickAccess';
|
||||
|
||||
export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider {
|
||||
|
||||
@@ -42,11 +43,12 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
|
||||
//#region DocumentSymbols (text editor required)
|
||||
|
||||
protected provideWithTextEditor(editor: IEditor, picker: IQuickPick<IGotoSymbolQuickPickItem>, token: CancellationToken): IDisposable {
|
||||
protected provideWithTextEditor(context: IQuickAccessTextEditorContext, picker: IQuickPick<IGotoSymbolQuickPickItem>, token: CancellationToken): IDisposable {
|
||||
if (this.canPickFromTableOfContents()) {
|
||||
return this.doGetTableOfContentsPicks(picker);
|
||||
}
|
||||
return super.provideWithTextEditor(editor, picker, token);
|
||||
|
||||
return super.provideWithTextEditor(context, picker, token);
|
||||
}
|
||||
|
||||
private get configuration() {
|
||||
@@ -62,10 +64,12 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
return this.editorService.activeTextEditorControl;
|
||||
}
|
||||
|
||||
protected gotoLocation(editor: IEditor, options: { range: IRange, keyMods: IKeyMods, forceSideBySide?: boolean, preserveFocus?: boolean }): void {
|
||||
protected gotoLocation(context: IQuickAccessTextEditorContext, options: { range: IRange, keyMods: IKeyMods, forceSideBySide?: boolean, preserveFocus?: boolean }): void {
|
||||
|
||||
// Check for sideBySide use
|
||||
if ((options.keyMods.ctrlCmd || options.forceSideBySide) && this.editorService.activeEditor) {
|
||||
context.restoreViewState?.(); // since we open to the side, restore view state in this editor
|
||||
|
||||
this.editorService.openEditor(this.editorService.activeEditor, {
|
||||
selection: options.range,
|
||||
pinned: options.keyMods.alt || this.configuration.openEditorPinned,
|
||||
@@ -75,7 +79,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
|
||||
// Otherwise let parent handle it
|
||||
else {
|
||||
super.gotoLocation(editor, options);
|
||||
super.gotoLocation(context, options);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import { SaveReason } from 'vs/workbench/common/editor';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IWorkbenchContribution, Extensions as WorkbenchContributionsExtensions, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { getModifiedRanges } from 'vs/workbench/contrib/format/browser/formatModified';
|
||||
import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
|
||||
|
||||
@@ -287,8 +287,7 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
? setting
|
||||
: Object.keys(setting).filter(x => setting[x]);
|
||||
|
||||
const codeActionsOnSave = settingItems
|
||||
.map(x => new CodeActionKind(x));
|
||||
const codeActionsOnSave = this.createCodeActionsOnSave(settingItems);
|
||||
|
||||
if (!Array.isArray(setting)) {
|
||||
codeActionsOnSave.sort((a, b) => {
|
||||
@@ -319,6 +318,15 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
await this.applyOnSaveActions(textEditorModel, codeActionsOnSave, excludedActions, progress, token);
|
||||
}
|
||||
|
||||
private createCodeActionsOnSave(settingItems: readonly string[]): CodeActionKind[] {
|
||||
const kinds = settingItems.map(x => new CodeActionKind(x));
|
||||
|
||||
// Remove subsets
|
||||
return kinds.filter(kind => {
|
||||
return kinds.every(otherKind => otherKind.equals(kind) || !otherKind.contains(kind));
|
||||
});
|
||||
}
|
||||
|
||||
private async applyOnSaveActions(model: ITextModel, codeActionsOnSave: readonly CodeActionKind[], excludes: readonly CodeActionKind[], progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
|
||||
const getActionProgress = new class implements IProgress<CodeActionProvider> {
|
||||
@@ -344,7 +352,7 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
const actionsToRun = await this.getActionsToRun(model, codeActionKind, excludes, getActionProgress, token);
|
||||
try {
|
||||
for (const action of actionsToRun.validActions) {
|
||||
progress.report({ message: localize('codeAction.apply', "Applying code action '{0}'.", action.title) });
|
||||
progress.report({ message: localize('codeAction.apply', "Applying code action '{0}'.", action.action.title) });
|
||||
await this.instantiationService.invokeFunction(applyCodeAction, action);
|
||||
}
|
||||
} catch {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.suggest-input-container {
|
||||
padding: 4px;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
.suggest-input-container .monaco-editor-background,
|
||||
@@ -20,8 +20,7 @@
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
pointer-events: none;
|
||||
margin-top: 2px;
|
||||
margin-left: 1px;
|
||||
margin-top: 1px;
|
||||
}
|
||||
|
||||
.suggest-input-container .monaco-editor,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import 'vs/css!./suggestEnabledInput';
|
||||
import { $, Dimension, addClass, append, removeClass } from 'vs/base/browser/dom';
|
||||
import { $, Dimension, append } from 'vs/base/browser/dom';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { Color } from 'vs/base/common/color';
|
||||
import { Emitter, Event } from 'vs/base/common/event';
|
||||
@@ -152,11 +152,11 @@ export class SuggestEnabledInput extends Widget implements IThemable {
|
||||
|
||||
this._register((this.inputWidget.onDidFocusEditorText(() => {
|
||||
if (options.focusContextKey) { options.focusContextKey.set(true); }
|
||||
addClass(this.stylingContainer, 'synthetic-focus');
|
||||
this.stylingContainer.classList.add('synthetic-focus');
|
||||
})));
|
||||
this._register((this.inputWidget.onDidBlurEditorText(() => {
|
||||
if (options.focusContextKey) { options.focusContextKey.set(false); }
|
||||
removeClass(this.stylingContainer, 'synthetic-focus');
|
||||
this.stylingContainer.classList.remove('synthetic-focus');
|
||||
})));
|
||||
|
||||
const onKeyDownMonaco = Event.chain(this.inputWidget.onKeyDown);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
@@ -42,7 +42,7 @@ export class ToggleColumnSelectionAction extends Action {
|
||||
public async run(): Promise<any> {
|
||||
const oldValue = this._configurationService.getValue<boolean>('editor.columnSelection');
|
||||
const codeEditor = this._getCodeEditor();
|
||||
await this._configurationService.updateValue('editor.columnSelection', !oldValue, ConfigurationTarget.USER);
|
||||
await this._configurationService.updateValue('editor.columnSelection', !oldValue);
|
||||
const newValue = this._configurationService.getValue<boolean>('editor.columnSelection');
|
||||
if (!codeEditor || codeEditor !== this._getCodeEditor() || oldValue === newValue || !codeEditor.hasModel()) {
|
||||
return;
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { CATEGORIES, Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
|
||||
export class ToggleMinimapAction extends Action {
|
||||
public static readonly ID = 'editor.action.toggleMinimap';
|
||||
@@ -25,12 +25,12 @@ export class ToggleMinimapAction extends Action {
|
||||
|
||||
public run(): Promise<any> {
|
||||
const newValue = !this._configurationService.getValue<boolean>('editor.minimap.enabled');
|
||||
return this._configurationService.updateValue('editor.minimap.enabled', newValue, ConfigurationTarget.USER);
|
||||
return this._configurationService.updateValue('editor.minimap.enabled', newValue);
|
||||
}
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleMinimapAction), 'View: Toggle Minimap', nls.localize('view', "View"));
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleMinimapAction), 'View: Toggle Minimap', CATEGORIES.View.value);
|
||||
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
|
||||
@@ -7,9 +7,9 @@ import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
import { MenuId, MenuRegistry, SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IContextKey, IContextKeyService, RawContextKey } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
@@ -33,7 +33,7 @@ export class ToggleMultiCursorModifierAction extends Action {
|
||||
const editorConf = this.configurationService.getValue<{ multiCursorModifier: 'ctrlCmd' | 'alt' }>('editor');
|
||||
const newValue: 'ctrlCmd' | 'alt' = (editorConf.multiCursorModifier === 'ctrlCmd' ? 'alt' : 'ctrlCmd');
|
||||
|
||||
return this.configurationService.updateValue(ToggleMultiCursorModifierAction.multiCursorModifierConfigurationKey, newValue, ConfigurationTarget.USER);
|
||||
return this.configurationService.updateValue(ToggleMultiCursorModifierAction.multiCursorModifierConfigurationKey, newValue);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { CATEGORIES, Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
|
||||
export class ToggleRenderControlCharacterAction extends Action {
|
||||
|
||||
@@ -26,12 +26,12 @@ export class ToggleRenderControlCharacterAction extends Action {
|
||||
|
||||
public run(): Promise<any> {
|
||||
let newRenderControlCharacters = !this._configurationService.getValue<boolean>('editor.renderControlCharacters');
|
||||
return this._configurationService.updateValue('editor.renderControlCharacters', newRenderControlCharacters, ConfigurationTarget.USER);
|
||||
return this._configurationService.updateValue('editor.renderControlCharacters', newRenderControlCharacters);
|
||||
}
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleRenderControlCharacterAction), 'View: Toggle Control Characters', nls.localize('view', "View"));
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleRenderControlCharacterAction), 'View: Toggle Control Characters', CATEGORIES.View.value);
|
||||
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
|
||||
@@ -6,10 +6,10 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { /*MenuId, MenuRegistry,*/ SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { ConfigurationTarget, IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
// import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { CATEGORIES, Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
|
||||
export class ToggleRenderWhitespaceAction extends Action {
|
||||
|
||||
@@ -34,12 +34,12 @@ export class ToggleRenderWhitespaceAction extends Action {
|
||||
newRenderWhitespace = 'none';
|
||||
}
|
||||
|
||||
return this._configurationService.updateValue('editor.renderWhitespace', newRenderWhitespace, ConfigurationTarget.USER);
|
||||
return this._configurationService.updateValue('editor.renderWhitespace', newRenderWhitespace);
|
||||
}
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleRenderWhitespaceAction), 'View: Toggle Render Whitespace', nls.localize('view', "View"));
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleRenderWhitespaceAction), 'View: Toggle Render Whitespace', CATEGORIES.View.value);
|
||||
|
||||
/* {{SQL CARBON EDIT}} - Disable unused menu item
|
||||
MenuRegistry.appendMenuItem(MenuId.MenubarViewMenu, {
|
||||
|
||||
@@ -17,13 +17,13 @@ import { ITextResourceConfigurationService } from 'vs/editor/common/services/tex
|
||||
import { MenuId, MenuRegistry } from 'vs/platform/actions/common/actions';
|
||||
import { ContextKeyExpr, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
import { INotificationService } from 'vs/platform/notification/common/notification';
|
||||
import { DefaultSettingsEditorContribution } from 'vs/workbench/contrib/preferences/browser/preferencesEditor';
|
||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
|
||||
const transientWordWrapState = 'transientWordWrapState';
|
||||
const isWordWrapMinifiedKey = 'isWordWrapMinified';
|
||||
const isDominatedByLongLinesKey = 'isDominatedByLongLines';
|
||||
const inDiffEditorKey = 'inDiffEditor';
|
||||
|
||||
/**
|
||||
* State written/read by the toggle word wrap action and associated with a particular model.
|
||||
@@ -138,12 +138,6 @@ class ToggleWordWrapAction extends EditorAction {
|
||||
if (!editor.hasModel()) {
|
||||
return;
|
||||
}
|
||||
if (editor.getOption(EditorOption.inDiffEditor)) {
|
||||
// Cannot change wrapping settings inside the diff editor
|
||||
const notificationService = accessor.get(INotificationService);
|
||||
notificationService.info(nls.localize('wordWrap.notInDiffEditor', "Cannot toggle word wrap in a diff editor."));
|
||||
return;
|
||||
}
|
||||
|
||||
const textResourceConfigurationService = accessor.get(ITextResourceConfigurationService);
|
||||
const codeEditorService = accessor.get(ICodeEditorService);
|
||||
@@ -179,18 +173,16 @@ class ToggleWordWrapController extends Disposable implements IEditorContribution
|
||||
const wrappingInfo = options.get(EditorOption.wrappingInfo);
|
||||
const isWordWrapMinified = this.contextKeyService.createKey(isWordWrapMinifiedKey, wrappingInfo.isWordWrapMinified);
|
||||
const isDominatedByLongLines = this.contextKeyService.createKey(isDominatedByLongLinesKey, wrappingInfo.isDominatedByLongLines);
|
||||
const inDiffEditor = this.contextKeyService.createKey(inDiffEditorKey, options.get(EditorOption.inDiffEditor));
|
||||
let currentlyApplyingEditorConfig = false;
|
||||
|
||||
this._register(editor.onDidChangeConfiguration((e) => {
|
||||
if (!e.hasChanged(EditorOption.wrappingInfo) && !e.hasChanged(EditorOption.inDiffEditor)) {
|
||||
if (!e.hasChanged(EditorOption.wrappingInfo)) {
|
||||
return;
|
||||
}
|
||||
const options = this.editor.getOptions();
|
||||
const wrappingInfo = options.get(EditorOption.wrappingInfo);
|
||||
isWordWrapMinified.set(wrappingInfo.isWordWrapMinified);
|
||||
isDominatedByLongLines.set(wrappingInfo.isDominatedByLongLines);
|
||||
inDiffEditor.set(options.get(EditorOption.inDiffEditor));
|
||||
if (!currentlyApplyingEditorConfig) {
|
||||
// I am not the cause of the word wrap getting changed
|
||||
ensureWordWrapSettings();
|
||||
@@ -220,10 +212,6 @@ class ToggleWordWrapController extends Disposable implements IEditorContribution
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.editor.getOption(EditorOption.inDiffEditor)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!canToggleWordWrap(newModel.uri)) {
|
||||
return;
|
||||
}
|
||||
@@ -275,14 +263,11 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: TOGGLE_WORD_WRAP_ID,
|
||||
title: nls.localize('unwrapMinified', "Disable wrapping for this file"),
|
||||
icon: {
|
||||
id: 'codicon/word-wrap'
|
||||
}
|
||||
icon: Codicon.wordWrap
|
||||
},
|
||||
group: 'navigation',
|
||||
order: 1,
|
||||
when: ContextKeyExpr.and(
|
||||
ContextKeyExpr.not(inDiffEditorKey),
|
||||
ContextKeyExpr.has(isDominatedByLongLinesKey),
|
||||
ContextKeyExpr.has(isWordWrapMinifiedKey)
|
||||
)
|
||||
@@ -291,14 +276,12 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
|
||||
command: {
|
||||
id: TOGGLE_WORD_WRAP_ID,
|
||||
title: nls.localize('wrapMinified', "Enable wrapping for this file"),
|
||||
icon: {
|
||||
id: 'codicon/word-wrap'
|
||||
}
|
||||
icon: Codicon.wordWrap
|
||||
},
|
||||
group: 'navigation',
|
||||
order: 1,
|
||||
when: ContextKeyExpr.and(
|
||||
ContextKeyExpr.not(inDiffEditorKey),
|
||||
EditorContextKeys.inDiffEditor.negate(),
|
||||
ContextKeyExpr.has(isDominatedByLongLinesKey),
|
||||
ContextKeyExpr.not(isWordWrapMinifiedKey)
|
||||
)
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as os from 'os';
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { CATEGORIES, Extensions as ActionExtensions, IWorkbenchActionRegistry } from 'vs/workbench/common/actions';
|
||||
import { ITextMateService } from 'vs/workbench/services/textMate/common/textMateService';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
@@ -22,6 +20,7 @@ import { ITextModel } from 'vs/editor/common/model';
|
||||
import { Constants } from 'vs/base/common/uint';
|
||||
import { IHostService } from 'vs/workbench/services/host/browser/host';
|
||||
import { join } from 'vs/base/common/path';
|
||||
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
|
||||
|
||||
class StartDebugTextMate extends Action {
|
||||
|
||||
@@ -37,7 +36,8 @@ class StartDebugTextMate extends Action {
|
||||
@IModelService private readonly _modelService: IModelService,
|
||||
@IEditorService private readonly _editorService: IEditorService,
|
||||
@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,
|
||||
@IHostService private readonly _hostService: IHostService
|
||||
@IHostService private readonly _hostService: IHostService,
|
||||
@INativeWorkbenchEnvironmentService private readonly _environmentService: INativeWorkbenchEnvironmentService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
@@ -59,7 +59,7 @@ class StartDebugTextMate extends Action {
|
||||
}
|
||||
|
||||
public async run(): Promise<any> {
|
||||
const pathInTemp = join(os.tmpdir(), `vcode-tm-log-${generateUuid()}.txt`);
|
||||
const pathInTemp = join(this._environmentService.tmpDir.fsPath, `vcode-tm-log-${generateUuid()}.txt`);
|
||||
const logger = createRotatingLogger(`tm-log`, pathInTemp, 1024 * 1024 * 30, 1);
|
||||
const model = this._getOrCreateModel();
|
||||
const append = (str: string) => {
|
||||
@@ -70,7 +70,8 @@ class StartDebugTextMate extends Action {
|
||||
};
|
||||
await this._hostService.openWindow([{ fileUri: URI.file(pathInTemp) }], { forceNewWindow: true });
|
||||
const textEditorPane = await this._editorService.openEditor({
|
||||
resource: model.uri
|
||||
resource: model.uri,
|
||||
options: { pinned: true }
|
||||
});
|
||||
if (!textEditorPane) {
|
||||
return;
|
||||
@@ -104,4 +105,4 @@ class StartDebugTextMate extends Action {
|
||||
}
|
||||
|
||||
const registry = Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions);
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(StartDebugTextMate), 'Start Text Mate Syntax Grammar Logging', nls.localize({ key: 'developer', comment: ['A developer on Code itself or someone diagnosing issues in Code'] }, "Developer"));
|
||||
registry.registerWorkbenchAction(SyncActionDescriptor.from(StartDebugTextMate), 'Start Text Mate Syntax Grammar Logging', CATEGORIES.Developer.value);
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import './displayChangeRemeasureFonts';
|
||||
import './inputClipboardActions';
|
||||
import './selectionClipboard';
|
||||
import './sleepResumeRepaintMinimap';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { IMainProcessService } from 'vs/platform/ipc/electron-sandbox/mainProcessService';
|
||||
import { IDisplayMainService } from 'vs/platform/display/common/displayMainService';
|
||||
import { createChannelSender } from 'vs/base/parts/ipc/common/ipc';
|
||||
import { clearAllFontInfos } from 'vs/editor/browser/config/configuration';
|
||||
|
||||
class DisplayChangeRemeasureFonts extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@IMainProcessService mainProcessService: IMainProcessService
|
||||
) {
|
||||
super();
|
||||
const displayMainService = createChannelSender<IDisplayMainService>(mainProcessService.getChannel('display'));
|
||||
displayMainService.onDidDisplayChanged(() => {
|
||||
clearAllFontInfos();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IWorkbenchContributionsRegistry>(WorkbenchExtensions.Workbench).registerWorkbenchContribution(DisplayChangeRemeasureFonts, LifecyclePhase.Eventually);
|
||||
@@ -16,7 +16,7 @@ import { IEditorContribution, Handler } from 'vs/editor/common/editorCommon';
|
||||
import { EndOfLinePreference } from 'vs/editor/common/model';
|
||||
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
|
||||
import { SelectionClipboardContributionID } from 'vs/workbench/contrib/codeEditor/browser/selectionClipboard';
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
@@ -3,22 +3,22 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { LifecyclePhase } from 'vs/platform/lifecycle/common/lifecycle';
|
||||
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { Extensions as WorkbenchExtensions, IWorkbenchContribution, IWorkbenchContributionsRegistry } from 'vs/workbench/common/contributions';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { IElectronService } from 'vs/platform/electron/electron-sandbox/electron';
|
||||
import { INativeHostService } from 'vs/platform/native/electron-sandbox/native';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
class SleepResumeRepaintMinimap extends Disposable implements IWorkbenchContribution {
|
||||
|
||||
constructor(
|
||||
@ICodeEditorService codeEditorService: ICodeEditorService,
|
||||
@IElectronService electronService: IElectronService
|
||||
@INativeHostService nativeHostService: INativeHostService
|
||||
) {
|
||||
super();
|
||||
|
||||
this._register(electronService.onOSResume(() => {
|
||||
this._register(nativeHostService.onDidResumeOS(() => {
|
||||
codeEditorService.listCodeEditors().forEach(editor => editor.render(true));
|
||||
}));
|
||||
}
|
||||
|
||||
@@ -116,12 +116,12 @@ suite('Save Participants', function () {
|
||||
model.textEditorModel.pushEditOperations([new Selection(1, 14, 1, 14)], textEdits, () => { return [new Selection(1, 15, 1, 15)]; });
|
||||
|
||||
// undo
|
||||
model.textEditorModel.undo();
|
||||
await model.textEditorModel.undo();
|
||||
assert.equal(snapshotToString(model.createSnapshot()!), `${textContent}`);
|
||||
|
||||
// trim final new lines should not mess the undo stack
|
||||
await participant.participate(model, { reason: SaveReason.EXPLICIT });
|
||||
model.textEditorModel.redo();
|
||||
await model.textEditorModel.redo();
|
||||
assert.equal(snapshotToString(model.createSnapshot()!), `${textContent}.`);
|
||||
});
|
||||
|
||||
@@ -146,9 +146,9 @@ suite('Save Participants', function () {
|
||||
assert.equal(snapshotToString(model.createSnapshot()!), `${textContent}${eol}`);
|
||||
|
||||
// undo should go back to previous content immediately
|
||||
model.textEditorModel.undo();
|
||||
await model.textEditorModel.undo();
|
||||
assert.equal(snapshotToString(model.createSnapshot()!), `${textContent}${eol}${eol}`);
|
||||
model.textEditorModel.redo();
|
||||
await model.textEditorModel.redo();
|
||||
assert.equal(snapshotToString(model.createSnapshot()!), `${textContent}${eol}`);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user