Change:
The candidate fix for was to just disable language detection in notebooks by default. With a bit more time to work on it, a better solution should be derived.
is this fix insider released?
is it now :)

Discussion:
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': { <del> type: 'string', default: 'always', </del> <ins> type: 'object', default: { 'untitledEditors': true, 'notebookEditors': true }, </ins> tags: ['experimental'], <del> enum: ['always', 'notebookEditors', 'textEditors', 'never'], </del> description: localize('workbench.editor.showLanguageDetectionHints', "When enabled, shows a status bar quick fix when the editor language doesn't match detected content language."), <del> 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"), ] </del> <ins> 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"), } } </ins> }, 'workbench.editor.tabCloseButton': { 'type': 'string',

import { IEditorService } from 'vs/workbench/services/editor/common/editorService'; import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; import { IStatusbarEntry, IStatusbarEntryAccessor, IStatusbarService, StatusbarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar'; <del> import { ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; </del> <ins> import { ILanguageDetectionService, LanguageDetectionHintConfig } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; </ins> import { ThrottledDelayer } from 'vs/base/common/async'; import { ILanguageService } from 'vs/editor/common/languages/language'; import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding';

const editorModel = editor?.getModel(); const editorUri = editorModel?.uri; const existingId = editorModel?.getLanguageId(); <del> const enablementConfig = this._configurationService.getValue('workbench.editor.languageDetectionHints'); const enabled = enablementConfig === 'always' || enablementConfig === 'textEditors'; </del> <ins> const enablementConfig = this._configurationService.getValue<LanguageDetectionHintConfig>('workbench.editor.languageDetectionHints'); const enabled = typeof enablementConfig === 'object' && enablementConfig?.untitledEditors; </ins> const disableLightbulb = !enabled || editorUri?.scheme !== Schemas.untitled || !existingId; if (disableLightbulb || !editorUri) {

import { CellKind, CellStatusbarAlignment, INotebookCellStatusBarItem, INotebookCellStatusBarItemList, INotebookCellStatusBarItemProvider } from 'vs/workbench/contrib/notebook/common/notebookCommon'; import { INotebookKernelService } from 'vs/workbench/contrib/notebook/common/notebookKernelService'; import { INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService'; <del> import { ILanguageDetectionService } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; </del> <ins> import { ILanguageDetectionService, LanguageDetectionHintConfig } from 'vs/workbench/services/languageDetection/common/languageDetectionWorkerService'; </ins> import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle'; class CellStatusBarLanguagePickerProvider implements INotebookCellStatusBarItemProvider {

readonly viewType = '*'; private cache = new ResourceMap<{ <del> lastUpdate: number; lastCellLang: string; lastGuess?: string; </del> <ins> contentVersion: number; updateTimestamp: number; cellLanguage: string; guess?: string; </ins> }>(); constructor(

const cell = doc?.cells[index]; if (!cell) { return; } <del> const enablementConfig = this._configurationService.getValue('workbench.editor.languageDetectionHints'); const enabled = enablementConfig === 'always' || enablementConfig === 'notebookEditors'; </del> <ins> const enablementConfig = this._configurationService.getValue<LanguageDetectionHintConfig>('workbench.editor.languageDetectionHints'); const enabled = typeof enablementConfig === 'object' && enablementConfig?.notebookEditors; </ins> if (!enabled) { return; } <ins> const cellUri = cell.uri; const contentVersion = cell.textModel?.getVersionId(); if (!contentVersion) { return; } </ins> const currentLanguageId = cell.cellKind === CellKind.Markup ? 'markdown' : (this._languageService.getLanguageIdByLanguageName(cell.language) || cell.language); <del> if (!this.cache.has(uri)) { this.cache.set(uri, { lastCellLang: currentLanguageId, lastUpdate: 0 }); </del> <ins> if (!this.cache.has(cellUri)) { this.cache.set(cellUri, { cellLanguage: currentLanguageId, // force a re-compute upon a change in configured language updateTimestamp: 0, // facilitates a disposable-free debounce operation contentVersion: 1, // dont run for the initial contents, only on update }); </ins> } <del> const cached = this.cache.get(uri)!; if (cached.lastUpdate < Date.now() - 1000 || cached.lastCellLang !== currentLanguageId) { cached.lastUpdate = Date.now(); cached.lastCellLang = currentLanguageId; </del> <ins> const cached = this.cache.get(cellUri)!; if (cached.cellLanguage !== currentLanguageId || (cached.updateTimestamp < Date.now() - 1000 && cached.contentVersion !== contentVersion)) { cached.updateTimestamp = Date.now(); cached.cellLanguage = currentLanguageId; cached.contentVersion = contentVersion; </ins> const kernel = this._notebookKernelService.getSelectedOrSuggestedKernel(doc); if (kernel) { <del> const availableLangs = []; availableLangs.push(...kernel.supportedLanguages, 'markdown'); cached.lastGuess = await this._languageDetectionService.detectLanguage(cell.uri, availableLangs); </del> <ins> const supportedLangs = [...kernel.supportedLanguages, 'markdown']; cached.guess = await this._languageDetectionService.detectLanguage(cell.uri, supportedLangs); </ins> } } const items: INotebookCellStatusBarItem[] = []; <del> if (cached.lastGuess && currentLanguageId !== cached.lastGuess) { const detectedName = this._languageService.getLanguageName(cached.lastGuess) || cached.lastGuess; </del> <ins> if (cached.guess && currentLanguageId !== cached.guess) { const detectedName = this._languageService.getLanguageName(cached.guess) || cached.guess; </ins> let tooltip = localize('notebook.cell.status.autoDetectLanguage', "Accept Detected Language: {0}", detectedName); const keybinding = this._keybindingService.lookupKeybinding(DETECT_CELL_LANGUAGE); const label = keybinding?.getLabel();

detectLanguage(resource: URI, supportedLangs?: string[]): Promise<string | undefined>; } <ins> export type LanguageDetectionHintConfig = { untitledEditors: boolean; notebookEditors: boolean; }; </ins> //#region Telemetry events export const AutomaticLanguageDetectionLikelyWrongId = 'automaticlanguagedetection.likelywrong';