Skip to content

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

Merged
mrmckeb merged 1 commit intomrmckeb:mainfrom
smoores-dev:typescript-5-paths-support
Sep 22, 2023
Merged

fix: update module resolution for non-relative paths#229
mrmckeb merged 1 commit intomrmckeb:mainfrom
smoores-dev:typescript-5-paths-support

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
@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