Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nicer UX in case of error case in CodeLensResolve #989

Merged
merged 2 commits into from
Aug 16, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/FsAutoComplete/FsAutoComplete.Lsp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1806,7 +1806,8 @@ type FSharpLspServer(state: State, lspClient: FSharpLspClient) =
>> Log.addContextDestructured "file" file
)

let! r = Async.Catch(f arg pos tyRes lines lineStr data.[1] file)
let typ = data.[1]
let! r = Async.Catch(f arg pos tyRes lines lineStr typ file)

match r with
| Choice1Of2 (r: LspResult<CodeLens option>) ->
Expand All @@ -1820,7 +1821,16 @@ type FSharpLspServer(state: State, lspClient: FSharpLspClient) =
>> Log.addExn e
)

return { p with Command = None } |> success
let title = if typ = "signature" then "" else "0 References"

return
{ p with
Command =
Some
{ Title = title
Command = ""
Arguments = None } }
|> success
}
with e ->
logger.error (
Expand Down