Skip to content

Commit dccdcf7

Browse files
authored
Fix microsoft#180290. Tweak wording accurately for install/enable missing extension. (microsoft#180961)
1 parent 30e62e1 commit dccdcf7

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/vs/workbench/contrib/notebook/browser/notebookEditor.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,10 +243,16 @@ export class NotebookEditor extends EditorPane implements INotebookEditorPane {
243243
throw new Error(localize('fail.noEditor', "Cannot open resource with notebook editor type '{0}', please check if you have the right extension installed and enabled.", input.viewType));
244244
}
245245

246+
await this._extensionsWorkbenchService.whenInitialized;
247+
const extensionInfo = this._extensionsWorkbenchService.local.find(e => e.identifier.id === knownProvider);
246248

247249
throw createEditorOpenError(new Error(localize('fail.noEditor.extensionMissing', "Cannot open resource with notebook editor type '{0}', please check if you have the right extension installed and enabled.", input.viewType)), [
248250
toAction({
249-
id: 'workbench.notebook.action.installOrEnableMissing', label: localize('notebookOpenInstallOrEnableMissingViewType', "Install and enable extension for '{0}'", input.viewType), run: async () => {
251+
id: 'workbench.notebook.action.installOrEnableMissing', label:
252+
extensionInfo
253+
? localize('notebookOpenEnableMissingViewType', "Enable extension for '{0}'", input.viewType)
254+
: localize('notebookOpenInstallMissingViewType', "Install extension for '{0}'", input.viewType)
255+
, run: async () => {
250256
const d = this._notebookService.onAddViewType(viewType => {
251257
if (viewType === input.viewType) {
252258
// serializer is registered, try to open again

0 commit comments

Comments
 (0)