mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
auto-renaming tags notifier popping up multiple times. Fixes #97833
This commit is contained in:
parent
4c36782f8e
commit
13952ac5b9
|
@ -298,21 +298,26 @@ export function activate(context: ExtensionContext) {
|
|||
});
|
||||
|
||||
const promptForTypeOnRenameKey = 'html.promptForTypeOnRename';
|
||||
const promptForTypeOnRename =
|
||||
!workspace.getConfiguration().get(SettingIds.renameOnType, { languageId: 'html' }) &&
|
||||
extensions.getExtension('formulahendry.auto-rename-tag') &&
|
||||
(context.globalState.get(promptForTypeOnRenameKey) !== false);
|
||||
const promptForTypeOnRename = extensions.getExtension('formulahendry.auto-rename-tag') !== undefined &&
|
||||
(context.globalState.get(promptForTypeOnRenameKey) !== false) &&
|
||||
!workspace.getConfiguration('editor', { languageId: 'html' }).get('renameOnType');
|
||||
|
||||
toDispose.push(window.onDidChangeActiveTextEditor(async e => {
|
||||
if (e && promptForTypeOnRename && documentSelector.indexOf(e.document.languageId) !== -1) {
|
||||
context.globalState.update(promptForTypeOnRenameKey, false);
|
||||
const configure = localize('configureButton', 'Configure');
|
||||
const res = await window.showInformationMessage(localize('renameOnTypeQuestion', 'VS Code now has built-in support for auto-renaming tags. Do you want to enable it?'), configure);
|
||||
if (res === configure) {
|
||||
commands.executeCommand('workbench.action.openSettings', SettingIds.renameOnType);
|
||||
if (promptForTypeOnRename) {
|
||||
const activeEditorListener = window.onDidChangeActiveTextEditor(async e => {
|
||||
if (e && documentSelector.indexOf(e.document.languageId) !== -1) {
|
||||
context.globalState.update(promptForTypeOnRenameKey, false);
|
||||
activeEditorListener.dispose();
|
||||
const configure = localize('configureButton', 'Configure');
|
||||
const res = await window.showInformationMessage(localize('renameOnTypeQuestion', 'VS Code now has built-in support for auto-renaming tags. Do you want to enable it?'), configure);
|
||||
if (res === configure) {
|
||||
commands.executeCommand('workbench.action.openSettings', SettingIds.renameOnType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
toDispose.push(activeEditorListener);
|
||||
}
|
||||
|
||||
toDispose.push();
|
||||
}
|
||||
|
||||
function getPackageInfo(context: ExtensionContext): IPackageInfo | null {
|
||||
|
|
Loading…
Reference in a new issue