mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Renaming and pull text HTML style config out to extensions file
This commit is contained in:
parent
e6e83fec4a
commit
aec78631e9
|
@ -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 SimpleWidgetEditorConfig {
|
||||
export class SimpleEditorWidgetConfig {
|
||||
|
||||
public static getCodeEditorWidgetOptions(): ICodeEditorWidgetOptions {
|
||||
return {
|
||||
|
@ -54,35 +54,4 @@ export class SimpleWidgetEditorConfig {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
public static getEditorAsInputBoxOptions(ariaLabel?: string): IEditorOptions {
|
||||
return {
|
||||
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: ariaLabel || '',
|
||||
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'
|
||||
};
|
||||
}
|
||||
}
|
|
@ -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 { SimpleWidgetEditorConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleWidgetEditor';
|
||||
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 = SimpleWidgetEditorConfig.getEditorOptions();
|
||||
const codeEditorWidgetOptions = SimpleWidgetEditorConfig.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 { SimpleWidgetEditorConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleWidgetEditor';
|
||||
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, SimpleWidgetEditorConfig.getEditorOptions(), SimpleWidgetEditorConfig.getCodeEditorWidgetOptions());
|
||||
this.replInput = scopedInstantiationService.createInstance(CodeEditorWidget, this.replInputContainer, SimpleEditorWidgetConfig.getEditorOptions(), SimpleEditorWidgetConfig.getCodeEditorWidgetOptions());
|
||||
|
||||
modes.SuggestRegistry.register({ scheme: DEBUG_SCHEME, pattern: '**/replinput', hasAccessToAllModels: true }, {
|
||||
triggerCharacters: ['.'],
|
||||
|
|
|
@ -64,7 +64,8 @@ import { IModelService } from 'vs/editor/common/services/modelService';
|
|||
import { Range } from 'vs/editor/common/core/range';
|
||||
import { Position } from 'vs/editor/common/core/position';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { SimpleWidgetEditorConfig } from 'vs/workbench/parts/codeEditor/electron-browser/simpleWidgetEditor';
|
||||
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,8 +341,8 @@ 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,
|
||||
SimpleWidgetEditorConfig.getEditorAsInputBoxOptions(localize('searchExtensions', "Search Extensions in Marketplace")),
|
||||
SimpleWidgetEditorConfig.getCodeEditorWidgetOptions());
|
||||
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")));
|
||||
|
||||
|
@ -667,3 +668,13 @@ export class MaliciousExtensionChecker implements IWorkbenchContribution {
|
|||
}
|
||||
}
|
||||
|
||||
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