How can I set "Goto Definition" work according to the language I'm working on.
For example:
In Python I want to use PythonIDE's go to definition:
{
"keys": ["ctrl+d"],
"command": "python_goto_definition"
},
And, for any other language, for instance Go, I want to use GoSublime's go to definition:
{
"keys": ["ctrl+d"],
"command": "go_sublime_goto_definition"
},
I'm wondering how can I set the context?
The context that you want is for selector
:
{
"keys": ["ctrl+d"],
"command": "python_goto_definition",
"context": [
{ "key": "selector", "operator": "equal", "operand": "source.python" }
]
},
You can add more or less specificity as needed. Use Ctrl+Shift+Alt+P or Shift+Ctrl+P (MacOS) to view the scope selector for the current position.