Skip to content

Instantly share code, notes, and snippets.

@llpereiras
Last active September 16, 2019 17:08
Show Gist options
  • Select an option

  • Save llpereiras/cabe01b8b1702815d0f3360a4e7e6b95 to your computer and use it in GitHub Desktop.

Select an option

Save llpereiras/cabe01b8b1702815d0f3360a4e7e6b95 to your computer and use it in GitHub Desktop.
Create a task to find file by selected text

Task file finder

Create a new task, following :

  • Open Terminal menu
  • Click in Configure Task
  • Select option Create a task.json file from template
  • Select option Others
  • Paste the content of task.json in the task.json file

To test the task:

  • Select some text to you think should be a class file
  • open Terminal menu
  • click in Run Task and select find_reference

The result should be: the file class should be open in the editor

You can add shortcut key combination to trigger each task by adding to keybindings.json

{
  "key": "ctrl+f12",
  "command": "workbench.action.tasks.runTask",
   "args": "find_reference"
}
{
"version": "2.0.0",
"tasks": [
{
"label": "find_reference",
"type": "shell",
"command": "/bin/bash",
"problemMatcher": [],
"args": [
"-c", "find . -name \"${selectedText}.rb\" -exec code {} \\;"
],
"presentation": {
"showReuseMessage": false
}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment