From 01ad668b678a4098238ad96140427612b6efee5a Mon Sep 17 00:00:00 2001 From: Simon Stranks Date: Tue, 31 Oct 2023 14:46:14 +0000 Subject: [PATCH] fix(formatting): swtiched to default formatter --- src/services/cssNavigation.ts | 36 +++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/services/cssNavigation.ts b/src/services/cssNavigation.ts index 7ef401c5..b7b63add 100644 --- a/src/services/cssNavigation.ts +++ b/src/services/cssNavigation.ts @@ -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(''), kind, @@ -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;