Skip to content

Commit

Permalink
Don't offer to reference the target project when adding a project ref…
Browse files Browse the repository at this point in the history
…erence (#1945)
  • Loading branch information
dawedawe authored Oct 7, 2023
1 parent b312908 commit af178a5
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/Core/FsProjEdit.fs
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,21 @@ module FsProjEdit =

let addProjectReferencePath path =
promise {
let projects = Project.getAll () |> ResizeArray
match path with
| Some path ->
let projects = Project.getAll () |> List.filter (fun p -> p <> path) |> ResizeArray

if projects.Count <> 0 then
let opts = createEmpty<QuickPickOptions>
opts.placeHolder <- Some "Reference"
if projects.Count <> 0 then
let opts = createEmpty<QuickPickOptions>
opts.placeHolder <- Some "Reference"

let! n = window.showQuickPick (projects |> U2.Case1, opts)
let! n = window.showQuickPick (projects |> U2.Case1, opts)

return!
match n, path with
| Some n, Some path -> LanguageService.dotnetAddProject path n
| _ -> Promise.empty
return!
match n with
| Some n -> LanguageService.dotnetAddProject path n
| _ -> Promise.empty
| _ -> return! Promise.empty
}

let removeProjectReferencePath ref proj =
Expand Down

0 comments on commit af178a5

Please sign in to comment.