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

Ignore requests that would cause circular dependencies #1173

Merged
merged 2 commits into from
Oct 7, 2023
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -4377,10 +4377,11 @@ type AdaptiveFSharpLspServer
>> Log.addContextDestructured "parms" p
)

do!
Commands.DotnetAddProject p.Target p.Reference
|> AsyncResult.ofCoreResponse
|> AsyncResult.ignore<unit option, JsonRpc.Error> // mapping unit option to unit
if p.Target <> p.Reference then
do!
Commands.DotnetAddProject p.Target p.Reference
|> AsyncResult.ofCoreResponse
|> AsyncResult.ignore<unit option, JsonRpc.Error> // mapping unit option to unit

return None
with e ->
Expand Down
8 changes: 6 additions & 2 deletions src/FsAutoComplete/LspServers/FsAutoComplete.Lsp.fs
Original file line number Diff line number Diff line change
Expand Up @@ -2418,11 +2418,15 @@ type FSharpLspServer(state: State, lspClient: FSharpLspClient, sourceTextFactory
>> Log.addContextDestructured "parms" p
)

let! res = Commands.DotnetAddProject p.Target p.Reference
let! res =
if p.Target <> p.Reference then
Commands.DotnetAddProject p.Target p.Reference
else
async.Return(CoreResponse.Res())

let res =
match res with
| CoreResponse.InfoRes msg -> success None
| CoreResponse.InfoRes _msg -> success None
| CoreResponse.ErrorRes msg -> LspResult.internalError msg
| CoreResponse.Res(_) -> success None

Expand Down
Loading