mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-14 07:54:36 +01:00
Show raw cell language ID when an extension is not installed for that language
Fix #136051
This commit is contained in:
+1
-1
@@ -36,7 +36,7 @@ class CellStatusBarLanguagePickerProvider implements INotebookCellStatusBarItemP
|
||||
const languageId = cell.cellKind === CellKind.Markup ?
|
||||
'markdown' :
|
||||
(this._modeService.getModeIdForLanguageName(cell.language) || cell.language);
|
||||
const text = this._modeService.getLanguageName(languageId) || this._modeService.getLanguageName('plaintext');
|
||||
const text = this._modeService.getLanguageName(languageId) || languageId;
|
||||
const item = <INotebookCellStatusBarItem>{
|
||||
text,
|
||||
command: CHANGE_CELL_LANGUAGE,
|
||||
|
||||
@@ -166,9 +166,9 @@ export class NotebookCellTextModel extends Disposable implements ICell {
|
||||
this._textModel = m;
|
||||
if (this._textModel) {
|
||||
// Init language from text model
|
||||
// The language defined in the cell might not be supported in the editor so the text model might be using the default fallback (plaintext)
|
||||
// The language defined in the cell might not be supported in the editor so the text model might be using the default fallback
|
||||
// If so let's not modify the language
|
||||
if (!(this._modeService.getModeId(this.language) === null && this._textModel.getLanguageId() === 'plaintext')) {
|
||||
if (!(this._modeService.getModeId(this.language) === null && (this._textModel.getLanguageId() === 'plaintext' || this._textModel.getLanguageId() === 'jupyter'))) {
|
||||
this.language = this._textModel.getLanguageId();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user