Skip to content

Commit

Permalink
Inline SCSS extension removal in target URI parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
dyhagho committed Nov 18, 2023
1 parent 5244e86 commit b675f71
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/services/scssNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,7 @@ function toPathVariations(target: string): DocumentUri[] {
return [target + 'index.scss', target + '_index.scss'];
}

const targetWithoutScssExtension = target.replace(/\.scss$/, '');

const targetUri = URI.parse(targetWithoutScssExtension);
const targetUri = URI.parse(target.replace(/\.scss$/, ''));
const basename = Utils.basename(targetUri);
const dirname = Utils.dirname(targetUri);
if (basename.startsWith('_')) {
Expand All @@ -67,8 +65,8 @@ function toPathVariations(target: string): DocumentUri[] {
return [
Utils.joinPath(dirname, basename + '.scss').toString(true),
Utils.joinPath(dirname, '_' + basename + '.scss').toString(true),
targetWithoutScssExtension + '/index.scss',
targetWithoutScssExtension + '/_index.scss',
target + '/index.scss',
target + '/_index.scss',
Utils.joinPath(dirname, basename + '.css').toString(true)
];
}

0 comments on commit b675f71

Please sign in to comment.