Merge from vscode 817eb6b0c720a4ecbc13c020afbbebfed667aa09 (#7356)
@@ -70,8 +70,8 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC
|
||||
return Object.keys(this._diffEditors).map(id => this._diffEditors[id]);
|
||||
}
|
||||
|
||||
getFocusedCodeEditor(): ICodeEditor | null {
|
||||
let editorWithWidgetFocus: ICodeEditor | null = null;
|
||||
getFocusedCodeEditor(): ICodeEditor | undefined {
|
||||
let editorWithWidgetFocus: ICodeEditor | undefined;
|
||||
|
||||
const editors = this.listCodeEditors();
|
||||
for (const editor of editors) {
|
||||
@@ -124,8 +124,8 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC
|
||||
delete this._transientWatchers[w.uri];
|
||||
}
|
||||
|
||||
abstract getActiveCodeEditor(): ICodeEditor | null;
|
||||
abstract openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;
|
||||
abstract getActiveCodeEditor(): ICodeEditor | undefined;
|
||||
abstract openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined>;
|
||||
}
|
||||
|
||||
export class ModelTransientSettingWatcher {
|
||||
|
||||
@@ -26,16 +26,17 @@ export interface ICodeEditorService {
|
||||
|
||||
addCodeEditor(editor: ICodeEditor): void;
|
||||
removeCodeEditor(editor: ICodeEditor): void;
|
||||
listCodeEditors(): ICodeEditor[];
|
||||
listCodeEditors(): readonly ICodeEditor[];
|
||||
|
||||
addDiffEditor(editor: IDiffEditor): void;
|
||||
removeDiffEditor(editor: IDiffEditor): void;
|
||||
listDiffEditors(): IDiffEditor[];
|
||||
listDiffEditors(): readonly IDiffEditor[];
|
||||
|
||||
/**
|
||||
* Returns the current focused code editor (if the focus is in the editor or in an editor widget) or null.
|
||||
* Returns the current focused code editor (if the focus is in the editor or in an editor widget) or
|
||||
* `undefined` if none.
|
||||
*/
|
||||
getFocusedCodeEditor(): ICodeEditor | null;
|
||||
getFocusedCodeEditor(): ICodeEditor | undefined;
|
||||
|
||||
registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void;
|
||||
removeDecorationType(key: string): void;
|
||||
@@ -44,6 +45,6 @@ export interface ICodeEditorService {
|
||||
setTransientModelProperty(model: ITextModel, key: string, value: any): void;
|
||||
getTransientModelProperty(model: ITextModel, key: string): any;
|
||||
|
||||
getActiveCodeEditor(): ICodeEditor | null;
|
||||
openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;
|
||||
getActiveCodeEditor(): ICodeEditor | undefined;
|
||||
openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined>;
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ export abstract class CodeEditorServiceImpl extends AbstractCodeEditorService {
|
||||
return provider.getOptions(this, writable);
|
||||
}
|
||||
|
||||
abstract getActiveCodeEditor(): ICodeEditor | null;
|
||||
abstract openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null>;
|
||||
abstract getActiveCodeEditor(): ICodeEditor | undefined;
|
||||
abstract openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined>;
|
||||
}
|
||||
|
||||
interface IModelDecorationOptionsProvider extends IDisposable {
|
||||
|
||||
@@ -13,7 +13,7 @@ import { equalsIgnoreCase } from 'vs/base/common/strings';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService';
|
||||
import { CommandsRegistry, ICommandService } from 'vs/platform/commands/common/commands';
|
||||
import { IOpener, IOpenerService, IValidator, IExternalUriResolver } from 'vs/platform/opener/common/opener';
|
||||
import { IOpener, IOpenerService, IValidator, IExternalUriResolver, OpenOptions } from 'vs/platform/opener/common/opener';
|
||||
|
||||
export class OpenerService extends Disposable implements IOpenerService {
|
||||
|
||||
@@ -45,7 +45,7 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
return { dispose: remove };
|
||||
}
|
||||
|
||||
async open(resource: URI, options?: { openToSide?: boolean, openExternal?: boolean }): Promise<boolean> {
|
||||
async open(resource: URI, options?: OpenOptions): Promise<boolean> {
|
||||
// no scheme ?!?
|
||||
if (!resource.scheme) {
|
||||
return Promise.resolve(false);
|
||||
@@ -65,22 +65,33 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// use default openers
|
||||
return this._doOpen(resource, options);
|
||||
}
|
||||
|
||||
private _doOpen(resource: URI, options?: { openToSide?: boolean, openExternal?: boolean }): Promise<boolean> {
|
||||
public async resolveExternalUri(resource: URI, options?: { readonly allowTunneling?: boolean }): Promise<{ resolved: URI, dispose(): void }> {
|
||||
for (const resolver of this._resolvers.toArray()) {
|
||||
const result = await resolver.resolveExternalUri(resource, options);
|
||||
if (result) {
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return { resolved: resource, dispose: () => { } };
|
||||
}
|
||||
|
||||
private _doOpen(resource: URI, options: OpenOptions | undefined): Promise<boolean> {
|
||||
|
||||
const { scheme, path, query, fragment } = resource;
|
||||
|
||||
if (equalsIgnoreCase(scheme, Schemas.mailto) || (options && options.openExternal)) {
|
||||
// open default mail application
|
||||
return this._doOpenExternal(resource);
|
||||
return this._doOpenExternal(resource, options);
|
||||
}
|
||||
|
||||
if (equalsIgnoreCase(scheme, Schemas.http) || equalsIgnoreCase(scheme, Schemas.https)) {
|
||||
// open link in default browser
|
||||
return this._doOpenExternal(resource);
|
||||
return this._doOpenExternal(resource, options);
|
||||
} else if (equalsIgnoreCase(scheme, Schemas.command)) {
|
||||
// run command or bail out if command isn't known
|
||||
if (!CommandsRegistry.getCommand(path)) {
|
||||
@@ -124,13 +135,9 @@ export class OpenerService extends Disposable implements IOpenerService {
|
||||
}
|
||||
}
|
||||
|
||||
private async _doOpenExternal(resource: URI): Promise<boolean> {
|
||||
for (const resolver of this._resolvers.toArray()) {
|
||||
resource = await resolver.resolveExternalUri(resource);
|
||||
}
|
||||
|
||||
dom.windowOpenNoOpener(encodeURI(resource.toString(true)));
|
||||
|
||||
private async _doOpenExternal(resource: URI, options: OpenOptions | undefined): Promise<boolean> {
|
||||
const { resolved } = await this.resolveExternalUri(resource, options);
|
||||
dom.windowOpenNoOpener(encodeURI(resolved.toString(true)));
|
||||
return Promise.resolve(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -737,7 +737,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
);
|
||||
}
|
||||
|
||||
public setSelections(ranges: ISelection[], source: string = 'api'): void {
|
||||
public setSelections(ranges: readonly ISelection[], source: string = 'api'): void {
|
||||
if (!this._modelData) {
|
||||
return;
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
}
|
||||
|
||||
public hasWidgetFocus(): boolean {
|
||||
return (this._editorWidgetFocus.getValue() === BooleanEventValue.True);
|
||||
return this._focusTracker && this._focusTracker.hasFocus();
|
||||
}
|
||||
|
||||
public addContentWidget(widget: editorBrowser.IContentWidget): void {
|
||||
@@ -1452,13 +1452,8 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
||||
}
|
||||
|
||||
const viewOutgoingEvents = new ViewOutgoingEvents(viewModel);
|
||||
viewOutgoingEvents.onDidGainFocus = () => {
|
||||
this._editorTextFocus.setValue(true);
|
||||
// In IE, the focus is not synchronous, so we give it a little help
|
||||
this._editorWidgetFocus.setValue(true);
|
||||
};
|
||||
|
||||
viewOutgoingEvents.onDidScroll = (e) => this._onDidScrollChange.fire(e);
|
||||
viewOutgoingEvents.onDidGainFocus = () => this._editorTextFocus.setValue(true);
|
||||
viewOutgoingEvents.onDidLoseFocus = () => this._editorTextFocus.setValue(false);
|
||||
viewOutgoingEvents.onContextMenu = (e) => this._onContextMenu.fire(e);
|
||||
viewOutgoingEvents.onMouseDown = (e) => this._onMouseDown.fire(e);
|
||||
@@ -1548,10 +1543,6 @@ export class BooleanEventEmitter extends Disposable {
|
||||
this._value = BooleanEventValue.NotSet;
|
||||
}
|
||||
|
||||
public getValue(): BooleanEventValue {
|
||||
return this._value;
|
||||
}
|
||||
|
||||
public setValue(_value: boolean) {
|
||||
const value = (_value ? BooleanEventValue.True : BooleanEventValue.False);
|
||||
if (this._value === value) {
|
||||
|
||||
@@ -728,7 +728,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
|
||||
this.modifiedEditor.setSelection(something);
|
||||
}
|
||||
|
||||
public setSelections(ranges: ISelection[]): void {
|
||||
public setSelections(ranges: readonly ISelection[]): void {
|
||||
this.modifiedEditor.setSelections(ranges);
|
||||
}
|
||||
|
||||
|
||||
@@ -424,7 +424,7 @@ export class Cursor extends viewEvents.ViewEventEmitter implements ICursors {
|
||||
return this._cursors.getPrimaryCursor().modelState.position;
|
||||
}
|
||||
|
||||
public setSelections(source: string, selections: ISelection[]): void {
|
||||
public setSelections(source: string, selections: readonly ISelection[]): void {
|
||||
this.setStates(source, CursorChangeReason.NotSet, CursorState.fromModelSelections(selections));
|
||||
}
|
||||
|
||||
|
||||
@@ -460,7 +460,7 @@ export class CursorState {
|
||||
return CursorState.fromModelState(modelState);
|
||||
}
|
||||
|
||||
public static fromModelSelections(modelSelections: ISelection[]): PartialModelCursorState[] {
|
||||
public static fromModelSelections(modelSelections: readonly ISelection[]): PartialModelCursorState[] {
|
||||
let states: PartialModelCursorState[] = [];
|
||||
for (let i = 0, len = modelSelections.length; i < len; i++) {
|
||||
states[i] = this.fromModelSelection(modelSelections[i]);
|
||||
|
||||
@@ -389,7 +389,7 @@ export interface IEditor {
|
||||
* Set the selections for all the cursors of the editor.
|
||||
* Cursors will be removed or added, as necessary.
|
||||
*/
|
||||
setSelections(selections: ISelection[]): void;
|
||||
setSelections(selections: readonly ISelection[]): void;
|
||||
|
||||
/**
|
||||
* Scroll vertically as necessary and reveal lines.
|
||||
|
||||
@@ -32,9 +32,6 @@ export class LanguageFeatureRegistry<T> {
|
||||
private readonly _entries: Entry<T>[] = [];
|
||||
private readonly _onDidChange = new Emitter<number>();
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
get onDidChange(): Event<number> {
|
||||
return this._onDidChange.event;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import { FrankensteinMode } from 'vs/editor/common/modes/abstractMode';
|
||||
import { NULL_LANGUAGE_IDENTIFIER } from 'vs/editor/common/modes/nullMode';
|
||||
import { LanguagesRegistry } from 'vs/editor/common/services/languagesRegistry';
|
||||
import { ILanguageSelection, IModeService } from 'vs/editor/common/services/modeService';
|
||||
import { firstOrDefault } from 'vs/base/common/arrays';
|
||||
|
||||
class LanguageSelection extends Disposable implements ILanguageSelection {
|
||||
|
||||
@@ -96,22 +97,12 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
public getModeIdByFilepathOrFirstLine(resource: URI | null, firstLine?: string): string | null {
|
||||
const modeIds = this._registry.getModeIdsFromFilepathOrFirstLine(resource, firstLine);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
return firstOrDefault(modeIds, null);
|
||||
}
|
||||
|
||||
public getModeId(commaSeparatedMimetypesOrCommaSeparatedIds: string | undefined): string | null {
|
||||
const modeIds = this._registry.extractModeIds(commaSeparatedMimetypesOrCommaSeparatedIds);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
return firstOrDefault(modeIds, null);
|
||||
}
|
||||
|
||||
public getLanguageIdentifier(modeId: string | LanguageId): LanguageIdentifier | null {
|
||||
@@ -164,12 +155,7 @@ export class ModeServiceImpl implements IModeService {
|
||||
|
||||
private _getModeIdByLanguageName(languageName: string): string | null {
|
||||
const modeIds = this._registry.getModeIdsFromLanguageName(languageName);
|
||||
|
||||
if (modeIds.length > 0) {
|
||||
return modeIds[0];
|
||||
}
|
||||
|
||||
return null;
|
||||
return firstOrDefault(modeIds, null);
|
||||
}
|
||||
|
||||
private _getOrCreateMode(modeId: string): IMode {
|
||||
|
||||
@@ -19,7 +19,7 @@ export class MinimapTokensColorTracker {
|
||||
private _colors!: RGBA8[];
|
||||
private _backgroundIsLight!: boolean;
|
||||
|
||||
private _onDidChange = new Emitter<void>();
|
||||
private readonly _onDidChange = new Emitter<void>();
|
||||
public readonly onDidChange: Event<void> = this._onDidChange.event;
|
||||
|
||||
private constructor() {
|
||||
|
||||
@@ -244,9 +244,6 @@ export class ViewTokensChangedEvent {
|
||||
export class ViewThemeChangedEvent {
|
||||
|
||||
public readonly type = ViewEventType.ViewThemeChanged;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export class ViewTokensColorsChangedEvent {
|
||||
@@ -270,9 +267,6 @@ export class ViewZonesChangedEvent {
|
||||
export class ViewLanguageConfigurationEvent {
|
||||
|
||||
public readonly type = ViewEventType.ViewLanguageConfigurationChanged;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
}
|
||||
|
||||
export type ViewEvent = (
|
||||
|
||||
@@ -1401,9 +1401,6 @@ class OverviewRulerDecorations {
|
||||
|
||||
readonly result: IOverviewRulerDecorations = Object.create(null);
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public accept(color: string, startLineNumber: number, endLineNumber: number, lane: number): void {
|
||||
let prev = this.result[color];
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.monaco-editor .lightbulb-glyph {
|
||||
.monaco-editor .codicon-lightbulb {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -12,25 +12,7 @@
|
||||
padding-left: 2px;
|
||||
}
|
||||
|
||||
.monaco-editor .lightbulb-glyph:hover {
|
||||
.monaco-editor .codicon-lightbulb:hover {
|
||||
cursor: pointer;
|
||||
/* transform: scale(1.3, 1.3); */
|
||||
}
|
||||
|
||||
.monaco-editor.vs .lightbulb-glyph {
|
||||
background: url('lightbulb-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor.vs .lightbulb-glyph.autofixable {
|
||||
background: url('lightbulb-autofix-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor.vs-dark .lightbulb-glyph,
|
||||
.monaco-editor.hc-black .lightbulb-glyph {
|
||||
background: url('lightbulb-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor.vs-dark .lightbulb-glyph.autofixable,
|
||||
.monaco-editor.hc-black .lightbulb-glyph.autofixable {
|
||||
background: url('lightbulb-autofix-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
@@ -15,6 +15,8 @@ import { CodeActionSet } from 'vs/editor/contrib/codeAction/codeAction';
|
||||
import * as nls from 'vs/nls';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
import { registerThemingParticipant, ITheme, ICssStyleCollector } from 'vs/platform/theme/common/themeService';
|
||||
import { editorLightBulbForeground, editorLightBulbAutoFixForeground } from 'vs/platform/theme/common/colorRegistry';
|
||||
|
||||
namespace LightBulbState {
|
||||
|
||||
@@ -57,7 +59,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
) {
|
||||
super();
|
||||
this._domNode = document.createElement('div');
|
||||
this._domNode.className = 'lightbulb-glyph';
|
||||
this._domNode.className = 'codicon codicon-lightbulb';
|
||||
|
||||
this._editor.addContentWidget(this);
|
||||
|
||||
@@ -175,7 +177,7 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
position: { lineNumber: effectiveLineNumber, column: 1 },
|
||||
preference: LightBulbWidget._posPref
|
||||
});
|
||||
dom.toggleClass(this._domNode, 'autofixable', actions.hasAutoFix);
|
||||
dom.toggleClass(this._domNode, 'codicon-lightbulb-autofix', actions.hasAutoFix);
|
||||
this._editor.layoutContentWidget(this);
|
||||
}
|
||||
|
||||
@@ -199,3 +201,27 @@ export class LightBulbWidget extends Disposable implements IContentWidget {
|
||||
this.title = title;
|
||||
}
|
||||
}
|
||||
|
||||
registerThemingParticipant((theme: ITheme, collector: ICssStyleCollector) => {
|
||||
|
||||
// Lightbulb Icon
|
||||
const editorLightBulbForegroundColor = theme.getColor(editorLightBulbForeground);
|
||||
if (editorLightBulbForegroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .contentWidgets .codicon-lightbulb,
|
||||
.monaco-workbench .markers-panel-container .codicon-lightbulb {
|
||||
color: ${editorLightBulbForegroundColor};
|
||||
}`);
|
||||
}
|
||||
|
||||
// Lightbulb Auto Fix Icon
|
||||
const editorLightBulbAutoFixForegroundColor = theme.getColor(editorLightBulbAutoFixForeground);
|
||||
if (editorLightBulbAutoFixForegroundColor) {
|
||||
collector.addRule(`
|
||||
.monaco-workbench .contentWidgets .codicon-lightbulb-autofix,
|
||||
.monaco-workbench .markers-panel-container .codicon-lightbulb-autofix {
|
||||
color: ${editorLightBulbAutoFixForegroundColor};
|
||||
}`);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 9C10.3304 9 9 10.3304 9 12C9 13.6696 10.3304 15 12 15C13.6696 15 15 13.6696 15 12C15 10.3304 13.6696 9 12 9ZM11.2028 12.4712L10.704 14L12 13.024L13.3054 14L12.7972 12.4712L14 11.6394H12.5361L12 10L11.4732 11.6394H10L11.2028 12.4712Z" fill="#75BEFF"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1708 8.08474C9.85081 8.35911 8.77687 9.27684 8.28696 10.5H6.40867V12.7012C6.40867 12.7823 6.4372 12.8512 6.49888 12.9127C6.56058 12.9741 6.63007 13.0028 6.71205 13.0028H8.12487C8.21364 13.3513 8.34773 13.6809 8.52059 13.9851C8.45462 13.9951 8.38715 14 8.31823 14H6.71205C6.53223 14 6.36223 13.9663 6.20306 13.8984C6.04564 13.8311 5.90753 13.7388 5.78961 13.6213C5.67168 13.5038 5.57895 13.3661 5.51141 13.2091C5.44311 13.0503 5.40927 12.8807 5.40927 12.7012V11.1009C5.40927 10.622 5.31772 10.1795 5.13553 9.77209C4.95683 9.36336 4.69832 8.99156 4.35953 8.65806C3.92468 8.22903 3.58896 7.75003 3.35361 7.22134C3.11756 6.69107 3 6.11672 3 5.49953C3 5.08664 3.05342 4.68802 3.16048 4.30397C3.26728 3.92089 3.41907 3.56286 3.61595 3.23018C3.81257 2.89377 4.04777 2.58911 4.32146 2.31641C4.59503 2.04383 4.89858 1.80953 5.23195 1.61364C5.56979 1.41764 5.93146 1.2662 6.31578 1.15983C6.70106 1.0532 7.10094 1 7.51514 1C7.92934 1 8.32923 1.0532 8.71451 1.15983C9.09883 1.2662 9.45803 1.41739 9.79183 1.61351C10.1294 1.80938 10.4351 2.0437 10.7088 2.31641C10.9825 2.5891 11.2177 2.89376 11.4143 3.23016C11.6112 3.56285 11.763 3.92088 11.8698 4.30397C11.9769 4.68802 12.0303 5.08664 12.0303 5.49953C12.0303 6.11672 11.9127 6.69107 11.6767 7.22134C11.5412 7.52562 11.3725 7.81344 11.1708 8.08474Z" fill="#75BEFF"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M12 9C10.3304 9 9 10.3304 9 12C9 13.6696 10.3304 15 12 15C13.6696 15 15 13.6696 15 12C15 10.3304 13.6696 9 12 9ZM11.2028 12.4712L10.704 14L12 13.024L13.3054 14L12.7972 12.4712L14 11.6394H12.5361L12 10L11.4732 11.6394H10L11.2028 12.4712Z" fill="#007ACC"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.1708 8.08474C9.85081 8.35911 8.77687 9.27684 8.28696 10.5H6.40867V12.7012C6.40867 12.7823 6.4372 12.8512 6.49888 12.9127C6.56058 12.9741 6.63007 13.0028 6.71205 13.0028H8.12487C8.21364 13.3513 8.34773 13.6809 8.52059 13.9851C8.45462 13.9951 8.38715 14 8.31823 14H6.71205C6.53223 14 6.36223 13.9663 6.20306 13.8984C6.04564 13.8311 5.90753 13.7388 5.78961 13.6213C5.67168 13.5038 5.57895 13.3661 5.51141 13.2091C5.44311 13.0503 5.40927 12.8807 5.40927 12.7012V11.1009C5.40927 10.622 5.31772 10.1795 5.13553 9.77209C4.95683 9.36336 4.69832 8.99156 4.35953 8.65806C3.92468 8.22903 3.58896 7.75003 3.35361 7.22134C3.11756 6.69107 3 6.11672 3 5.49953C3 5.08664 3.05342 4.68802 3.16048 4.30397C3.26728 3.92089 3.41907 3.56286 3.61595 3.23018C3.81257 2.89377 4.04777 2.58911 4.32146 2.31641C4.59503 2.04383 4.89858 1.80953 5.23195 1.61364C5.56979 1.41764 5.93146 1.2662 6.31578 1.15983C6.70106 1.0532 7.10094 1 7.51514 1C7.92934 1 8.32923 1.0532 8.71451 1.15983C9.09883 1.2662 9.45803 1.41739 9.79183 1.61351C10.1294 1.80938 10.4351 2.0437 10.7088 2.31641C10.9825 2.5891 11.2177 2.89376 11.4143 3.23016C11.6112 3.56285 11.763 3.92088 11.8698 4.30397C11.9769 4.68802 12.0303 5.08664 12.0303 5.49953C12.0303 6.11672 11.9127 6.69107 11.6767 7.22134C11.5412 7.52562 11.3725 7.81344 11.1708 8.08474Z" fill="#007ACC"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6708 8.65806C11.3319 8.9916 11.0716 9.36278 10.8886 9.77172C10.7105 10.1792 10.621 10.6219 10.621 11.1009V12.7012C10.621 12.8807 10.5872 13.0503 10.5189 13.2091C10.4513 13.3661 10.3586 13.5038 10.2407 13.6213C10.1228 13.7388 9.98464 13.8311 9.82723 13.8984C9.66806 13.9663 9.49806 14 9.31823 14H7.71205C7.53223 14 7.36223 13.9663 7.20306 13.8984C7.04564 13.8311 6.90753 13.7388 6.78961 13.6213C6.67168 13.5038 6.57895 13.3661 6.51141 13.2091C6.44311 13.0503 6.40927 12.8807 6.40927 12.7012V11.1009C6.40927 10.622 6.31772 10.1795 6.13553 9.77209C5.95683 9.36336 5.69832 8.99156 5.35953 8.65806C4.92468 8.22903 4.58896 7.75003 4.35361 7.22134C4.11756 6.69107 4 6.11672 4 5.49953C4 5.08664 4.05342 4.68802 4.16048 4.30397C4.26728 3.92089 4.41907 3.56286 4.61595 3.23018C4.81257 2.89377 5.04777 2.58911 5.32146 2.31641C5.59503 2.04383 5.89858 1.80953 6.23195 1.61364C6.56979 1.41764 6.93146 1.2662 7.31578 1.15983C7.70106 1.0532 8.10094 1 8.51514 1C8.92934 1 9.32923 1.0532 9.71451 1.15983C10.0988 1.2662 10.458 1.41739 10.7918 1.61351C11.1294 1.80938 11.4351 2.0437 11.7088 2.31641C11.9825 2.5891 12.2177 2.89376 12.4143 3.23016C12.6112 3.56285 12.763 3.92088 12.8698 4.30397C12.9769 4.68802 13.0303 5.08664 13.0303 5.49953C13.0303 6.11672 12.9127 6.69107 12.6767 7.22134C12.4413 7.75003 12.1056 8.22903 11.6708 8.65806ZM9.62162 10.5H7.40867V12.7012C7.40867 12.7823 7.4372 12.8512 7.49888 12.9127C7.56058 12.9741 7.63007 13.0028 7.71205 13.0028H9.31823C9.40022 13.0028 9.46971 12.9741 9.5314 12.9127C9.59309 12.8512 9.62162 12.7823 9.62162 12.7012V10.5Z" fill="#FFCC00"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -1,4 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6708 8.65806C11.3319 8.9916 11.0716 9.36278 10.8886 9.77172C10.7105 10.1792 10.621 10.6219 10.621 11.1009V12.7012C10.621 12.8807 10.5872 13.0503 10.5189 13.2091C10.4513 13.3661 10.3586 13.5038 10.2407 13.6213C10.1228 13.7388 9.98464 13.8311 9.82723 13.8984C9.66806 13.9663 9.49806 14 9.31823 14H7.71205C7.53223 14 7.36223 13.9663 7.20306 13.8984C7.04564 13.8311 6.90753 13.7388 6.78961 13.6213C6.67168 13.5038 6.57895 13.3661 6.51141 13.2091C6.44311 13.0503 6.40927 12.8807 6.40927 12.7012V11.1009C6.40927 10.622 6.31772 10.1795 6.13553 9.77209C5.95683 9.36336 5.69832 8.99156 5.35953 8.65806C4.92468 8.22903 4.58896 7.75003 4.35361 7.22134C4.11756 6.69107 4 6.11672 4 5.49953C4 5.08664 4.05342 4.68802 4.16048 4.30397C4.26728 3.92089 4.41907 3.56286 4.61595 3.23018C4.81257 2.89377 5.04777 2.58911 5.32146 2.31641C5.59503 2.04383 5.89858 1.80953 6.23195 1.61364C6.56979 1.41764 6.93146 1.2662 7.31578 1.15983C7.70106 1.0532 8.10094 1 8.51514 1C8.92934 1 9.32923 1.0532 9.71451 1.15983C10.0988 1.2662 10.458 1.41739 10.7918 1.61351C11.1294 1.80938 11.4351 2.0437 11.7088 2.31641C11.9825 2.5891 12.2177 2.89376 12.4143 3.23016C12.6112 3.56285 12.763 3.92088 12.8698 4.30397C12.9769 4.68802 13.0303 5.08664 13.0303 5.49953C13.0303 6.11672 12.9127 6.69107 12.6767 7.22134C12.4413 7.75003 12.1056 8.22903 11.6708 8.65806ZM9.62162 10.5H7.40867V12.7012C7.40867 12.7823 7.4372 12.8512 7.49888 12.9127C7.56058 12.9741 7.63007 13.0028 7.71205 13.0028H9.31823C9.40022 13.0028 9.46971 12.9741 9.5314 12.9127C9.59309 12.8512 9.62162 12.7823 9.62162 12.7012V10.5Z" fill="#FFCC00"/>
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M11.6708 8.65806C11.3319 8.9916 11.0716 9.36278 10.8886 9.77172C10.7105 10.1792 10.621 10.6219 10.621 11.1009V12.7012C10.621 12.8807 10.5872 13.0503 10.5189 13.2091C10.4513 13.3661 10.3586 13.5038 10.2407 13.6213C10.1228 13.7388 9.98464 13.8311 9.82723 13.8984C9.66806 13.9663 9.49806 14 9.31823 14H7.71205C7.53223 14 7.36223 13.9663 7.20306 13.8984C7.04564 13.8311 6.90753 13.7388 6.78961 13.6213C6.67168 13.5038 6.57895 13.3661 6.51141 13.2091C6.44311 13.0503 6.40927 12.8807 6.40927 12.7012V11.1009C6.40927 10.622 6.31772 10.1795 6.13553 9.77209C5.95683 9.36336 5.69832 8.99156 5.35953 8.65806C4.92468 8.22903 4.58896 7.75003 4.35361 7.22134C4.11756 6.69107 4 6.11672 4 5.49953C4 5.08664 4.05342 4.68802 4.16048 4.30397C4.26728 3.92089 4.41907 3.56286 4.61595 3.23018C4.81257 2.89377 5.04777 2.58911 5.32146 2.31641C5.59503 2.04383 5.89858 1.80953 6.23195 1.61364C6.56979 1.41764 6.93146 1.2662 7.31578 1.15983C7.70106 1.0532 8.10094 1 8.51514 1C8.92934 1 9.32923 1.0532 9.71451 1.15983C10.0988 1.2662 10.458 1.41739 10.7918 1.61351C11.1294 1.80938 11.4351 2.0437 11.7088 2.31641C11.9825 2.5891 12.2177 2.89376 12.4143 3.23016C12.6112 3.56285 12.763 3.92088 12.8698 4.30397C12.9769 4.68802 13.0303 5.08664 13.0303 5.49953C13.0303 6.11672 12.9127 6.69107 12.6767 7.22134C12.4413 7.75003 12.1056 8.22903 11.6708 8.65806ZM9.62162 10.5H7.40867V12.7012C7.40867 12.7823 7.4372 12.8512 7.49888 12.9127C7.56058 12.9741 7.63007 13.0028 7.71205 13.0028H9.31823C9.40022 13.0028 9.46971 12.9741 9.5314 12.9127C9.59309 12.8512 9.62162 12.7823 9.62162 12.7012V10.5Z" fill="#DDB100"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
@@ -41,13 +41,13 @@ export class ColorPickerModel {
|
||||
this._onDidChangePresentation.fire(this.presentation);
|
||||
}
|
||||
|
||||
private _onColorFlushed = new Emitter<Color>();
|
||||
private readonly _onColorFlushed = new Emitter<Color>();
|
||||
readonly onColorFlushed: Event<Color> = this._onColorFlushed.event;
|
||||
|
||||
private _onDidChangeColor = new Emitter<Color>();
|
||||
private readonly _onDidChangeColor = new Emitter<Color>();
|
||||
readonly onDidChangeColor: Event<Color> = this._onDidChangeColor.event;
|
||||
|
||||
private _onDidChangePresentation = new Emitter<IColorPresentation>();
|
||||
private readonly _onDidChangePresentation = new Emitter<IColorPresentation>();
|
||||
readonly onDidChangePresentation: Event<IColorPresentation> = this._onDidChangePresentation.event;
|
||||
|
||||
constructor(color: Color, availableColorPresentations: IColorPresentation[], private presentationIndex: number) {
|
||||
|
||||
@@ -127,10 +127,10 @@ class SaturationBox extends Disposable {
|
||||
private height!: number;
|
||||
|
||||
private monitor: GlobalMouseMoveMonitor<IStandardMouseMoveEventData> | null;
|
||||
private _onDidChange = new Emitter<{ s: number, v: number }>();
|
||||
private readonly _onDidChange = new Emitter<{ s: number, v: number }>();
|
||||
readonly onDidChange: Event<{ s: number, v: number }> = this._onDidChange.event;
|
||||
|
||||
private _onColorFlushed = new Emitter<void>();
|
||||
private readonly _onColorFlushed = new Emitter<void>();
|
||||
readonly onColorFlushed: Event<void> = this._onColorFlushed.event;
|
||||
|
||||
constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {
|
||||
@@ -237,10 +237,10 @@ abstract class Strip extends Disposable {
|
||||
protected slider: HTMLElement;
|
||||
private height!: number;
|
||||
|
||||
private _onDidChange = new Emitter<number>();
|
||||
private readonly _onDidChange = new Emitter<number>();
|
||||
readonly onDidChange: Event<number> = this._onDidChange.event;
|
||||
|
||||
private _onColorFlushed = new Emitter<void>();
|
||||
private readonly _onColorFlushed = new Emitter<void>();
|
||||
readonly onColorFlushed: Event<void> = this._onColorFlushed.event;
|
||||
|
||||
constructor(container: HTMLElement, protected model: ColorPickerModel) {
|
||||
|
||||
@@ -14,9 +14,9 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry';
|
||||
|
||||
class CursorState {
|
||||
readonly selections: Selection[];
|
||||
readonly selections: readonly Selection[];
|
||||
|
||||
constructor(selections: Selection[]) {
|
||||
constructor(selections: readonly Selection[]) {
|
||||
this.selections = selections;
|
||||
}
|
||||
|
||||
|
||||
@@ -3,47 +3,23 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
.monaco-editor .margin-view-overlays .folding {
|
||||
.monaco-editor .margin-view-overlays .codicon {
|
||||
cursor: pointer;
|
||||
background-repeat: no-repeat;
|
||||
background-origin: border-box;
|
||||
background-position: calc(50% + 2px) center;
|
||||
background-size: auto calc(100% - 3px);
|
||||
opacity: 0;
|
||||
transition: opacity 0.5s;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 140%;
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
.monaco-editor .margin-view-overlays .folding {
|
||||
background-image: url('tree-expanded-light.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .margin-view-overlays .folding,
|
||||
.monaco-editor.vs-dark .margin-view-overlays .folding {
|
||||
background-image: url('tree-expanded-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .margin-view-overlays .folding {
|
||||
background-image: url('tree-expanded-hc.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .margin-view-overlays:hover .folding,
|
||||
.monaco-editor .margin-view-overlays .folding.alwaysShowFoldIcons {
|
||||
.monaco-editor .margin-view-overlays:hover .codicon,
|
||||
.monaco-editor .margin-view-overlays .codicon.codicon-chevron-right,
|
||||
.monaco-editor .margin-view-overlays .codicon.alwaysShowFoldIcons {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.monaco-editor .margin-view-overlays .folding.collapsed {
|
||||
background-image: url('tree-collapsed-light.svg');
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.monaco-editor.vs-dark .margin-view-overlays .folding.collapsed {
|
||||
background-image: url('tree-collapsed-dark.svg');
|
||||
}
|
||||
|
||||
.monaco-editor.hc-black .margin-view-overlays .folding.collapsed {
|
||||
background-image: url('tree-collapsed-hc.svg');
|
||||
}
|
||||
|
||||
.monaco-editor .inline-folded:after {
|
||||
color: grey;
|
||||
margin: 0.1em 0.2em 0 0.2em;
|
||||
@@ -51,4 +27,4 @@
|
||||
display: inline;
|
||||
line-height: 1em;
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,17 +13,17 @@ export class FoldingDecorationProvider implements IDecorationProvider {
|
||||
private static COLLAPSED_VISUAL_DECORATION = ModelDecorationOptions.register({
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
afterContentClassName: 'inline-folded',
|
||||
linesDecorationsClassName: 'folding collapsed'
|
||||
linesDecorationsClassName: 'codicon codicon-chevron-right'
|
||||
});
|
||||
|
||||
private static EXPANDED_AUTO_HIDE_VISUAL_DECORATION = ModelDecorationOptions.register({
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
linesDecorationsClassName: 'folding'
|
||||
linesDecorationsClassName: 'codicon codicon-chevron-down'
|
||||
});
|
||||
|
||||
private static EXPANDED_VISUAL_DECORATION = ModelDecorationOptions.register({
|
||||
stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges,
|
||||
linesDecorationsClassName: 'folding alwaysShowFoldIcons'
|
||||
linesDecorationsClassName: 'codicon codicon-chevron-down alwaysShowFoldIcons'
|
||||
});
|
||||
|
||||
public autoHideFoldingControls: boolean = true;
|
||||
|
||||
@@ -28,7 +28,7 @@ export class FoldingModel {
|
||||
private _editorDecorationIds: string[];
|
||||
private _isInitialized: boolean;
|
||||
|
||||
private _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();
|
||||
private readonly _updateEventEmitter = new Emitter<FoldingModelChangeEvent>();
|
||||
public readonly onDidChange: Event<FoldingModelChangeEvent> = this._updateEventEmitter.event;
|
||||
|
||||
public get regions(): FoldingRegions { return this._regions; }
|
||||
|
||||
@@ -14,7 +14,7 @@ export class HiddenRangeModel {
|
||||
private readonly _foldingModel: FoldingModel;
|
||||
private _hiddenRanges: IRange[];
|
||||
private _foldingModelListener: IDisposable | null;
|
||||
private _updateEventEmitter = new Emitter<IRange[]>();
|
||||
private readonly _updateEventEmitter = new Emitter<IRange[]>();
|
||||
|
||||
public get onDidChange(): Event<IRange[]> { return this._updateEventEmitter.event; }
|
||||
public get hiddenRanges() { return this._hiddenRanges; }
|
||||
@@ -154,4 +154,4 @@ function findRange(ranges: IRange[], line: number): IRange | null {
|
||||
return ranges[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0719 7.99999L5.7146 12.3573L6.33332 12.976L11 8.30935V7.69064L6.33332 3.02397L5.7146 3.64269L10.0719 7.99999Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 284 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0719 7.99999L5.7146 12.3573L6.33332 12.976L11 8.30935V7.69063L6.33332 3.02396L5.7146 3.64268L10.0719 7.99999Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 282 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0719 7.99999L5.7146 12.3573L6.33332 12.976L11 8.30935V7.69063L6.33332 3.02396L5.7146 3.64268L10.0719 7.99999Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 284 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.97603 10.0719L12.3333 5.71461L12.9521 6.33333L8.28539 11L7.66667 11L3 6.33333L3.61872 5.71461L7.97603 10.0719Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 284 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.97603 10.0719L12.3333 5.71461L12.9521 6.33333L8.28539 11L7.66667 11L3 6.33333L3.61872 5.71461L7.97603 10.0719Z" fill="white"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 282 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M7.97603 10.0719L12.3333 5.71461L12.9521 6.33333L8.28539 11L7.66667 11L3 6.33333L3.61872 5.71461L7.97603 10.0719Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 284 B |
@@ -162,7 +162,7 @@ export class DefinitionAction extends EditorAction {
|
||||
}
|
||||
}
|
||||
|
||||
private _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise<ICodeEditor | null> {
|
||||
private _openReference(editor: ICodeEditor, editorService: ICodeEditorService, reference: Location | LocationLink, sideBySide: boolean): Promise<ICodeEditor | undefined> {
|
||||
// range is the target-selection-range when we have one
|
||||
// and the the fallback is the 'full' range
|
||||
let range: IRange | undefined = undefined;
|
||||
|
||||
@@ -173,7 +173,7 @@ export class MarkerNavigationWidget extends PeekViewWidget {
|
||||
private readonly _callOnDispose = new DisposableStore();
|
||||
private _severity: MarkerSeverity;
|
||||
private _backgroundColor?: Color;
|
||||
private _onDidSelectRelatedInformation = new Emitter<IRelatedInformation>();
|
||||
private readonly _onDidSelectRelatedInformation = new Emitter<IRelatedInformation>();
|
||||
private _heightInPixel!: number;
|
||||
|
||||
readonly onDidSelectRelatedInformation: Event<IRelatedInformation> = this._onDidSelectRelatedInformation.event;
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as nls from 'vs/nls';
|
||||
import { IDisposable, dispose } from 'vs/base/common/lifecycle';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import * as strings from 'vs/base/common/strings';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { EditorAction, IActionOptions, ServicesAccessor, registerEditorAction, registerEditorContribution } from 'vs/editor/browser/editorExtensions';
|
||||
@@ -425,23 +425,21 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
private static readonly ID = 'editor.contrib.autoIndentOnPaste';
|
||||
|
||||
private readonly editor: ICodeEditor;
|
||||
private callOnDispose: IDisposable[];
|
||||
private callOnModel: IDisposable[];
|
||||
private readonly callOnDispose = new DisposableStore();
|
||||
private readonly callOnModel = new DisposableStore();
|
||||
|
||||
constructor(editor: ICodeEditor) {
|
||||
this.editor = editor;
|
||||
this.callOnDispose = [];
|
||||
this.callOnModel = [];
|
||||
|
||||
this.callOnDispose.push(editor.onDidChangeConfiguration(() => this.update()));
|
||||
this.callOnDispose.push(editor.onDidChangeModel(() => this.update()));
|
||||
this.callOnDispose.push(editor.onDidChangeModelLanguage(() => this.update()));
|
||||
this.callOnDispose.add(editor.onDidChangeConfiguration(() => this.update()));
|
||||
this.callOnDispose.add(editor.onDidChangeModel(() => this.update()));
|
||||
this.callOnDispose.add(editor.onDidChangeModelLanguage(() => this.update()));
|
||||
}
|
||||
|
||||
private update(): void {
|
||||
|
||||
// clean up
|
||||
this.callOnModel = dispose(this.callOnModel);
|
||||
this.callOnModel.clear();
|
||||
|
||||
// we are disabled
|
||||
if (!this.editor.getOption(EditorOption.autoIndent) || this.editor.getOption(EditorOption.formatOnPaste)) {
|
||||
@@ -453,7 +451,7 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
return;
|
||||
}
|
||||
|
||||
this.callOnModel.push(this.editor.onDidPaste((range: Range) => {
|
||||
this.callOnModel.add(this.editor.onDidPaste((range: Range) => {
|
||||
this.trigger(range);
|
||||
}));
|
||||
}
|
||||
@@ -611,8 +609,8 @@ export class AutoIndentOnPaste implements IEditorContribution {
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
this.callOnDispose = dispose(this.callOnDispose);
|
||||
this.callOnModel = dispose(this.callOnModel);
|
||||
this.callOnDispose.dispose();
|
||||
this.callOnModel.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.14646 9.76777L8.14644 14.7678L8.85355 14.7678L13.8535 9.76777L13.1464 9.06066L9 13.2071L9 1L8 0.999999L8 13.2071L3.85356 9.06066L3.14646 9.76777Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 319 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M3.14646 9.76777L8.14644 14.7678L8.85355 14.7678L13.8535 9.76777L13.1464 9.06066L9 13.2071L9 1L8 0.999999L8 13.2071L3.85356 9.06066L3.14646 9.76777Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 319 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8535 6.2929L8.85356 1.29291H8.14645L3.14645 6.2929L3.85356 7.00001L8 2.85357V15.0607H9V2.85357L13.1464 7.00001L13.8535 6.2929Z" fill="#C5C5C5"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 301 B |
@@ -1,3 +0,0 @@
|
||||
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path fill-rule="evenodd" clip-rule="evenodd" d="M13.8535 6.2929L8.85356 1.29291H8.14645L3.14645 6.2929L3.85356 7.00001L8 2.85357V15.0607H9V2.85357L13.1464 7.00001L13.8535 6.2929Z" fill="#424242"/>
|
||||
</svg>
|
||||
|
Before Width: | Height: | Size: 301 B |
@@ -60,24 +60,3 @@
|
||||
border-top: 1px solid;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Dark Theme */
|
||||
/* High Contrast Theme */
|
||||
|
||||
.monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up {
|
||||
background: url('chevron-previous-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-up {
|
||||
background: url('chevron-previous-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down {
|
||||
background: url('chevron-next-light.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
.vs-dark .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down,
|
||||
.hc-black .monaco-editor .peekview-widget .peekview-actions .codicon.chevron-down {
|
||||
background: url('chevron-next-dark.svg') center center no-repeat;
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ export namespace PeekContext {
|
||||
export const notInPeekEditor: ContextKeyExpr = inPeekEditor.toNegated();
|
||||
}
|
||||
|
||||
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | null {
|
||||
let editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
|
||||
export function getOuterEditor(accessor: ServicesAccessor): ICodeEditor | undefined {
|
||||
const editor = accessor.get(ICodeEditorService).getFocusedCodeEditor();
|
||||
if (editor instanceof EmbeddedCodeEditorWidget) {
|
||||
return editor.getParentEditor();
|
||||
}
|
||||
@@ -83,7 +83,7 @@ export abstract class PeekViewWidget extends ZoneWidget {
|
||||
|
||||
public _serviceBrand: undefined;
|
||||
|
||||
private _onDidClose = new Emitter<PeekViewWidget>();
|
||||
private readonly _onDidClose = new Emitter<PeekViewWidget>();
|
||||
|
||||
protected _headElement?: HTMLDivElement;
|
||||
protected _primaryHeading?: HTMLElement;
|
||||
|
||||
@@ -196,7 +196,7 @@ export class ReferenceWidget extends PeekViewWidget {
|
||||
|
||||
private readonly _disposeOnNewModel = new DisposableStore();
|
||||
private readonly _callOnDispose = new DisposableStore();
|
||||
private _onDidSelectReference = new Emitter<SelectionEvent>();
|
||||
private readonly _onDidSelectReference = new Emitter<SelectionEvent>();
|
||||
|
||||
private _tree!: WorkbenchAsyncDataTree<ReferencesModel | FileReferences, TreeElement, FuzzyScore>;
|
||||
private _treeContainer!: HTMLElement;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
import { isNonEmptyArray } from 'vs/base/common/arrays';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { KeyCode, KeyMod } from 'vs/base/common/keyCodes';
|
||||
import { KeyCode, KeyMod, SimpleKeybinding } from 'vs/base/common/keyCodes';
|
||||
import { dispose, IDisposable, DisposableStore, toDisposable, MutableDisposable } from 'vs/base/common/lifecycle';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { EditorAction, EditorCommand, registerEditorAction, registerEditorCommand, registerEditorContribution, ServicesAccessor } from 'vs/editor/browser/editorExtensions';
|
||||
@@ -36,8 +36,13 @@ import { CommitCharacterController } from './suggestCommitCharacters';
|
||||
import { IPosition } from 'vs/editor/common/core/position';
|
||||
import { TrackedRangeStickiness, ITextModel } from 'vs/editor/common/model';
|
||||
import { EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
import * as platform from 'vs/base/common/platform';
|
||||
|
||||
const _sticky = false; // for development purposes only
|
||||
/**
|
||||
* Stop suggest widget from disappearing when clicking into other areas
|
||||
* For development purpose only
|
||||
*/
|
||||
const _sticky = false;
|
||||
|
||||
class LineSuffix {
|
||||
|
||||
@@ -180,6 +185,21 @@ export class SuggestController implements IEditorContribution {
|
||||
}
|
||||
}));
|
||||
|
||||
this._toDispose.add(this._widget.getValue().onDetailsKeyDown(e => {
|
||||
// cmd + c on macOS, ctrl + c on Win / Linux
|
||||
if (
|
||||
e.toKeybinding().equals(new SimpleKeybinding(true, false, false, false, KeyCode.KEY_C)) ||
|
||||
(platform.isMacintosh && e.toKeybinding().equals(new SimpleKeybinding(false, false, false, true, KeyCode.KEY_C)))
|
||||
) {
|
||||
e.stopPropagation();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!e.toKeybinding().isModifierKey()) {
|
||||
this._editor.focus();
|
||||
}
|
||||
}));
|
||||
|
||||
// Manage the acceptSuggestionsOnEnter context key
|
||||
let acceptSuggestionsOnEnter = SuggestContext.AcceptSuggestionsOnEnter.bindTo(_contextKeyService);
|
||||
let updateFromConfig = () => {
|
||||
|
||||
@@ -10,14 +10,14 @@ import * as strings from 'vs/base/common/strings';
|
||||
import { Event, Emitter } from 'vs/base/common/event';
|
||||
import { onUnexpectedError } from 'vs/base/common/errors';
|
||||
import { IDisposable, dispose, toDisposable, DisposableStore, Disposable } from 'vs/base/common/lifecycle';
|
||||
import { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass, addDisposableListener } from 'vs/base/browser/dom';
|
||||
import { addClass, append, $, hide, removeClass, show, toggleClass, getDomNodePagePosition, hasClass, addDisposableListener, addStandardDisposableListener } from 'vs/base/browser/dom';
|
||||
import { IListVirtualDelegate, IListEvent, IListRenderer, IListMouseEvent } from 'vs/base/browser/ui/list/list';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { DomScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
|
||||
import { ConfigurationChangedEvent, EditorOption } from 'vs/editor/common/config/editorOptions';
|
||||
import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition } from 'vs/editor/browser/editorBrowser';
|
||||
import { ContentWidgetPositionPreference, ICodeEditor, IContentWidget, IContentWidgetPosition, IEditorMouseEvent } from 'vs/editor/browser/editorBrowser';
|
||||
import { Context as SuggestContext, CompletionItem } from './suggest';
|
||||
import { CompletionModel } from './completionModel';
|
||||
import { alert } from 'vs/base/browser/ui/aria/aria';
|
||||
@@ -39,6 +39,7 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
import { FileKind } from 'vs/platform/files/common/files';
|
||||
import { MarkdownString } from 'vs/base/common/htmlContent';
|
||||
import { flatten } from 'vs/base/common/arrays';
|
||||
import { IKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
||||
|
||||
const expandSuggestionDocsByDefault = false;
|
||||
|
||||
@@ -159,7 +160,6 @@ class Renderer implements IListRenderer<CompletionItem, ISuggestionTemplateData>
|
||||
data.icon.className = 'icon ' + completionKindToCssClass(suggestion.kind);
|
||||
data.colorspan.style.backgroundColor = '';
|
||||
|
||||
|
||||
const labelOptions: IIconLabelValueOptions = {
|
||||
labelEscapeNewLines: true,
|
||||
matches: createMatches(element.score)
|
||||
@@ -337,6 +337,8 @@ class SuggestionDetails {
|
||||
}
|
||||
|
||||
this.el.style.height = this.header.offsetHeight + this.docs.offsetHeight + (this.borderWidth * 2) + 'px';
|
||||
this.el.style.userSelect = 'text';
|
||||
this.el.tabIndex = -1;
|
||||
|
||||
this.close.onmousedown = e => {
|
||||
e.preventDefault();
|
||||
@@ -427,7 +429,7 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
|
||||
// Editor.IContentWidget.allowEditorOverflow
|
||||
readonly allowEditorOverflow = true;
|
||||
readonly suppressMouseDown = true;
|
||||
readonly suppressMouseDown = false;
|
||||
|
||||
private state: State | null = null;
|
||||
private isAuto: boolean = false;
|
||||
@@ -450,10 +452,10 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
private readonly showTimeout = new TimeoutTimer();
|
||||
private readonly toDispose = new DisposableStore();
|
||||
|
||||
private onDidSelectEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private onDidFocusEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private onDidHideEmitter = new Emitter<this>();
|
||||
private onDidShowEmitter = new Emitter<this>();
|
||||
private readonly onDidSelectEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private readonly onDidFocusEmitter = new Emitter<ISelectedSuggestion>();
|
||||
private readonly onDidHideEmitter = new Emitter<this>();
|
||||
private readonly onDidShowEmitter = new Emitter<this>();
|
||||
|
||||
readonly onDidSelect: Event<ISelectedSuggestion> = this.onDidSelectEmitter.event;
|
||||
readonly onDidFocus: Event<ISelectedSuggestion> = this.onDidFocusEmitter.event;
|
||||
@@ -472,6 +474,9 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
private docsPositionPreviousWidgetY: number | null = null;
|
||||
private explainMode: boolean = false;
|
||||
|
||||
private readonly _onDetailsKeydown = new Emitter<IKeyboardEvent>();
|
||||
public readonly onDetailsKeyDown: Event<IKeyboardEvent> = this._onDetailsKeydown.event;
|
||||
|
||||
constructor(
|
||||
private readonly editor: ICodeEditor,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@@ -525,7 +530,6 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
this.toDispose.add(this.editor.onDidChangeCursorSelection(() => this.onCursorSelectionChanged()));
|
||||
this.toDispose.add(this.editor.onDidChangeConfiguration(e => e.hasChanged(EditorOption.suggest) && applyIconStyle()));
|
||||
|
||||
|
||||
this.suggestWidgetVisible = SuggestContext.Visible.bindTo(contextKeyService);
|
||||
this.suggestWidgetMultipleSuggestions = SuggestContext.MultipleSuggestions.bindTo(contextKeyService);
|
||||
|
||||
@@ -533,6 +537,25 @@ export class SuggestWidget implements IContentWidget, IListVirtualDelegate<Compl
|
||||
this.setState(State.Hidden);
|
||||
|
||||
this.onThemeChange(themeService.getTheme());
|
||||
|
||||
this.toDispose.add(addStandardDisposableListener(this.details.element, 'keydown', e => {
|
||||
this._onDetailsKeydown.fire(e);
|
||||
}));
|
||||
|
||||
this.toDispose.add(this.editor.onMouseDown((e: IEditorMouseEvent) => this.onEditorMouseDown(e)));
|
||||
}
|
||||
|
||||
private onEditorMouseDown(mouseEvent: IEditorMouseEvent): void {
|
||||
// Clicking inside details
|
||||
if (this.details.element.contains(mouseEvent.target.element)) {
|
||||
this.details.element.focus();
|
||||
}
|
||||
// Clicking outside details and inside suggest
|
||||
else {
|
||||
if (this.element.contains(mouseEvent.target.element)) {
|
||||
this.editor.focus();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private onCursorSelectionChanged(): void {
|
||||
|
||||
@@ -30,6 +30,8 @@ import { NullTelemetryService } from 'vs/platform/telemetry/common/telemetryUtil
|
||||
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
|
||||
import { ISuggestMemoryService } from 'vs/editor/contrib/suggest/suggestMemory';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';
|
||||
import { MockKeybindingService } from 'vs/platform/keybinding/test/common/mockKeybindingService';
|
||||
|
||||
export interface Ctor<T> {
|
||||
new(): T;
|
||||
@@ -46,6 +48,7 @@ function createMockEditor(model: TextModel): TestCodeEditor {
|
||||
serviceCollection: new ServiceCollection(
|
||||
[ITelemetryService, NullTelemetryService],
|
||||
[IStorageService, new InMemoryStorageService()],
|
||||
[IKeybindingService, new MockKeybindingService()],
|
||||
[ISuggestMemoryService, new class implements ISuggestMemoryService {
|
||||
_serviceBrand: undefined;
|
||||
memorize(): void {
|
||||
|
||||
@@ -420,7 +420,7 @@ export class SimpleConfigurationService implements IConfigurationService {
|
||||
|
||||
_serviceBrand: undefined;
|
||||
|
||||
private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
|
||||
private readonly _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
|
||||
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
|
||||
|
||||
private readonly _configuration: Configuration;
|
||||
|
||||
@@ -15,19 +15,19 @@ import { IResourceInput } from 'vs/platform/editor/common/editor';
|
||||
|
||||
export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
|
||||
public getActiveCodeEditor(): ICodeEditor | null {
|
||||
return null; // not supported in the standalone case
|
||||
public getActiveCodeEditor(): ICodeEditor | undefined {
|
||||
return undefined; // not supported in the standalone case
|
||||
}
|
||||
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined> {
|
||||
if (!source) {
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
|
||||
return Promise.resolve(this.doOpenEditor(source, input));
|
||||
}
|
||||
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceInput): ICodeEditor | null {
|
||||
private doOpenEditor(editor: ICodeEditor, input: IResourceInput): ICodeEditor | undefined {
|
||||
const model = this.findModel(editor, input.resource);
|
||||
if (!model) {
|
||||
if (input.resource) {
|
||||
@@ -39,7 +39,7 @@ export class StandaloneCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
return editor;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const selection = <IRange>(input.options ? input.options.selection : null);
|
||||
|
||||
@@ -14,10 +14,10 @@ import { IInstantiationService } from 'vs/platform/instantiation/common/instanti
|
||||
|
||||
export class TestCodeEditorService extends AbstractCodeEditorService {
|
||||
public lastInput?: IResourceInput;
|
||||
public getActiveCodeEditor(): ICodeEditor | null { return null; }
|
||||
public openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
public getActiveCodeEditor(): ICodeEditor | undefined { return undefined; }
|
||||
public openCodeEditor(input: IResourceInput, _source: ICodeEditor | undefined, _sideBySide?: boolean): Promise<ICodeEditor | undefined> {
|
||||
this.lastInput = input;
|
||||
return Promise.resolve(null);
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
public registerDecorationType(key: string, options: IDecorationRenderOptions, parentTypeKey?: string): void { }
|
||||
public removeDecorationType(key: string): void { }
|
||||
|
||||
@@ -15,12 +15,12 @@ import { TestTheme, TestThemeService } from 'vs/platform/theme/test/common/testT
|
||||
const themeServiceMock = new TestThemeService();
|
||||
|
||||
export class TestCodeEditorServiceImpl extends CodeEditorServiceImpl {
|
||||
getActiveCodeEditor(): ICodeEditor | null {
|
||||
return null;
|
||||
getActiveCodeEditor(): ICodeEditor | undefined {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
openCodeEditor(input: IResourceInput, source: ICodeEditor | null, sideBySide?: boolean): Promise<ICodeEditor | null> {
|
||||
return Promise.resolve(null);
|
||||
openCodeEditor(input: IResourceInput, source: ICodeEditor | undefined, sideBySide?: boolean): Promise<ICodeEditor | undefined> {
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
* Licensed under the Source EULA. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
import * as assert from 'assert';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { OpenerService } from 'vs/editor/browser/services/openerService';
|
||||
import { TestCodeEditorService } from 'vs/editor/test/browser/editorTestServices';
|
||||
@@ -15,8 +16,8 @@ suite('OpenerService', function () {
|
||||
|
||||
const commandService = new (class implements ICommandService {
|
||||
_serviceBrand: undefined;
|
||||
onWillExecuteCommand = () => ({ dispose: () => { } });
|
||||
onDidExecuteCommand = () => ({ dispose: () => { } });
|
||||
onWillExecuteCommand = () => Disposable.None;
|
||||
onDidExecuteCommand = () => Disposable.None;
|
||||
executeCommand(id: string, ...args: any[]): Promise<any> {
|
||||
lastCommand = { id, args };
|
||||
return Promise.resolve(undefined);
|
||||
|
||||