Skip to content

fix: handle scoped packages with _index on package root #285

Merged
aeschli merged 3 commits intomicrosoft:mainfrom
wkillerud:fix/scoped-root
Aug 31, 2022
Merged

fix: handle scoped packages with _index on package root #285
aeschli merged 3 commits intomicrosoft:mainfrom
wkillerud:fix/scoped-root

Conversation

@wkillerud
Copy link
Copy Markdown
Contributor

Fixes #284

Like I mentioned in the issue, there's still a bug when I cmd/ctrl + click the link @use "@foo/bar"; where VS Code tries to open the file of that name. I wasn't able to figure out where and how to fix that.

@ghost
Copy link
Copy Markdown

ghost commented Aug 14, 2022

CLA assistant check
All CLA requirements met.

@aeschli aeschli requested a review from dbaeumer August 30, 2022 17:59
@aeschli aeschli self-assigned this Aug 30, 2022
@aeschli aeschli added this to the September 2022 milestone Aug 30, 2022
@aeschli
Copy link
Copy Markdown
Collaborator

aeschli commented Aug 30, 2022

Thanks @wkillerud. I added another commit to fix the open. The reason was a unnecessary encoding of the @.

I updated the test in the following way

  • @use '@foo/bar/baz resolves to node_modules/@foo/bar/_baz.scss
  • @use '@foo/bar resolves to node_modules/@foo/bar/_index.scss

Please speak up, if I misunderstand how @use works

@wkillerud
Copy link
Copy Markdown
Contributor Author

Nice, thank you!

@use '@foo/bar/baz resolves to node_modules/@foo/bar/_baz.scss

If _baz.scss exists, yes. Otherwise it might resolve to:

  • node_modules/@foo/bar/baz.scss (non-partial)
  • node_modules/@foo/bar/baz/_index.scss (where baz is another directory with an index file))

@use '@foo/bar resolves to node_modules/@foo/bar/_index.scss

Yes

@aeschli
Copy link
Copy Markdown
Collaborator

aeschli commented Aug 31, 2022

If _baz.scss exists, yes. Otherwise it might resolve to:

  • node_modules/@foo/bar/baz.scss (non-partial)
  • node_modules/@foo/bar/baz/_index.scss (where baz is another directory with an index file))

Yes, that's how it's implemented.

@aeschli aeschli merged commit 224b5e4 into microsoft:main Aug 31, 2022
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.

Link error for scoped packages that export from the root level

3 participants