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

fix: update module resolution for non-relative paths #229

Merged
merged 1 commit into from
Sep 22, 2023

Conversation

smoores-dev
Copy link
Contributor

@smoores-dev smoores-dev commented Jun 20, 2023

Fixes #227.

This change generalizes "module resolution with failed lookup locations" so that it works for newer implementations of the typescript language server, which provide such information in the response for resolveModuleNameLiterals, rather than implementing a separate getResolvedModuleWithFailedLookupLocationsFromCache.

Tested locally in a project using Typescript 5 and path aliases, and imports like:

import {
  editorContainer,
  tableOfContentsContainer,
} from "@/components/app.module.css"

which were failing before this change now successfully show type information and support "Go to Definition", etc.

@smoores-dev
Copy link
Contributor Author

Hey @mrmckeb! I imagine you've got a ton of other stuff going on, but let me know if you have a chance to take a look at this any time soon! I'd love to get your thoughts. Thanks so much for all of your work on this plugin!

@LoiLock
Copy link

LoiLock commented Sep 5, 2023

Any updates?

@smoores-dev
Copy link
Contributor Author

Hey @mrmckeb! I just wanted to check in and see whether you might have a chance to take a look at this PR sometime soon!

Copy link
Owner

@mrmckeb mrmckeb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @smoores-dev - this looks great to me. Sorry for the very slow turnaround, I try to check in once every 2-3 weeks (unless there's a critical issue) but had a bit more going on recently.

@mrmckeb mrmckeb changed the title Fix module resolution for non-relative paths in newer tsserver implementations fix: update module resolution for non-relative paths Sep 22, 2023
@mrmckeb mrmckeb closed this Sep 22, 2023
@mrmckeb mrmckeb reopened this Sep 22, 2023
@mrmckeb
Copy link
Owner

mrmckeb commented Sep 22, 2023

Closing and reopening to trigger tests, etc.

@mrmckeb mrmckeb merged commit e21ae36 into mrmckeb:main Sep 22, 2023
1 check passed
@mrmckeb
Copy link
Owner

mrmckeb commented Sep 25, 2023

I plan to get this out in the next day or two - I also need to set up automatic releases for this repo.

@mrmckeb
Copy link
Owner

mrmckeb commented Oct 16, 2023

Sorry this took so long. Released:
https://github.com/mrmckeb/typescript-plugin-css-modules/releases/tag/v5.0.2

@smoores-dev smoores-dev deleted the typescript-5-paths-support branch October 16, 2023 16:08
sungik-choi added a commit to sungik-choi/bezier-react that referenced this pull request Dec 12, 2023
sungik-choi added a commit to sungik-choi/bezier-react that referenced this pull request Dec 13, 2023
sungik-choi added a commit to sungik-choi/bezier-react that referenced this pull request Dec 13, 2023
sungik-choi added a commit to sungik-choi/bezier-react that referenced this pull request Dec 14, 2023
sungik-choi added a commit to sungik-choi/bezier-react that referenced this pull request Dec 15, 2023
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.

Autocomplete not working with global path
3 participants