mirror of
https://github.com/Microsoft/vscode
synced 2024-10-12 06:17:18 +00:00
Show raw cell language ID when an extension is not installed for that language
Fix #136051
This commit is contained in:
parent
5300aa4054
commit
b9cf83f70b
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue