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

[WIP] Lazy Load Projects #1191

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions src/FsAutoComplete/CommandResponse.fs
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,8 @@ module CommandResponse =
Parameters: Parameter list list
Generics: string list }

type FsprojPeek = { Path: string; CompileItems: string list }

type WorkspacePeekResponse = { Found: WorkspacePeekFound list }

and WorkspacePeekFound =
Expand All @@ -269,7 +271,7 @@ module CommandResponse =

and WorkspacePeekFoundDirectory =
{ Directory: string
Fsprojs: string list }
Fsprojs: FsprojPeek list }

and WorkspacePeekFoundSolution =
{ Path: string
Expand Down Expand Up @@ -453,7 +455,7 @@ module CommandResponse =
| WorkspacePeek.Interesting.Directory(p, fsprojs) ->
WorkspacePeekFound.Directory
{ WorkspacePeekFoundDirectory.Directory = p
Fsprojs = fsprojs }
Fsprojs = fsprojs |> List.map (fun f -> { Path = f.Path; CompileItems = f.CompileItems })}
| WorkspacePeek.Interesting.Solution(p, sd) ->
let rec item (x: Ionide.ProjInfo.InspectSln.SolutionItem) =
let kind =
Expand Down
4 changes: 3 additions & 1 deletion src/FsAutoComplete/CommandResponse.fsi
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ module CommandResponse =
Parameters: Parameter list list
Generics: string list }

type FsprojPeek = { Path: string; CompileItems: string list }

type WorkspacePeekResponse = { Found: WorkspacePeekFound list }

and WorkspacePeekFound =
Expand All @@ -156,7 +158,7 @@ module CommandResponse =

and WorkspacePeekFoundDirectory =
{ Directory: string
Fsprojs: string list }
Fsprojs: FsprojPeek list }

and WorkspacePeekFoundSolution =
{ Path: string
Expand Down
4 changes: 2 additions & 2 deletions src/FsAutoComplete/LspHelpers.fs
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ module Workspace =
| Interesting.Directory(p, fsprojs) ->
WorkspacePeekFound.Directory
{ WorkspacePeekFoundDirectory.Directory = p
Fsprojs = fsprojs }
Fsprojs = fsprojs |> List.map (fun x -> { Path = x.Path; CompileItems = x.CompileItems}) }
| Interesting.Solution(p, sd) ->
let rec item (x: Ionide.ProjInfo.InspectSln.SolutionItem) =
let kind =
Expand Down Expand Up @@ -338,7 +338,7 @@ module Workspace =
| Folder folder -> folder.Items |> List.collect getProjs

sln.Items |> List.collect getProjs
| WorkspacePeekFound.Directory dir -> dir.Fsprojs
| WorkspacePeekFound.Directory dir -> dir.Fsprojs |> List.map (fun x -> x.Path)

let rec foldFsproj (item: WorkspacePeekFoundSolutionItem) =
match item.Kind with
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 @@ -333,7 +333,7 @@ type AdaptiveFSharpLspServer

match peeks with
| [] -> []
| [ CommandResponse.WorkspacePeekFound.Directory projs ] -> projs.Fsprojs
| [ CommandResponse.WorkspacePeekFound.Directory projs ] -> projs.Fsprojs |> List.map (fun p -> p.Path)
| CommandResponse.WorkspacePeekFound.Solution sln :: _ ->
sln.Items |> List.collect Workspace.foldFsproj |> List.map fst
| _ -> []
Expand Down