mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Merge pull request #55073 from JacksonKearl/simplewidget-refactoring
Refactor simple widget editor config files
This commit is contained in:
commit
8faec97167
|
@ -14,7 +14,7 @@ import { SuggestController } from 'vs/editor/contrib/suggest/suggestController';
|
|||
import { SnippetController2 } from 'vs/editor/contrib/snippet/snippetController2';
|
||||
import { TabCompletionController } from 'vs/workbench/parts/snippets/electron-browser/tabCompletion';
|
||||
|
||||
export class SimpleDebugEditor {
|
||||
export class SimpleEditorWidgetConfig {
|
||||
|
||||
public static getCodeEditorWidgetOptions(): ICodeEditorWidgetOptions {
|
||||
return {
|
|
@ -17,7 +17,7 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
|
|||
import { IDebugService, IBreakpoint, BreakpointWidgetContext as Context, CONTEXT_BREAKPOINT_WIDGET_VISIBLE, DEBUG_SCHEME, IDebugEditorContribution, EDITOR_CONTRIBUTION_ID, CONTEXT_IN_BREAKPOINT_WIDGET } from 'vs/workbench/parts/debug/common/debug';
|
||||
import { attachSelectBoxStyler } from 'vs/platform/theme/common/styler';
|
||||
import { IThemeService } from 'vs/platform/theme/common/themeService';
|
||||
import { SimpleDebugEditor } from 'vs/workbench/parts/debug/electron-browser/simpleDebugEditor';
|
||||
import { SimpleEditorWidgetConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleEditorWidgetConfig';
|
||||
import { createDecorator, IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ServicesAccessor, EditorCommand, registerEditorCommand } from 'vs/editor/browser/editorExtensions';
|
||||
|
@ -200,8 +200,8 @@ export class BreakpointWidget extends ZoneWidget implements IPrivateBreakpointWi
|
|||
const scopedInstatiationService = this.instantiationService.createChild(new ServiceCollection(
|
||||
[IContextKeyService, scopedContextKeyService], [IPrivateBreakpointWidgetService, this]));
|
||||
|
||||
const options = SimpleDebugEditor.getEditorOptions();
|
||||
const codeEditorWidgetOptions = SimpleDebugEditor.getCodeEditorWidgetOptions();
|
||||
const options = SimpleEditorWidgetConfig.getEditorOptions();
|
||||
const codeEditorWidgetOptions = SimpleEditorWidgetConfig.getCodeEditorWidgetOptions();
|
||||
this.input = scopedInstatiationService.createInstance(CodeEditorWidget, container, options, codeEditorWidgetOptions);
|
||||
CONTEXT_IN_BREAKPOINT_WIDGET.bindTo(scopedContextKeyService).set(true);
|
||||
const model = this.modelService.createModel('', null, uri.parse(`${DEBUG_SCHEME}:${this.editor.getId()}:breakpointinput`), true);
|
||||
|
|
|
@ -30,7 +30,7 @@ import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
|||
import { IInstantiationService, createDecorator } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
|
||||
import { ReplExpressionsRenderer, ReplExpressionsController, ReplExpressionsDataSource, ReplExpressionsActionProvider, ReplExpressionsAccessibilityProvider } from 'vs/workbench/parts/debug/electron-browser/replViewer';
|
||||
import { SimpleDebugEditor } from 'vs/workbench/parts/debug/electron-browser/simpleDebugEditor';
|
||||
import { SimpleEditorWidgetConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleEditorWidgetConfig';
|
||||
import { ClearReplAction } from 'vs/workbench/parts/debug/browser/debugActions';
|
||||
import { Panel } from 'vs/workbench/browser/panel';
|
||||
import { IPanelService } from 'vs/workbench/services/panel/common/panelService';
|
||||
|
@ -173,7 +173,7 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
|
|||
|
||||
const scopedInstantiationService = this.instantiationService.createChild(new ServiceCollection(
|
||||
[IContextKeyService, scopedContextKeyService], [IPrivateReplService, this]));
|
||||
this.replInput = scopedInstantiationService.createInstance(CodeEditorWidget, this.replInputContainer, SimpleDebugEditor.getEditorOptions(), SimpleDebugEditor.getCodeEditorWidgetOptions());
|
||||
this.replInput = scopedInstantiationService.createInstance(CodeEditorWidget, this.replInputContainer, SimpleEditorWidgetConfig.getEditorOptions(), SimpleEditorWidgetConfig.getCodeEditorWidgetOptions());
|
||||
|
||||
modes.SuggestRegistry.register({ scheme: DEBUG_SCHEME, pattern: '**/replinput', hasAccessToAllModels: true }, {
|
||||
triggerCharacters: ['.'],
|
||||
|
|
|
@ -61,11 +61,11 @@ import { SingleServerExtensionManagementServerService } from 'vs/workbench/servi
|
|||
import { Query } from 'vs/workbench/parts/extensions/common/extensionQuery';
|
||||
import { CodeEditorWidget } from 'vs/editor/browser/widget/codeEditorWidget';
|
||||
import { IModelService } from 'vs/editor/common/services/modelService';
|
||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { SimpleDebugEditor } from 'vs/workbench/parts/debug/electron-browser/simpleDebugEditor';
|
||||
import { SimpleEditorWidgetConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleEditorWidgetConfig';
|
||||
import { IEditorOptions } from 'vs/editor/common/config/editorOptions';
|
||||
|
||||
interface SearchInputEvent extends Event {
|
||||
target: HTMLInputElement;
|
||||
|
@ -340,7 +340,10 @@ export class ExtensionsViewlet extends ViewContainerViewlet implements IExtensio
|
|||
|
||||
const header = append(this.root, $('.header'));
|
||||
this.monacoStyleContainer = append(header, $('.monaco-container'));
|
||||
this.searchBox = this.instantiationService.createInstance(CodeEditorWidget, this.monacoStyleContainer, SEARCH_INPUT_OPTIONS, SimpleDebugEditor.getCodeEditorWidgetOptions());
|
||||
this.searchBox = this.instantiationService.createInstance(CodeEditorWidget, this.monacoStyleContainer,
|
||||
mixinHTMLInputStyleOptions(SimpleEditorWidgetConfig.getEditorOptions(), localize('searchExtensions', "Search Extensions in Marketplace")),
|
||||
SimpleEditorWidgetConfig.getCodeEditorWidgetOptions());
|
||||
|
||||
this.placeholderText = append(this.monacoStyleContainer, $('.search-placeholder', null, localize('searchExtensions', "Search Extensions in Marketplace")));
|
||||
|
||||
this.extensionsBox = append(this.root, $('.extensions'));
|
||||
|
@ -665,32 +668,13 @@ export class MaliciousExtensionChecker implements IWorkbenchContribution {
|
|||
}
|
||||
}
|
||||
|
||||
let SEARCH_INPUT_OPTIONS: IEditorOptions =
|
||||
{
|
||||
fontSize: 13,
|
||||
lineHeight: 22,
|
||||
wordWrap: 'off',
|
||||
overviewRulerLanes: 0,
|
||||
glyphMargin: false,
|
||||
lineNumbers: 'off',
|
||||
folding: false,
|
||||
selectOnLineNumbers: false,
|
||||
hideCursorInOverviewRuler: true,
|
||||
selectionHighlight: false,
|
||||
scrollbar: {
|
||||
horizontal: 'hidden',
|
||||
vertical: 'hidden'
|
||||
},
|
||||
ariaLabel: localize('searchExtensions', "Search Extensions in Marketplace"),
|
||||
cursorWidth: 1,
|
||||
lineDecorationsWidth: 0,
|
||||
overviewRulerBorder: false,
|
||||
scrollBeyondLastLine: false,
|
||||
renderLineHighlight: 'none',
|
||||
fixedOverflowWidgets: true,
|
||||
acceptSuggestionOnEnter: 'smart',
|
||||
minimap: {
|
||||
enabled: false
|
||||
},
|
||||
fontFamily: ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif'
|
||||
};
|
||||
function mixinHTMLInputStyleOptions(config: IEditorOptions, ariaLabel?: string): IEditorOptions {
|
||||
config.fontSize = 13;
|
||||
config.lineHeight = 22;
|
||||
config.wordWrap = 'off';
|
||||
config.scrollbar.vertical = 'hidden';
|
||||
config.ariaLabel = ariaLabel || '';
|
||||
config.cursorWidth = 1;
|
||||
config.fontFamily = ' -apple-system, BlinkMacSystemFont, "Segoe WPC", "Segoe UI", "HelveticaNeue-Light", "Ubuntu", "Droid Sans", sans-serif';
|
||||
return config;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue