Skip to content

Commit

Permalink
green up some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
baronfel committed May 27, 2022
1 parent 381ca6e commit 75151b0
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/FsAutoComplete.Core/SymbolLocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,10 @@ let getDeclarationLocation

match declarationLocation with
| Some loc ->
let filePath =
Path.FilePathToUri(Path.GetFullPathSafe loc.FileName)
|> Path.FileUriToLocalPath

let isScript = isAScript filePath
let taggedFilePath = UMX.tag filePath
let normalizedFilePath = Path.GetFullPathSafe filePath
let isScript = isAScript loc.FileName
// sometimes the source file locations start with a capital, despite all of our efforts.
let normalizedPath = if System.Char.IsUpper (loc.FileName[0]) then string (System.Char.ToLowerInvariant loc.FileName[0]) + (loc.FileName.Substring(1)) else loc.FileName
let taggedFilePath = UMX.tag normalizedPath

if isScript
&& taggedFilePath = currentDocument.FileName then
Expand All @@ -49,7 +46,7 @@ let getDeclarationLocation
let projectsThatContainFile =
state.ProjectController.ProjectOptions
|> Seq.choose (fun (_, p) ->
if p.SourceFiles |> Array.contains normalizedFilePath //
if p.SourceFiles |> Array.contains normalizedPath
then
Some p
else
Expand Down

0 comments on commit 75151b0

Please sign in to comment.