Skip to content

Commit 0fe3beb

Browse files
committed
add context menu item of copy import path
1 parent b84fce2 commit 0fe3beb

2 files changed

Lines changed: 18 additions & 5 deletions

File tree

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,11 @@
377377
"category": "Python",
378378
"command": "python.installJupyter",
379379
"title": "%python.command.python.installJupyter.title%"
380+
},
381+
{
382+
"category": "Python",
383+
"command": "python.copyImportPath",
384+
"title": "%python.command.python.copyImportPath.title%"
380385
}
381386
],
382387
"configuration": {
@@ -1414,6 +1419,13 @@
14141419
"when": "resourceLangId == python && !isInDiffEditor && !virtualWorkspace && shellExecutionSupported"
14151420
}
14161421
],
1422+
"editor/title/context": [
1423+
{
1424+
"command": "python.copyImportPath",
1425+
"group": "1_cutcopypaste@1060",
1426+
"when": "resourceLangId == python"
1427+
}
1428+
],
14171429
"explorer/context": [
14181430
{
14191431
"command": "python.execInTerminal",

package.nls.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
"python.command.python.analysis.restartLanguageServer.title": "Restart Language Server",
2323
"python.command.python.launchTensorBoard.title": "Launch TensorBoard",
2424
"python.command.python.refreshTensorBoard.title": "Refresh TensorBoard",
25+
"python.command.python.copyImportPath.title": "Copy Import Path",
2526
"python.createEnvironment.contentButton.description": "Show or hide Create Environment button in the editor for `requirements.txt` or other dependency files.",
2627
"python.createEnvironment.trigger.description": "Detect if environment creation is required for the current project",
2728
"python.menu.createNewFile.title": "Python File",
@@ -87,7 +88,7 @@
8788
"python.venvPath.description": "Path to folder with a list of Virtual Environments (e.g. ~/.pyenv, ~/Envs, ~/.virtualenvs).",
8889
"walkthrough.pythonWelcome.title": "Get Started with Python Development",
8990
"walkthrough.pythonWelcome.description": "Your first steps to set up a Python project with all the powerful tools and features that the Python extension has to offer!",
90-
"walkthrough.step.python.createPythonFile.title": "Create a Python file",
91+
"walkthrough.step.python.createPythonFile.title": "Create a Python file",
9192
"walkthrough.step.python.createPythonFolder.title": "Open a Python project folder",
9293
"walkthrough.step.python.createPythonFile.description": {
9394
"message": "[Open](command:toSide:workbench.action.files.openFile) or [create](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22python%22%7D) a Python file - make sure to save it as \".py\".\n[Create Python File](command:toSide:workbench.action.files.newUntitledFile?%7B%22languageId%22%3A%22python%22%7D)",
@@ -99,7 +100,7 @@
99100
},
100101
"walkthrough.step.python.createPythonFolder.description": {
101102
"message": "[Open](command:workbench.action.files.openFolder) or create a project folder.\n[Open Project Folder](command:workbench.action.files.openFolder)",
102-
"comment": [
103+
"comment": [
103104
"{Locked='](command:workbench.action.files.openFolder'}",
104105
"Do not translate the 'command:*' part inside of the '(..)'. It is an internal command syntax for VS Code",
105106
"Please make sure there is no space between the right bracket and left parenthesis: ]( this is an internal syntax for links"
@@ -129,7 +130,7 @@
129130
"walkthrough.step.python.createEnvironment.title": "Select or create a Python environment",
130131
"walkthrough.step.python.createEnvironment.description": {
131132
"message": "Create an environment for your Python project or use [Select Python Interpreter](command:python.setInterpreter) to select an existing one.\n[Create Environment](command:python.createEnvironment)\n**Tip**: Run the ``Python: Create Environment`` command in the [Command Palette](command:workbench.action.showCommands).",
132-
"comment": [
133+
"comment": [
133134
"{Locked='](command:python.createEnvironment'}",
134135
"{Locked='](command:workbench.action.showCommands'}",
135136
"{Locked='](command:python.setInterpreter'}",
@@ -141,8 +142,8 @@
141142
"walkthrough.step.python.runAndDebug.description": "Open your Python file and click on the play button on the top right of the editor, or press F5 when on the file and select \"Python File\" to run with the debugger. \n \n[Learn more](https://code.visualstudio.com/docs/python/python-tutorial#_run-hello-world)",
142143
"walkthrough.step.python.learnMoreWithDS.title": "Keep exploring!",
143144
"walkthrough.step.python.learnMoreWithDS.description": {
144-
"message":"🎨 Explore all the features the Python extension has to offer by looking for \"Python\" in the [Command Palette](command:workbench.action.showCommands). \n 📈 Learn more about getting started with [data science](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D) in Python. \n ✨ Take a look at our [Release Notes](https://aka.ms/AA8dxtb) to learn more about the latest features. \n \n[Follow along with the Python Tutorial](https://aka.ms/AA8dqti)",
145-
"comment":[
145+
"message": "🎨 Explore all the features the Python extension has to offer by looking for \"Python\" in the [Command Palette](command:workbench.action.showCommands). \n 📈 Learn more about getting started with [data science](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D) in Python. \n ✨ Take a look at our [Release Notes](https://aka.ms/AA8dxtb) to learn more about the latest features. \n \n[Follow along with the Python Tutorial](https://aka.ms/AA8dqti)",
146+
"comment": [
146147
"{Locked='](command:workbench.action.showCommands'}",
147148
"{Locked='](command:workbench.action.openWalkthrough?%7B%22category%22%3A%22ms-python.python%23pythonDataScienceWelcome%22%2C%22step%22%3A%22ms-python.python%23python.createNewNotebook%22%7D'}",
148149
"Do not translate the 'command:*' part inside of the '(..)'. It is an internal command syntax for VS Code",

0 commit comments

Comments
 (0)