CSS - Search in parent folders for node module resolution#81555
Merged
aeschli merged 3 commits intomicrosoft:masterfrom May 14, 2020
Merged
Conversation
This was referenced Sep 27, 2019
Contributor
Author
Contributor
Author
|
@Tyriar any more I can do to get this in to a release? |
Member
|
@penx I have nothing to do with this, I simply pushed it out as it didn't make it into the release. |
Contributor
Author
After rebasing off master, the above error is reported. Pretty sure this is unrelated to this PR and tests should be rerun |
Contributor
|
@penx Sorry for the wait. |
3875853 to
237c803
Compare
Contributor
Author
…ort-parent-folders
Contributor
|
Thanks @penx! |
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Replaces my previous PR #79651 by implementing recommendations from @octref on #78894 .
Further to #70693 which was reworked by @aeschli in 8f72934 due to issues with require.resolve and webpack.
The current implementation for microsoft/vscode-css-languageservice#136 resolves the path to a CSS module but only looks for node_modules in the same folder as the CSS file, which for many use cases is not sufficient.
This PR updates
resolvePathToModuleso that it looks in parent folders for the existence ofnode_modules/module-nameall the way up to the workspace root, following node module resolution.Alternative approaches were raised in #79651 and this approach was preferred by @octref in #78894 (comment).