Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[scss] Path resolver to include partial files support #373

Merged
merged 2 commits into from Nov 27, 2023

Conversation

dyhagho
Copy link
Contributor

@dyhagho dyhagho commented Nov 18, 2023

Context

When importing partials (e.g "_mixins.scss"), it's unnecessary to explicitly include the underscore (_). Sass inherently understands and imports files with or without the underscore. Therefore, @import "mixins.scss" is a valid way to import the partial.

Why has this change been made?

Navigating to a partial file using Command + Click or Control + Click without specifying the underscore was causing the language server to be unable to find the path.

Changes

  • Update toPathVariations function to consider partial files when the underscore has been omitted.
  • Add a new test case to ensure accurate resolution when the underscore is omitted when import partial files.

Before

before

After

after

@dyhagho
Copy link
Contributor Author

dyhagho commented Nov 18, 2023

@microsoft-github-policy-service agree

@aeschli aeschli added this to the November 2023 milestone Nov 27, 2023
@aeschli aeschli merged commit f86d093 into microsoft:main Nov 27, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants