Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/cssLanguageService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ export function getCSSLanguageService(options: LanguageServiceOptions = defaultL
new Parser(),
new CSSCompletion(null, options, cssDataManager),
new CSSHover(options && options.clientCapabilities, cssDataManager),
new CSSNavigation(options && options.fileSystemProvider, false),
new CSSNavigation(options && options.fileSystemProvider, true),
new CSSCodeActions(cssDataManager),
new CSSValidation(cssDataManager),
cssDataManager
Expand Down
2 changes: 1 addition & 1 deletion src/services/cssNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ function toTwoDigitHex(n: number): string {
export function getModuleNameFromPath(path: string) {
const firstSlash = path.indexOf('/');
if (firstSlash === -1) {
return '';
return path;
}

// If a scoped module (starts with @) then get up until second instance of '/', or to the end of the string for root-level imports.
Expand Down
10 changes: 10 additions & 0 deletions src/test/css/navigation.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,16 @@ suite('CSS - Navigation', () => {
[{ range: newRange(8, 24), target: getTestResource('green/c.css') }], 'css', testUri, workspaceFolder
);
});

test('bare module specifier resolving', async function () {
const ls = getCSSLS();
const testUri = getTestResource('about.css');
const workspaceFolder = getTestResource('');

await assertLinks(ls, '@import "foo/bar.css"',
[{ range: newRange(8, 21), target: getTestResource('node_modules/foo/bar.css') }], 'css', testUri, workspaceFolder
);
});
});

suite('Color', () => {
Expand Down
1 change: 1 addition & 0 deletions test/linksTestFixtures/node_modules/foo/bar.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading