提交 3b64f229 编写于 作者: M Martin Aeschlimann

show semantic highlight notification only once

上级 dd478dda
......@@ -23,6 +23,8 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
public static readonly ID = 'editor.contrib.semanticHighlightHelp';
private static notificationShown = false;
constructor(
_editor: ICodeEditor,
@INotificationService _notificationService: INotificationService,
......@@ -36,6 +38,11 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
const localToDispose = toDispose.add(new DisposableStore());
const installChangeTokenListener = (model: ITextModel) => {
localToDispose.add(model.onDidChangeTokens((e) => {
if (SemanticTokensHelp.notificationShown) {
toDispose.dispose();
return;
}
if (!e.semanticTokensApplied) {
return;
}
......@@ -45,6 +52,7 @@ export class SemanticTokensHelp extends Disposable implements IEditorContributio
}
toDispose.dispose(); // uninstall all listeners, make sure the notification is only shown once per window
SemanticTokensHelp.notificationShown = true;
const message = nls.localize(
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册