Improve notebook language detection CPU (#148761)

* Default to only show language detection hints in text editors (#148663)

* Default to only show language detection hints in text editors
Fixes https://github.com/microsoft/vscode/issues/148220

* Update to object-based config

* Clarify type of untitled editor

* Limit detection to modified cells, once per second

* Re-enable in notebooks
This commit is contained in:
Jackson Kearl
2022-05-05 10:44:59 -07:00
committed by GitHub
parent ea6e2c7d02
commit c652a2d041
4 changed files with 49 additions and 30 deletions

View File

@@ -113,17 +113,21 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
description: localize('workbench.editor.preferBasedLanguageDetection', "When enabled, a language detection model that takes into account editor history will be given higher precedence."),
},
'workbench.editor.languageDetectionHints': {
type: 'string',
default: 'always',
type: 'object',
default: { 'untitledEditors': true, 'notebookEditors': true },
tags: ['experimental'],
enum: ['always', 'notebookEditors', 'textEditors', 'never'],
description: localize('workbench.editor.showLanguageDetectionHints', "When enabled, shows a status bar quick fix when the editor language doesn't match detected content language."),
enumDescriptions: [
localize('workbench.editor.showLanguageDetectionHints.always', "Show show language detection quick fixes in both notebooks and untitled editors"),
localize('workbench.editor.showLanguageDetectionHints.notebook', "Only show language detection quick fixes in notebooks"),
localize('workbench.editor.showLanguageDetectionHints.editors', "Only show language detection quick fixes in untitled editors"),
localize('workbench.editor.showLanguageDetectionHints.never', "Never show language quick fixes"),
]
additionalProperties: false,
properties: {
untitledEditors: {
type: 'boolean',
description: localize('workbench.editor.showLanguageDetectionHints.editors', "Show in untitled text editors"),
},
notebookEditors: {
type: 'boolean',
description: localize('workbench.editor.showLanguageDetectionHints.notebook', "Show in notebook editors"),
}
}
},
'workbench.editor.tabCloseButton': {
'type': 'string',