Skip to content

Commit

Permalink
fix(formatting): swtiched to default formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
SStranks committed Oct 31, 2023
1 parent ae475de commit 01ad668
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions src/services/cssNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class CSSNavigation {
if (!selectionRange || !containsRange(range, selectionRange)) {
selectionRange = Range.create(range.start, range.start);
}

const entry: DocumentSymbol = {
name: name || l10n.t('<undefined>'),
kind,
Expand Down Expand Up @@ -410,23 +410,23 @@ export class CSSNavigation {
}

// Try resolving the reference from the language configuration alias settings
if (ref && !(await this.fileExists(ref))){
const rootFolderUri = documentContext.resolveReference('/', documentUri);
if (settings?.paths && rootFolderUri) {
// Specific file reference
if (target in settings.paths){
return this.mapReference(joinPath(rootFolderUri, settings.paths[target]), isRawLink);
}
// Reference folder
const firstSlash = target.indexOf('/');
const prefix = `${target.substring(0, firstSlash)}/*`;
if (prefix in settings.paths){
const aliasPath = (settings.paths[prefix]).slice(0, -1);
let newPath = joinPath(rootFolderUri, aliasPath);
return this.mapReference(newPath = joinPath(newPath, target.substring(prefix.length - 1)), isRawLink);
}
}
}
if (ref && !(await this.fileExists(ref))) {
const rootFolderUri = documentContext.resolveReference('/', documentUri);
if (settings?.paths && rootFolderUri) {
// Specific file reference
if (target in settings.paths) {
return this.mapReference(joinPath(rootFolderUri, settings.paths[target]), isRawLink);
}
// Reference folder
const firstSlash = target.indexOf('/');
const prefix = `${target.substring(0, firstSlash)}/*`;
if (prefix in settings.paths) {
const aliasPath = (settings.paths[prefix]).slice(0, -1);
let newPath = joinPath(rootFolderUri, aliasPath);
return this.mapReference(newPath = joinPath(newPath, target.substring(prefix.length - 1)), isRawLink);
}
}
}

// fall back. it might not exists
return ref;
Expand Down

0 comments on commit 01ad668

Please sign in to comment.