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

Adaptive refactorings and fixing code lens reference setting #1052

Merged
merged 3 commits into from
Feb 4, 2023
Merged
Changes from 1 commit
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
13 changes: 10 additions & 3 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2735,8 +2735,7 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
[| if config.LineLens.Enabled <> "replaceCodeLens" then
if config.CodeLenses.Signature.Enabled then
yield! decls |> Array.collect (getCodeLensInformation p.TextDocument.Uri "signature")
// we have two options here because we're deprecating the EnableReferenceCodeLens one (namespacing, etc)
if config.EnableReferenceCodeLens || config.CodeLenses.References.Enabled then
if config.CodeLenses.References.Enabled then
baronfel marked this conversation as resolved.
Show resolved Hide resolved
yield! decls |> Array.collect (getCodeLensInformation p.TextDocument.Uri "reference") |]

return Some res
Expand Down Expand Up @@ -2846,7 +2845,7 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
Arguments = None }

return { p with Command = Some cmd } |> Some |> success
else
elif typ = "reference" then
baronfel marked this conversation as resolved.
Show resolved Hide resolved
let! res =
symbolUseWorkspace pos lineStr lines tyRes
|> AsyncResult.mapError (JsonRpc.Error.InternalErrorMessage)
Expand Down Expand Up @@ -2905,6 +2904,14 @@ type AdaptiveFSharpLspServer(workspaceLoader: IWorkspaceLoader, lspClient: FShar
{ p with Command = Some cmd } |> Some |> success

return res
else
logger.error (
Log.setMessage "CodeLensResolve - unknown type {file} - {typ}"
>> Log.addContextDestructured "file" file
>> Log.addContextDestructured "typ" typ
)

return { p with Command = None } |> Some |> success
})
p

Expand Down