A Visual Studio Code extension that allows you to quickly navigate to SASS variable definitions by clicking on variables while holding Ctrl (Windows) or Cmd (Mac).
- Jump to SASS variable definitions with Ctrl+Click (Windows) or Cmd+Click (Mac)
- Support for both SCSS and SASS files
- Support for variables, mixins, and functions
- Show all references using Alt+Shift+F12 or context menu
- Smart directory-based prioritization:
- When using Ctrl/Cmd+Click, jumps to definitions in the same directory tree first
- When using VS Code's peek view (editor.definitionLinkOpensInPeek), shows all references with same-directory matches first
- Works with partial files and imported SASS files
- Open VS Code
- Press
Ctrl+P
(Windows) orCmd+P
(Mac) to open the Quick Open dialog - Type
ext install jump-to-sass-definition
and press Enter
- Open any SCSS or SASS file
- Hold Ctrl (Windows) or Cmd (Mac) and click on any SASS variable (starting with $), mixin, or function
- You'll be taken to the definition
- If VS Code's peek view is disabled, jumps directly to the definition (prioritizing same-directory matches)
- If VS Code's peek view is enabled, shows all references in a peek view (same-directory matches listed first)
- Alternatively, use Alt+Shift+F12 to see all references in a QuickPick menu
This extension contributes the following settings:
jumpToSassVariable.showAllReferences
: (Deprecated) This setting is no longer used. Use Alt+Shift+F12 or the context menu to show all references.
VS Code settings that affect this extension:
editor.definitionLinkOpensInPeek
: Controls whether Ctrl/Cmd+Click opens definitions in a peek view or jumps directly to the file.
You can modify these settings by:
- Opening VS Code settings (
Ctrl+,
orCmd+,
) - Searching for "Jump to SASS Variable" or "Definition Link Opens In Peek"
- Adjusting the settings as needed
- Visual Studio Code version 1.74.0 or higher
- Variable definitions inside mixins or functions might not be detected in some cases
- Performance might be affected in very large workspaces with many SASS files
- Improved search behavior:
- Properly excludes node_modules and .git directories from search
- Better performance by reducing unnecessary file scanning
- Improved peek view behavior:
- When VS Code's peek view is enabled, shows all references with same-directory matches prioritized
- When peek view is disabled, maintains smart directory-based jumping
- Better integration with VS Code's native peek functionality
- Updated documentation to clarify peek view behavior
- Improved definition jumping behavior:
- Cmd/Ctrl+Click now always jumps to the first definition found
- Added new "Show All References" command (Alt+Shift+F12)
- Added context menu option to show all references
- Deprecated the showAllReferences setting
- Added support for jumping to mixin and function definitions
- Improved search performance with file caching
Update readme
Initial release of Jump to SASS Variable
- Basic variable definition jumping
- Same-directory or all-references options
- SCSS and SASS support