Allows copying the Ruby member reference under the cursor to the clipboard.
It has a simple built-in regex-based parser that supports most common scenarios: modules, classes, instance methods, class methods and constants.
- Copy Ruby Member Reference command: will copy the current reference to the clipboard.
No keyboard shortcut is provided at the moment to prevent conflicts with other extensions. Suggested usage is via the command palette, typically pressing Cmd+Shift+P / Ctrl+Shift+P and typing the command name.
Follow the keybindings documentation to map the copy-ruby-member-reference.copyReference command to your own keybinding.
To avoid additional dependencies or a language-server integration, parsing is built into the extension as a regex-based engine relying on proper indentation.
It won't identify references inside methods.
Please see the changelog.
Other existing extensions wouldn't cover scenarios that I needed and I wanted to have some fun writing my own extension and also used the opportunity learn Typescript.
- Open the debug viewlet (
Ctrl+Shift+DorCmd+Shift+Don Mac) and from the launch configuration dropdown pickExtension Tests. - Press
F5to run the tests in a new window with your extension loaded. - See the output of the test result in the debug console.
- Bump version:
npm version [patch|minor|major] - Update the version in
package.json - Add release notes in
CHANGELOG.md - Commit and merge your branch to
main - Publish:
npx vsce publish