-
Notifications
You must be signed in to change notification settings - Fork 196
SCSS: resolve bare module imports on Windows (#245579) #440
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
Open
IsaacTian05
wants to merge
9
commits into
microsoft:main
Choose a base branch
from
IsaacTian05:fix/scss-import-node-modules
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
447bfa1
fix(scss): resolve bare-module imports to node_modules on all platfor…
IsaacTian05 e427693
test fix(scss): resolve bare-module imports to node_modules on all pl…
IsaacTian05 0df65eb
Create .travis.yml
IsaacTian05 7425309
Create triggerbuild.txt
IsaacTian05 a562b11
Delete .travis.yml
IsaacTian05 5f2bc5a
Change target (URI) to not contain '\' character
IsaacTian05 2e618be
Delete triggerbuild.txt
IsaacTian05 1d6f462
fix cssNavigation: detect scheme‑prefixed import paths with regex
IsaacTian05 a75501c
test scss‑navigation : verify scheme‑prefixed @import paths remain ab…
IsaacTian05 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { assert } from 'chai'; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please move these into scssNavigation.test.ts, where we have all other tests for node module resolving. |
||
import { getSCSSLanguageService } from '../../cssLanguageService'; | ||
import { TextDocument } from 'vscode-languageserver-textdocument'; | ||
import { FileType, getNodeFSRequestService } from '../../nodeFs'; | ||
import { URI } from 'vscode-uri'; | ||
|
||
const ls = getSCSSLanguageService(); | ||
const mockFS = getNodeFSRequestService(); | ||
|
||
describe('SCSS link navigation – node_modules', () => { | ||
it('resolves bootstrap path on Windows', async () => { | ||
const doc = TextDocument.create('file:///c:/proj/app.scss', 'scss', 1, | ||
"@import 'bootstrap/scss/variables';"); | ||
const links = await ls.findDocumentLinks2(doc, ls.parseStylesheet(doc), {}, mockFS); | ||
const expected = URI.file('c:/proj/node_modules/bootstrap/scss/_variables.scss').toString(); | ||
assert.strictEqual(links[0].target, expected); | ||
}); | ||
}); |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
build | ||
IsaacTian05 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a use a regex to make that check [
startsWithSchemeRegex = /^\w[\w\d+.-]:/