Implement language detection for notebook cells (#147537)

* Implement language detection for notebook cells

* Add lightbulb for normal text editors as well
Clean up mapping of language id's in neural model
Add config to opt out of language detection hints
This commit is contained in:
Jackson Kearl
2022-04-20 20:38:20 -07:00
committed by GitHub
parent 8cad47446f
commit bd95a8d451
10 changed files with 358 additions and 61 deletions

View File

@@ -111,6 +111,19 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
tags: ['experimental'],
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',
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"),
]
},
'workbench.editor.tabCloseButton': {
'type': 'string',
'enum': ['left', 'right', 'off'],