From a60a3180f777856c4391f1a426a4ede7dd993553 Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Mon, 11 Oct 2021 13:09:19 -0700 Subject: [PATCH 1/4] Hide UI elements that are not applicable when using VS Code Web --- package.json | 232 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 207 insertions(+), 25 deletions(-) diff --git a/package.json b/package.json index 6c64757e71de..f7529f66b1bb 100644 --- a/package.json +++ b/package.json @@ -1708,67 +1708,249 @@ ], "menus": { "commandPalette": [ + { + "category": "Python", + "command": "python.analysis.clearCache", + "title": "%python.command.python.analysis.clearCache.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.analysis.restartLanguageServer", + "title": "%python.command.python.analysis.restartLanguageServer.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.clearPersistentStorage", + "title": "%python.command.python.clearPersistentStorage.title%", + "when": "!virtualWorkspace" + }, { "category": "Python", "command": "python.clearWorkspaceInterpreter", - "title": "%python.command.python.clearWorkspaceInterpreter.title%" + "title": "%python.command.python.clearWorkspaceInterpreter.title%", + "when": "!virtualWorkspace" }, { "category": "Python", - "command": "python.launchTensorBoard" + "command": "python.configureTests", + "title": "%python.command.python.configureTests.title%", + "when": "!virtualWorkspace" }, { "category": "Python", - "command": "python.switchOffInsidersChannel", - "title": "%python.command.python.switchOffInsidersChannel.title%", - "when": "config.python.insidersChannel != 'default'" + "command": "python.createTerminal", + "title": "%python.command.python.createTerminal.title%", + "when": "!virtualWorkspace" }, { "category": "Python", - "command": "python.switchToDailyChannel", - "title": "%python.command.python.switchToDailyChannel.title%", - "when": "config.python.insidersChannel != 'daily'" + "command": "python.enableLinting", + "title": "%python.command.python.enableLinting.title%", + "when": "!virtualWorkspace" }, { "category": "Python", - "command": "python.switchToWeeklyChannel", - "title": "%python.command.python.switchToWeeklyChannel.title%", - "when": "config.python.insidersChannel != 'weekly'" + "command": "python.enableSourceMapSupport", + "title": "%python.command.python.enableSourceMapSupport.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.execInTerminal", + "title": "%python.command.python.execInTerminal.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.execInTerminal-icon", + "icon": "$(play)", + "title": "%python.command.python.execInTerminal.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.debugInTerminal", + "icon": "$(debug-alt)", + "title": "%python.command.python.debugInTerminal.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.execSelectionInDjangoShell", + "title": "%python.command.python.execSelectionInDjangoShell.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.execSelectionInTerminal", + "title": "%python.command.python.execSelectionInTerminal.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.goToPythonObject", + "title": "%python.command.python.goToPythonObject.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.launchTensorBoard", + "title": "%python.command.python.launchTensorBoard.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.refreshTensorBoard", + "enablement": "python.hasActiveTensorBoardSession", + "icon": "$(refresh)", + "title": "%python.command.python.refreshTensorBoard.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Test", + "command": "python.refreshTests", + "icon": "$(refresh)", + "title": "%python.command.python.refreshTests.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Test", + "command": "python.refreshingTests", + "icon": { + "dark": "resources/dark/discovering-tests.svg", + "light": "resources/light/discovering-tests.svg" + }, + "title": "%python.command.python.refreshingTests.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Test", + "command": "python.stopRefreshingTests", + "icon": "$(stop-circle)", + "title": "%python.command.python.stopRefreshingTests.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.reportIssue", + "title": "%python.command.python.reportIssue.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Test", + "command": "testing.reRunFailTests", + "icon": "$(run-errors)", + "title": "%python.command.testing.rerunFailedTests.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.runLinting", + "title": "%python.command.python.runLinting.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.setInterpreter", + "title": "%python.command.python.setInterpreter.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.setLinter", + "title": "%python.command.python.setLinter.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python Refactor", + "command": "python.sortImports", + "title": "%python.command.python.sortImports.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.startREPL", + "title": "%python.command.python.startREPL.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.viewLanguageServerOutput", + "enablement": "python.hasLanguageServerOutputChannel", + "title": "%python.command.python.viewLanguageServerOutput.title%", + "when": "!virtualWorkspace" }, { "category": "Python", "command": "python.viewOutput", - "title": "%python.command.python.viewOutput.title%" - } + "icon": { + "dark": "resources/dark/repl.svg", + "light": "resources/light/repl.svg" + }, + "title": "%python.command.python.viewOutput.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.clearWorkspaceInterpreter", + "title": "%python.command.python.clearWorkspaceInterpreter.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchOffInsidersChannel", + "title": "%python.command.python.switchOffInsidersChannel.title%", + "when": "config.python.insidersChannel != 'default' && !virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchToDailyChannel", + "title": "%python.command.python.switchToDailyChannel.title%", + "when": "config.python.insidersChannel != 'daily' && !virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchToWeeklyChannel", + "title": "%python.command.python.switchToWeeklyChannel.title%", + "when": "config.python.insidersChannel != 'weekly' && !virtualWorkspace" + }, + { + "category": "Python", + "command": "python.viewOutput", + "title": "%python.command.python.viewOutput.title%", + "when": "!virtualWorkspace" + } ], "editor/context": [ { "command": "python.execInTerminal", "group": "Python", - "when": "resourceLangId == python" + "when": "resourceLangId == python && !virtualWorkspace" }, { "command": "python.execSelectionInDjangoShell", "group": "Python", - "when": "editorHasSelection && editorLangId == python && python.isDjangoProject" + "when": "editorHasSelection && editorLangId == python && python.isDjangoProject && !virtualWorkspace" }, { "command": "python.execSelectionInTerminal", "group": "Python", - "when": "editorFocus && editorLangId == python" + "when": "editorFocus && editorLangId == python && !virtualWorkspace" }, { "command": "python.sortImports", "group": "Refactor", "title": "Refactor: Sort Imports", - "when": "editorLangId == python && !notebookEditorFocused" + "when": "editorLangId == python && !notebookEditorFocused && !virtualWorkspace" } ], "editor/title": [ { "command": "python.refreshTensorBoard", "group": "navigation@0", - "when": "python.hasActiveTensorBoardSession" + "when": "python.hasActiveTensorBoardSession && !virtualWorkspace" } ], "editor/title/run": [ @@ -1776,41 +1958,41 @@ "command": "python.execInTerminal-icon", "group": "navigation@0", "title": "%python.command.python.execInTerminal.title%", - "when": "resourceLangId == python && !isInDiffEditor" + "when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace" }, { "command": "python.debugInTerminal", "group": "navigation@1", "title": "%python.command.python.debugInTerminal.title%", - "when": "resourceLangId == python && !isInDiffEditor" + "when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace" } ], "explorer/context": [ { "command": "python.execInTerminal", "group": "Python", - "when": "resourceLangId == python" + "when": "resourceLangId == python && !virtualWorkspace" } ], "view/title": [ { "command": "python.refreshTests", - "when": "view == workbench.view.testing && !refreshingTests && inShowRefreshingTestsExperiment", + "when": "view == workbench.view.testing && !refreshingTests && inShowRefreshingTestsExperiment && !virtualWorkspace", "group": "navigation@0" }, { "command": "python.refreshingTests", - "when": "view == workbench.view.testing && refreshingTests && inShowRefreshingTestsExperiment", + "when": "view == workbench.view.testing && refreshingTests && inShowRefreshingTestsExperiment && !virtualWorkspace", "group": "navigation@0" }, { "command": "python.stopRefreshingTests", - "when": "view == workbench.view.testing && refreshingTests && inShowRefreshingTestsExperiment", + "when": "view == workbench.view.testing && refreshingTests && inShowRefreshingTestsExperiment && !virtualWorkspace", "group": "navigation@0" }, { "command": "testing.reRunFailTests", - "when": "view == workbench.view.testing && hasFailedTests && inShowRunFailedTestsExperiment", + "when": "view == workbench.view.testing && hasFailedTests && inShowRunFailedTestsExperiment && !virtualWorkspace", "group": "navigation@1" } ] From c6772f8312d5c3f391d0af12f6d99e31c2f5b55d Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Mon, 11 Oct 2021 13:12:49 -0700 Subject: [PATCH 2/4] Fix indentaiton --- package.json | 60 ++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/package.json b/package.json index f7529f66b1bb..8f58a31c4b03 100644 --- a/package.json +++ b/package.json @@ -1882,46 +1882,36 @@ "title": "%python.command.python.viewLanguageServerOutput.title%", "when": "!virtualWorkspace" }, + { + "category": "Python", + "command": "python.clearWorkspaceInterpreter", + "title": "%python.command.python.clearWorkspaceInterpreter.title%", + "when": "!virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchOffInsidersChannel", + "title": "%python.command.python.switchOffInsidersChannel.title%", + "when": "config.python.insidersChannel != 'default' && !virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchToDailyChannel", + "title": "%python.command.python.switchToDailyChannel.title%", + "when": "config.python.insidersChannel != 'daily' && !virtualWorkspace" + }, + { + "category": "Python", + "command": "python.switchToWeeklyChannel", + "title": "%python.command.python.switchToWeeklyChannel.title%", + "when": "config.python.insidersChannel != 'weekly' && !virtualWorkspace" + }, { "category": "Python", "command": "python.viewOutput", - "icon": { - "dark": "resources/dark/repl.svg", - "light": "resources/light/repl.svg" - }, "title": "%python.command.python.viewOutput.title%", "when": "!virtualWorkspace" - }, - { - "category": "Python", - "command": "python.clearWorkspaceInterpreter", - "title": "%python.command.python.clearWorkspaceInterpreter.title%", - "when": "!virtualWorkspace" - }, - { - "category": "Python", - "command": "python.switchOffInsidersChannel", - "title": "%python.command.python.switchOffInsidersChannel.title%", - "when": "config.python.insidersChannel != 'default' && !virtualWorkspace" - }, - { - "category": "Python", - "command": "python.switchToDailyChannel", - "title": "%python.command.python.switchToDailyChannel.title%", - "when": "config.python.insidersChannel != 'daily' && !virtualWorkspace" - }, - { - "category": "Python", - "command": "python.switchToWeeklyChannel", - "title": "%python.command.python.switchToWeeklyChannel.title%", - "when": "config.python.insidersChannel != 'weekly' && !virtualWorkspace" - }, - { - "category": "Python", - "command": "python.viewOutput", - "title": "%python.command.python.viewOutput.title%", - "when": "!virtualWorkspace" - } + } ], "editor/context": [ { From de1e3ae44e37342c7f0ef02feeffe5401bc9600b Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Mon, 11 Oct 2021 13:15:22 -0700 Subject: [PATCH 3/4] News entry --- news/2 Fixes/17252.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 news/2 Fixes/17252.md diff --git a/news/2 Fixes/17252.md b/news/2 Fixes/17252.md new file mode 100644 index 000000000000..bbe585b0199e --- /dev/null +++ b/news/2 Fixes/17252.md @@ -0,0 +1 @@ +Hide UI elements that are not applicable when using `github.dev` or any other web platform. From de33dc2a3d8cdb2cc4ec1314bb859e84c9a0bf2c Mon Sep 17 00:00:00 2001 From: Kartik Raj Date: Mon, 11 Oct 2021 13:19:39 -0700 Subject: [PATCH 4/4] Disable welcome view for testing --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 8f58a31c4b03..b26137a672a4 100644 --- a/package.json +++ b/package.json @@ -1990,7 +1990,8 @@ "viewsWelcome": [ { "view": "testing", - "contents": "Configure a test framework to see your tests here.\n[Configure Python Tests](command:python.configureTests)" + "contents": "Configure a test framework to see your tests here.\n[Configure Python Tests](command:python.configureTests)", + "when": "!virtualWorkspace" } ], "yamlValidation": [