Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
  • Loading branch information
Booksbaum committed Feb 21, 2023
1 parent ab85f11 commit 1c57b52
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 20 deletions.
28 changes: 11 additions & 17 deletions src/FsAutoComplete.Core/Commands.fs
Original file line number Diff line number Diff line change
Expand Up @@ -786,16 +786,16 @@ module Commands =
| scope ->
let projectsToCheck =
match scope with
| Some (SymbolDeclarationLocation.Projects (projects (*isLocalForProject=*) , true)) -> projects
| Some (SymbolDeclarationLocation.Projects (projects (*isLocalForProject=*) , false)) ->
| Some(SymbolDeclarationLocation.Projects(projects (*isLocalForProject=*) , true)) -> projects
| Some(SymbolDeclarationLocation.Projects(projects (*isLocalForProject=*) , false)) ->
[ for project in projects do
yield project

yield!
project.ReferencedProjects
|> Array.choose (fun p -> UMX.tag p.OutputFile |> tryGetProjectOptionsForFsproj) ]
|> List.distinctBy (fun x -> x.ProjectFileName)
| _ (*None*) ->
| _ (*None*) ->
// symbol is declared external -> look through all F# projects
// (each script (including untitled) has its own project -> scripts get checked too. But only once they are loaded (-> inside `state`))
getAllProjectOptions ()
Expand Down Expand Up @@ -858,11 +858,10 @@ module Commands =
|> Async.Catch
|> Async.map (Result.ofChoice >> Result.mapError string >> Result.bind id)
|> AsyncResult.teeError (fun e ->
commandsLogger.info (
Log.setMessage "tryFindReferencesInFile failed: {error}"
>> Log.addContextDestructured "error" e
)
)
commandsLogger.info (
Log.setMessage "tryFindReferencesInFile failed: {error}"
>> Log.addContextDestructured "error" e
))

let iterProject (project: FSharpProjectOptions) =
asyncResult {
Expand Down Expand Up @@ -907,14 +906,9 @@ module Commands =

// `IsIdentifierName` doesn't work with backticks
// -> only check if no backticks
let newBacktickedName =
newName
|> PrettyNaming.NormalizeIdentifierBackticks
if
newBacktickedName.StartsWith "``"
&&
newBacktickedName.EndsWith "``"
then
let newBacktickedName = newName |> PrettyNaming.NormalizeIdentifierBackticks

if newBacktickedName.StartsWith "``" && newBacktickedName.EndsWith "``" then
return newBacktickedName
elif PrettyNaming.IsIdentifierName newName then
return newName
Expand Down Expand Up @@ -1961,7 +1955,7 @@ type Commands(checker: FSharpCompilerServiceChecker, state: State, hasAnalyzers:
async {
match state.TryGetFileCheckerOptionsWithLines(file) with
| Error _ -> return [||]
| Ok (opts, source) ->
| Ok(opts, source) ->
match checker.TryGetRecentCheckResultsForFile(file, opts, source) with
| None -> return [||]
| Some tyRes ->
Expand Down
5 changes: 4 additions & 1 deletion src/FsAutoComplete.Core/SymbolLocation.fs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ let getDeclarationLocation
) : SymbolDeclarationLocation option =

// `symbolUse.IsPrivateToFile` throws exception when no `DeclarationLocation`
if symbolUse.Symbol.DeclarationLocation |> Option.isSome && symbolUse.IsPrivateToFile then
if
symbolUse.Symbol.DeclarationLocation |> Option.isSome
&& symbolUse.IsPrivateToFile
then
Some SymbolDeclarationLocation.CurrentDocument
else
let isSymbolLocalForProject = symbolUse.Symbol.IsInternalToProject
Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -3156,7 +3156,7 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
Arguments = None } }
)

| Ok (_, uses) ->
| Ok(_, uses) ->
let allUses = uses.Values |> Array.concat

let cmd =
Expand Down
2 changes: 1 addition & 1 deletion src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,7 @@ type FSharpLspServer(state: State, lspClient: FSharpLspClient) =
Arguments = None } }
)

| Ok (_, uses) ->
| Ok(_, uses) ->
let allUses = uses.Values |> Array.concat

let cmd =
Expand Down

0 comments on commit 1c57b52

Please sign in to comment.