mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-10 18:22:34 -05:00
Merge from vscode 1ec43773e37997841c5af42b33ddb180e9735bf2
This commit is contained in:
@@ -497,6 +497,7 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
|
||||
private _getSemanticTokenAtPosition(semanticTokens: SemanticTokensResult, pos: Position): ISemanticTokenInfo | null {
|
||||
const tokenData = semanticTokens.tokens.data;
|
||||
const defaultLanguage = this._model.getLanguageIdentifier().language;
|
||||
let lastLine = 0;
|
||||
let lastCharacter = 0;
|
||||
const posLine = pos.lineNumber - 1, posCharacter = pos.column - 1; // to 0-based position
|
||||
@@ -511,7 +512,7 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
const definitions = {};
|
||||
const colorMap = this._themeService.getColorTheme().tokenColorMap;
|
||||
const theme = this._themeService.getColorTheme() as ColorThemeData;
|
||||
const tokenStyle = theme.getTokenStyleMetadata(type, modifiers, true, definitions);
|
||||
const tokenStyle = theme.getTokenStyleMetadata(type, modifiers, defaultLanguage, true, definitions);
|
||||
|
||||
let metadata: IDecodedMetadata | undefined = undefined;
|
||||
if (tokenStyle) {
|
||||
@@ -539,7 +540,6 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
}
|
||||
const theme = this._themeService.getColorTheme() as ColorThemeData;
|
||||
|
||||
const isTokenStylingRule = (d: any): d is TokenStylingRule => !!d.value;
|
||||
if (Array.isArray(definition)) {
|
||||
const scopesDefinition: TextMateThemingRuleDefinitions = {};
|
||||
theme.resolveScopes(definition, scopesDefinition);
|
||||
@@ -548,7 +548,7 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
return `${escape(scopesDefinition.scope.join(' '))}<br><code class="tiw-theme-selector">${matchingRule.scope}\n${JSON.stringify(matchingRule.settings, null, '\t')}</code>`;
|
||||
}
|
||||
return '';
|
||||
} else if (isTokenStylingRule(definition)) {
|
||||
} else if (TokenStylingRule.is(definition)) {
|
||||
const scope = theme.getTokenStylingRuleScope(definition);
|
||||
if (scope === 'setting') {
|
||||
return `User settings: ${definition.selector.selectorString} - ${this._renderStyleProperty(definition.style, property)}`;
|
||||
@@ -556,16 +556,9 @@ class InspectEditorTokensWidget extends Disposable implements IContentWidget {
|
||||
return `Color theme: ${definition.selector.selectorString} - ${this._renderStyleProperty(definition.style, property)}`;
|
||||
}
|
||||
return '';
|
||||
} else if (typeof definition === 'string') {
|
||||
const [type, ...modifiers] = definition.split('.');
|
||||
const definitions: TokenStyleDefinitions = {};
|
||||
const m = theme.getTokenStyleMetadata(type, modifiers, true, definitions);
|
||||
if (m && definitions.foreground) {
|
||||
return this._renderTokenStyleDefinition(definitions[property], property);
|
||||
}
|
||||
return '';
|
||||
} else {
|
||||
return this._renderStyleProperty(definition, property);
|
||||
const style = theme.resolveTokenStyleValue(definition);
|
||||
return `Default: ${style ? this._renderStyleProperty(style, property) : ''}`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,15 +4,19 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IKeyMods } from 'vs/platform/quickinput/common/quickInput';
|
||||
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';
|
||||
import { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { IQuickAccessRegistry, Extensions as QuickaccesExtensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
|
||||
export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProvider {
|
||||
|
||||
@@ -55,9 +59,32 @@ export class GotoLineQuickAccessProvider extends AbstractGotoLineQuickAccessProv
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({
|
||||
Registry.as<IQuickAccessRegistry>(QuickaccesExtensions.Quickaccess).registerQuickAccessProvider({
|
||||
ctor: GotoLineQuickAccessProvider,
|
||||
prefix: AbstractGotoLineQuickAccessProvider.PREFIX,
|
||||
placeholder: localize('gotoLineQuickAccessPlaceholder', "Type the line number and optional column to go to (e.g. 42:5 for line 42 and column 5)."),
|
||||
helpEntries: [{ description: localize('gotoLineQuickAccess', "Go to Line/Column"), needsEditor: true }]
|
||||
});
|
||||
|
||||
export class GotoLineAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.gotoLine';
|
||||
static readonly LABEL = localize('gotoLine', "Go to Line/Column...");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
this.quickInputService.quickAccess.show(GotoLineQuickAccessProvider.PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions).registerWorkbenchAction(SyncActionDescriptor.create(GotoLineAction, GotoLineAction.ID, GotoLineAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyCode.KEY_G,
|
||||
mac: { primary: KeyMod.WinCtrl | KeyCode.KEY_G }
|
||||
}), 'Go to Line/Column...');
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { localize } from 'vs/nls';
|
||||
import { IKeyMods, IQuickPickSeparator } from 'vs/platform/quickinput/common/quickInput';
|
||||
import { IKeyMods, IQuickPickSeparator, 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 { Registry } from 'vs/platform/registry/common/platform';
|
||||
import { IQuickAccessRegistry, Extensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { IQuickAccessRegistry, Extensions as QuickaccessExtensions } from 'vs/platform/quickinput/common/quickAccess';
|
||||
import { AbstractGotoSymbolQuickAccessProvider, IGotoSymbolQuickPickItem } from 'vs/editor/contrib/quickAccess/gotoSymbolQuickAccess';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IWorkbenchEditorConfiguration } from 'vs/workbench/common/editor';
|
||||
@@ -17,6 +17,11 @@ import { ITextModel } from 'vs/editor/common/model';
|
||||
import { DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { timeout } from 'vs/base/common/async';
|
||||
import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Action } from 'vs/base/common/actions';
|
||||
import { IWorkbenchActionRegistry, Extensions as ActionExtensions } from 'vs/workbench/common/actions';
|
||||
import { SyncActionDescriptor } from 'vs/platform/actions/common/actions';
|
||||
import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { prepareQuery } from 'vs/base/common/fuzzyScorer';
|
||||
|
||||
export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccessProvider {
|
||||
|
||||
@@ -66,7 +71,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
|
||||
private static readonly SYMBOL_PICKS_TIMEOUT = 8000;
|
||||
|
||||
async getSymbolPicks(model: ITextModel, filter: string, disposables: DisposableStore, token: CancellationToken): Promise<Array<IGotoSymbolQuickPickItem | IQuickPickSeparator>> {
|
||||
async getSymbolPicks(model: ITextModel, filter: string, options: { extraContainerLabel?: string }, disposables: DisposableStore, token: CancellationToken): Promise<Array<IGotoSymbolQuickPickItem | IQuickPickSeparator>> {
|
||||
|
||||
// If the registry does not know the model, we wait for as long as
|
||||
// the registry knows it. This helps in cases where a language
|
||||
@@ -81,7 +86,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
return [];
|
||||
}
|
||||
|
||||
return this.doGetSymbolPicks(this.getDocumentSymbols(model, true, token), filter, token);
|
||||
return this.doGetSymbolPicks(this.getDocumentSymbols(model, true, token), prepareQuery(filter), options, token);
|
||||
}
|
||||
|
||||
addDecorations(editor: IEditor, range: IRange): void {
|
||||
@@ -95,7 +100,7 @@ export class GotoSymbolQuickAccessProvider extends AbstractGotoSymbolQuickAccess
|
||||
//#endregion
|
||||
}
|
||||
|
||||
Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessProvider({
|
||||
Registry.as<IQuickAccessRegistry>(QuickaccessExtensions.Quickaccess).registerQuickAccessProvider({
|
||||
ctor: GotoSymbolQuickAccessProvider,
|
||||
prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX,
|
||||
contextKey: 'inFileSymbolsPicker',
|
||||
@@ -105,3 +110,25 @@ Registry.as<IQuickAccessRegistry>(Extensions.Quickaccess).registerQuickAccessPro
|
||||
{ description: localize('gotoSymbolByCategoryQuickAccess', "Go to Symbol in Editor by Category"), prefix: AbstractGotoSymbolQuickAccessProvider.PREFIX_BY_CATEGORY, needsEditor: true }
|
||||
]
|
||||
});
|
||||
|
||||
export class GotoSymbolAction extends Action {
|
||||
|
||||
static readonly ID = 'workbench.action.gotoSymbol';
|
||||
static readonly LABEL = localize('gotoSymbol', "Go to Symbol in Editor...");
|
||||
|
||||
constructor(
|
||||
id: string,
|
||||
label: string,
|
||||
@IQuickInputService private readonly quickInputService: IQuickInputService
|
||||
) {
|
||||
super(id, label);
|
||||
}
|
||||
|
||||
async run(): Promise<void> {
|
||||
this.quickInputService.quickAccess.show(GotoSymbolQuickAccessProvider.PREFIX);
|
||||
}
|
||||
}
|
||||
|
||||
Registry.as<IWorkbenchActionRegistry>(ActionExtensions.WorkbenchActions).registerWorkbenchAction(SyncActionDescriptor.create(GotoSymbolAction, GotoSymbolAction.ID, GotoSymbolAction.LABEL, {
|
||||
primary: KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.KEY_O
|
||||
}), 'Go to Symbol in Editor...');
|
||||
|
||||
@@ -23,37 +23,12 @@ import { localize } from 'vs/nls';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { IProgressStep, IProgress, Progress } from 'vs/platform/progress/common/progress';
|
||||
import { IResolvedTextFileEditorModel, ITextFileService, ITextFileSaveParticipant } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
import { ITextFileService, ITextFileSaveParticipant, ITextFileEditorModel } from 'vs/workbench/services/textfile/common/textfiles';
|
||||
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 { INotebookService } from 'sql/workbench/services/notebook/browser/notebookService';
|
||||
|
||||
/*
|
||||
* An update participant that ensures any un-tracked changes are synced to the JSON file contents for a
|
||||
* Notebook before save occurs. While every effort is made to ensure model changes are notified and a listener
|
||||
* updates the backing model in-place, this is a backup mechanism to hard-update the file before save in case
|
||||
* some are missed.
|
||||
*/
|
||||
class NotebookUpdateParticipant implements ITextFileSaveParticipant { // {{SQL CARBON EDIT}} add notebook participant
|
||||
|
||||
constructor(
|
||||
@INotebookService private notebookService: INotebookService
|
||||
) {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
public participate(model: IResolvedTextFileEditorModel, env: { reason: SaveReason }): Promise<void> {
|
||||
let uri = model.resource;
|
||||
let notebookEditor = this.notebookService.findNotebookEditor(uri);
|
||||
if (notebookEditor) {
|
||||
notebookEditor.notebookParams.input.updateModel();
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
export class TrimWhitespaceParticipant implements ITextFileSaveParticipant {
|
||||
|
||||
@@ -64,7 +39,11 @@ export class TrimWhitespaceParticipant implements ITextFileSaveParticipant {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
async participate(model: IResolvedTextFileEditorModel, env: { reason: SaveReason; }): Promise<void> {
|
||||
async participate(model: ITextFileEditorModel, env: { reason: SaveReason; }): Promise<void> {
|
||||
if (!model.textEditorModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.configurationService.getValue('files.trimTrailingWhitespace', { overrideIdentifier: model.textEditorModel.getLanguageIdentifier().language, resource: model.resource })) {
|
||||
this.doTrimTrailingWhitespace(model.textEditorModel, env.reason === SaveReason.AUTO);
|
||||
}
|
||||
@@ -126,7 +105,11 @@ export class FinalNewLineParticipant implements ITextFileSaveParticipant {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
async participate(model: IResolvedTextFileEditorModel, _env: { reason: SaveReason; }): Promise<void> {
|
||||
async participate(model: ITextFileEditorModel, _env: { reason: SaveReason; }): Promise<void> {
|
||||
if (!model.textEditorModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.configurationService.getValue('files.insertFinalNewline', { overrideIdentifier: model.textEditorModel.getLanguageIdentifier().language, resource: model.resource })) {
|
||||
this.doInsertFinalNewLine(model.textEditorModel);
|
||||
}
|
||||
@@ -160,7 +143,11 @@ export class TrimFinalNewLinesParticipant implements ITextFileSaveParticipant {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
async participate(model: IResolvedTextFileEditorModel, env: { reason: SaveReason; }): Promise<void> {
|
||||
async participate(model: ITextFileEditorModel, env: { reason: SaveReason; }): Promise<void> {
|
||||
if (!model.textEditorModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.configurationService.getValue('files.trimFinalNewlines', { overrideIdentifier: model.textEditorModel.getLanguageIdentifier().language, resource: model.resource })) {
|
||||
this.doTrimFinalNewLines(model.textEditorModel, env.reason === SaveReason.AUTO);
|
||||
}
|
||||
@@ -230,9 +217,13 @@ class FormatOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
// Nothing
|
||||
}
|
||||
|
||||
async participate(editorModel: IResolvedTextFileEditorModel, env: { reason: SaveReason; }, progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
const model = editorModel.textEditorModel;
|
||||
const overrides = { overrideIdentifier: model.getLanguageIdentifier().language, resource: model.uri };
|
||||
async participate(model: ITextFileEditorModel, env: { reason: SaveReason; }, progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
if (!model.textEditorModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
const textEditorModel = model.textEditorModel;
|
||||
const overrides = { overrideIdentifier: textEditorModel.getLanguageIdentifier().language, resource: textEditorModel.uri };
|
||||
|
||||
if (env.reason === SaveReason.AUTO || !this.configurationService.getValue('editor.formatOnSave', overrides)) {
|
||||
return undefined;
|
||||
@@ -247,7 +238,7 @@ class FormatOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
)
|
||||
});
|
||||
});
|
||||
const editorOrModel = findEditor(model, this.codeEditorService) || model;
|
||||
const editorOrModel = findEditor(textEditorModel, this.codeEditorService) || textEditorModel;
|
||||
await this.instantiationService.invokeFunction(formatDocumentWithSelectedProvider, editorOrModel, FormattingMode.Silent, nestedProgress, token);
|
||||
}
|
||||
}
|
||||
@@ -259,13 +250,17 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
) { }
|
||||
|
||||
async participate(editorModel: IResolvedTextFileEditorModel, env: { reason: SaveReason; }, progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
async participate(model: ITextFileEditorModel, env: { reason: SaveReason; }, progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
if (!model.textEditorModel) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (env.reason === SaveReason.AUTO) {
|
||||
return undefined;
|
||||
}
|
||||
const model = editorModel.textEditorModel;
|
||||
const textEditorModel = model.textEditorModel;
|
||||
|
||||
const settingsOverrides = { overrideIdentifier: model.getLanguageIdentifier().language, resource: editorModel.resource };
|
||||
const settingsOverrides = { overrideIdentifier: textEditorModel.getLanguageIdentifier().language, resource: model.resource };
|
||||
const setting = this.configurationService.getValue<{ [kind: string]: boolean } | string[]>('editor.codeActionsOnSave', settingsOverrides);
|
||||
if (!setting) {
|
||||
return undefined;
|
||||
@@ -304,7 +299,7 @@ class CodeActionOnSaveParticipant implements ITextFileSaveParticipant {
|
||||
.map(x => new CodeActionKind(x));
|
||||
|
||||
progress.report({ message: localize('codeaction', "Quick Fixes") });
|
||||
await this.applyOnSaveActions(model, codeActionsOnSave, excludedActions, progress, token);
|
||||
await this.applyOnSaveActions(textEditorModel, codeActionsOnSave, excludedActions, progress, token);
|
||||
}
|
||||
|
||||
private async applyOnSaveActions(model: ITextModel, codeActionsOnSave: readonly CodeActionKind[], excludes: readonly CodeActionKind[], progress: IProgress<IProgressStep>, token: CancellationToken): Promise<void> {
|
||||
@@ -368,7 +363,6 @@ export class SaveParticipantsContribution extends Disposable implements IWorkben
|
||||
this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(FormatOnSaveParticipant)));
|
||||
this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(FinalNewLineParticipant)));
|
||||
this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(TrimFinalNewLinesParticipant)));
|
||||
this._register(this.textFileService.files.addSaveParticipant(this.instantiationService.createInstance(NotebookUpdateParticipant)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import * as nls from 'vs/nls';
|
||||
import * as path from 'vs/base/common/path';
|
||||
import { Disposable, DisposableStore } from 'vs/base/common/lifecycle';
|
||||
import { ICodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { ICodeEditor, isCodeEditor } from 'vs/editor/browser/editorBrowser';
|
||||
import { registerEditorContribution } from 'vs/editor/browser/editorExtensions';
|
||||
import { IEditorContribution } from 'vs/editor/common/editorCommon';
|
||||
import { INotificationService, Severity } from 'vs/platform/notification/common/notification';
|
||||
@@ -14,6 +14,7 @@ import { IOpenerService } from 'vs/platform/opener/common/opener';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { ITextModel } from 'vs/editor/common/model';
|
||||
import { IWorkbenchThemeService } from 'vs/workbench/services/themes/common/workbenchThemeService';
|
||||
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
|
||||
|
||||
/**
|
||||
* Shows a message when semantic tokens are shown the first time.
|
||||
@@ -22,11 +23,14 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
|
||||
|
||||
public static readonly ID = 'editor.contrib.semanticHighlightHelp';
|
||||
|
||||
private static notificationShown = false;
|
||||
|
||||
constructor(
|
||||
_editor: ICodeEditor,
|
||||
@INotificationService _notificationService: INotificationService,
|
||||
@IOpenerService _openerService: IOpenerService,
|
||||
@IWorkbenchThemeService _themeService: IWorkbenchThemeService
|
||||
@IWorkbenchThemeService _themeService: IWorkbenchThemeService,
|
||||
@IEditorService _editorService: IEditorService
|
||||
) {
|
||||
super();
|
||||
|
||||
@@ -34,11 +38,21 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
|
||||
const localToDispose = toDispose.add(new DisposableStore());
|
||||
const installChangeTokenListener = (model: ITextModel) => {
|
||||
localToDispose.add(model.onDidChangeTokens((e) => {
|
||||
if (!e.semanticTokensApplied) {
|
||||
if (SemanticTokensHelp.notificationShown) {
|
||||
toDispose.dispose();
|
||||
return;
|
||||
}
|
||||
|
||||
toDispose.dispose(); // uninstall all listeners, makes sure the notification is only shown once per window
|
||||
if (!e.semanticTokensApplied) {
|
||||
return;
|
||||
}
|
||||
const activeEditorControl = _editorService.activeTextEditorControl;
|
||||
if (!isCodeEditor(activeEditorControl) || activeEditorControl.getModel() !== model) {
|
||||
return; // only show if model is in the active code editor
|
||||
}
|
||||
|
||||
toDispose.dispose(); // uninstall all listeners, make sure the notification is only shown once per window
|
||||
SemanticTokensHelp.notificationShown = true;
|
||||
|
||||
const message = nls.localize(
|
||||
{
|
||||
@@ -48,7 +62,7 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
|
||||
'Variable 1 will be a theme name.'
|
||||
]
|
||||
},
|
||||
"Semantic highlighting has been applied to '{0}' as the theme '{1}' has semantic highlighting enabled.",
|
||||
"Code coloring of '{0}' has been updated as the theme '{1}' has [semantic highlighting](https://go.microsoft.com/fwlink/?linkid=2122588) enabled.",
|
||||
path.basename(model.uri.path), _themeService.getColorTheme().label
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user