Skip to content

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

Merged
aeschli merged 2 commits intomicrosoft:mainfrom
dyhagho:main
Nov 27, 2023
Merged

[scss] Path resolver to include partial files support#373
aeschli merged 2 commits intomicrosoft:mainfrom
dyhagho:main

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants