You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that goToDefinition does not support jumping to the definition of import s from "a.scss'; s['xxx']. This is because the variable declaration is only added to appropriate dts lines in dtsLines.
To resolve this issue, the proposed solution in this PR is to modify declare property by using an interface to define the property. This will allow nameExports and property to be on the same line, enabling goToDefinition to jump to the correct line number. Of course, invalid nameExports will still be filtered out.
Hi @qyzzzz, this looks like a very interesting change. This also looks like a very big change and unfortunately I'm away at the moment, but will try to look in a week or so when I'm back.
Can you confirm that you've tested that everything still works for users with other configurations than yours? It's unfortunately quite hard to test, you need to do it manually.
Hi @mrmckeb, sorry for delay here.
I have determined the feasibility of this solution by reviewing and comparing the unit test snapshots in your project.
Additionally, I have created a separate project for manual effect testing. In this round of modifications, I primarily examined the impact of these changes on the goToDefinition, namedExports, and allowUnknownClassnames options. https://github.com/qyzzzz/typescript-plugin-css-modules-goToDefinition-reproduction
Unfortunately, I am currently using VSCode and have not tested with Webstorm.😅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It seems that goToDefinition does not support jumping to the definition of
import s from "a.scss'; s['xxx']. This is because the variable declaration is only added to appropriate dts lines indtsLines.To resolve this issue, the proposed solution in this PR is to modify declare property by using an interface to define the property. This will allow nameExports and property to be on the same line, enabling goToDefinition to jump to the correct line number. Of course, invalid nameExports will still be filtered out.