From 64faba41a6d0a44ea4805be904aad51f733e11fe Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 2 Aug 2017 18:09:53 +0200 Subject: [PATCH 01/24] workspace peek --- .../FsAutoComplete.Core.fsproj | 1 + src/FsAutoComplete.Core/Workspace.fs | 123 ++++++++++++++++++ 2 files changed, 124 insertions(+) create mode 100644 src/FsAutoComplete.Core/Workspace.fs diff --git a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj index 380757844..945279b0b 100644 --- a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj +++ b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj @@ -60,6 +60,7 @@ + diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs new file mode 100644 index 000000000..f11587edf --- /dev/null +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -0,0 +1,123 @@ +module FsAutoComplete.WorkspacePeek + +open System +open System.IO + +type SolutionData = { + Items: SolutionItem list + Configurations: SolutionConfiguration list + } +and SolutionConfiguration = { + Id: string + ConfigurationName: string + PlatformName: string + IncludeInBuild: bool + } +and SolutionItem = { + Guid: Guid + Name: string + Kind: SolutionItemKind + } +and SolutionItemKind = + | MsbuildFormat of SolutionItemMsbuildConfiguration list + | Folder of (SolutionItem list) * (string list) + | Unsupported + | Unknown +and SolutionItemMsbuildConfiguration = { + Id: string + ConfigurationName: string + PlatformName: string + } + +[] +type Interesting = +| Solution of string * SolutionData +| Directory of string +| Fsx of string + +let tryParseSln slnFilePath = + let slnFile = + try + Microsoft.Build.Construction.SolutionFile.Parse(slnFilePath) + |> Some + with _ -> + None + match slnFile with + | None -> None + | Some sln -> + let rec parseItem (item: Microsoft.Build.Construction.ProjectInSolution) : SolutionItem = + let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) : SolutionItemKind = + match item.ProjectType with + | Microsoft.Build.Construction.SolutionProjectType.KnownToBeMSBuildFormat -> + SolutionItemKind.MsbuildFormat [] + | Microsoft.Build.Construction.SolutionProjectType.SolutionFolder -> + let children = + sln.ProjectsInOrder + |> Seq.filter (fun x -> x.ParentProjectGuid = item.ProjectGuid) + |> Seq.map parseItem + |> List.ofSeq + SolutionItemKind.Folder (children, (item.FolderFiles |> List.ofSeq)) + | Microsoft.Build.Construction.SolutionProjectType.EtpSubProject + | Microsoft.Build.Construction.SolutionProjectType.WebDeploymentProject + | Microsoft.Build.Construction.SolutionProjectType.WebProject -> + SolutionItemKind.Unsupported + | Microsoft.Build.Construction.SolutionProjectType.Unknown + | _ -> + SolutionItemKind.Unknown + + { Guid = item.ProjectGuid |> Guid.Parse + Name = item.ProjectName + Kind = parseKind item } + + let items = + sln.ProjectsInOrder + |> Seq.filter (fun x -> isNull x.ParentProjectGuid) + |> Seq.map parseItem + let data = { + Items = items |> List.ofSeq + Configurations = [] + } + Some (Interesting.Solution (slnFilePath, data)) + +open System.IO + +let peek13 (rootDir: string) deep = + let dirInfo = DirectoryInfo(rootDir) + + let ignored (s: string) = s.StartsWith(".") + + let scanDir (dirInfo: DirectoryInfo) = + let slnsFiles, fsxsFiles = + dirInfo.EnumerateFiles("*.*", SearchOption.TopDirectoryOnly) + |> Seq.filter (fun s -> s.FullName.EndsWith(".sln") || s.FullName.EndsWith(".fsx")) + |> Seq.toArray + |> Array.partition (fun s -> s.FullName.EndsWith(".sln")) + + let slns = + slnsFiles + |> Array.choose (fun f -> tryParseSln f.FullName) + let fsxs = + fsxsFiles + |> Array.map (fun f -> Interesting.Fsx (f.FullName)) + slns, fsxs + + let dirs = + let rec scanDirs (dirInfo: DirectoryInfo) lvl = + seq { + if lvl <= deep then + yield dirInfo + for s in dirInfo.GetDirectories() do + if not(ignored s.Name) then + yield! scanDirs s (lvl + 1) + } + + scanDirs dirInfo 0 + |> Array.ofSeq + + let found = dirs |> Array.Parallel.map scanDir + + let slns = found |> Array.map fst |> Array.collect id |> Array.sortBy (function Interesting.Solution (p,_) -> p | _ -> "") + let fsxs = found |> Array.map snd |> Array.collect id |> Array.sortBy (function Interesting.Fsx p -> p | _ -> "") + + let dir = Interesting.Directory rootDir + [ yield! slns; yield! fsxs; yield dir ] From 409e405c5e4889bcafe8bca1016b9fbd907c0c94 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 2 Aug 2017 18:09:53 +0200 Subject: [PATCH 02/24] use local dll --- src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj index 945279b0b..d6b6d9ed2 100644 --- a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj +++ b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj @@ -34,6 +34,9 @@ + + ..\..\..\dotnet-proj-info\src\Sln\bin\Debug\net45\Sln.dll + From 52b68acc0ce5ca0192efeb6ecb630c56c31bd3ea Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 2 Aug 2017 18:09:53 +0200 Subject: [PATCH 03/24] fsx are not interesting --- src/FsAutoComplete.Core/Workspace.fs | 77 ++++++++++++++++++---------- 1 file changed, 51 insertions(+), 26 deletions(-) diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index f11587edf..5173bf190 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -32,8 +32,7 @@ and SolutionItemMsbuildConfiguration = { [] type Interesting = | Solution of string * SolutionData -| Directory of string -| Fsx of string +| Directory of string * string list let tryParseSln slnFilePath = let slnFile = @@ -45,8 +44,8 @@ let tryParseSln slnFilePath = match slnFile with | None -> None | Some sln -> - let rec parseItem (item: Microsoft.Build.Construction.ProjectInSolution) : SolutionItem = - let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) : SolutionItemKind = + let rec parseItem (item: Microsoft.Build.Construction.ProjectInSolution) = + let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) = match item.ProjectType with | Microsoft.Build.Construction.SolutionProjectType.KnownToBeMSBuildFormat -> SolutionItemKind.MsbuildFormat [] @@ -77,29 +76,39 @@ let tryParseSln slnFilePath = Items = items |> List.ofSeq Configurations = [] } - Some (Interesting.Solution (slnFilePath, data)) + Some (slnFilePath, data) open System.IO -let peek13 (rootDir: string) deep = +type private UsefulFile = + | FsProj + | Sln + | Fsx + +let private partitionByChoice3 = + let foldBy (a, b, c) t = + match t with + | Choice1Of3 x -> (x :: a, b, c) + | Choice2Of3 x -> (a, x :: b, c) + | Choice3Of3 x -> (a, b, x :: c) + Array.fold foldBy ([],[],[]) + +let peek (rootDir: string) deep = let dirInfo = DirectoryInfo(rootDir) + //TODO accept glob list to ignore let ignored (s: string) = s.StartsWith(".") let scanDir (dirInfo: DirectoryInfo) = - let slnsFiles, fsxsFiles = - dirInfo.EnumerateFiles("*.*", SearchOption.TopDirectoryOnly) - |> Seq.filter (fun s -> s.FullName.EndsWith(".sln") || s.FullName.EndsWith(".fsx")) - |> Seq.toArray - |> Array.partition (fun s -> s.FullName.EndsWith(".sln")) - - let slns = - slnsFiles - |> Array.choose (fun f -> tryParseSln f.FullName) - let fsxs = - fsxsFiles - |> Array.map (fun f -> Interesting.Fsx (f.FullName)) - slns, fsxs + let hasExt ext (s: FileInfo) = s.FullName.EndsWith(ext) + dirInfo.EnumerateFiles("*.*", SearchOption.TopDirectoryOnly) + |> Seq.choose (fun s -> + match s with + | x when x |> hasExt ".sln" -> Some (UsefulFile.Sln, x) + | x when x |> hasExt ".fsx" -> Some (UsefulFile.Fsx, x) + | x when x |> hasExt ".fsproj" -> Some (UsefulFile.FsProj, x) + | _ -> None) + |> Seq.toArray let dirs = let rec scanDirs (dirInfo: DirectoryInfo) lvl = @@ -114,10 +123,26 @@ let peek13 (rootDir: string) deep = scanDirs dirInfo 0 |> Array.ofSeq - let found = dirs |> Array.Parallel.map scanDir - - let slns = found |> Array.map fst |> Array.collect id |> Array.sortBy (function Interesting.Solution (p,_) -> p | _ -> "") - let fsxs = found |> Array.map snd |> Array.collect id |> Array.sortBy (function Interesting.Fsx p -> p | _ -> "") - - let dir = Interesting.Directory rootDir - [ yield! slns; yield! fsxs; yield dir ] + let getInfo (t, (f: FileInfo)) = + match t with + | UsefulFile.Sln -> + tryParseSln f.FullName + |> Option.map Choice1Of3 + | UsefulFile.Fsx -> + Some (Choice2Of3 (f.FullName)) + | UsefulFile.FsProj -> + Some (Choice3Of3 (f.FullName)) + + let found = + dirs + |> Array.Parallel.collect scanDir + |> Array.Parallel.choose getInfo + + let slns, _fsxs, fsprojs = + found |> partitionByChoice3 + + //TODO weight order of fsprojs from sln + let dir = rootDir, (fsprojs |> List.sort) + + [ yield! slns |> List.map Interesting.Solution + yield dir |> Interesting.Directory ] From c60f1f17cd94da3f479b31e001d903e2f50ceb2c Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 2 Aug 2017 18:09:53 +0200 Subject: [PATCH 04/24] add `workspacePeek` command --- src/FsAutoComplete.Core/CommandResponse.fs | 54 +++++++++++++++++++ src/FsAutoComplete.Core/Commands.fs | 6 +++ .../FsAutoComplete.Core.fsproj | 2 +- .../FsAutoComplete.Suave.fs | 2 + 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/FsAutoComplete.Core/CommandResponse.fs b/src/FsAutoComplete.Core/CommandResponse.fs index 27211474a..0a8146d9b 100644 --- a/src/FsAutoComplete.Core/CommandResponse.fs +++ b/src/FsAutoComplete.Core/CommandResponse.fs @@ -295,6 +295,35 @@ module CommandResponse = Parameters : Parameter list list } + type WorkspacePeekResponse = { + Found: WorkspacePeekFound list + } + and WorkspacePeekFound = + | Directory of WorkspacePeekFoundDirectory + | Solution of WorkspacePeekFoundSolution + and WorkspacePeekFoundDirectory = { + Directory: string + Fsprojs: string list + } + and WorkspacePeekFoundSolution = { + Path: string + Items: WorkspacePeekFoundSolutionItem list + Configurations: WorkspacePeekFoundSolutionConfiguration list + } + and [] WorkspacePeekFoundSolutionItem = { + Guid: Guid + Name: string + Kind: WorkspacePeekFoundSolutionItemKind + } + and WorkspacePeekFoundSolutionItemKind = + | MsbuildFormat of WorkspacePeekFoundSolutionConfiguration list + | Folder of (WorkspacePeekFoundSolutionItem list) * (string list) + and [] WorkspacePeekFoundSolutionConfiguration = { + Id: string + ConfigurationName: string + PlatformName: string + } + let info (serialize : Serializer) (s: string) = serialize { Kind = "info"; Data = s } let errorG (serialize : Serializer) (errorData: ErrorData) message = @@ -350,6 +379,31 @@ module CommandResponse = | GenericError errorMessage -> error serialize errorMessage //compatibility with old api | ProjectNotRestored project -> errorG serialize (ErrorData.ProjectNotRestored { Project = project }) "Project not restored" + let workspacePeek (serialize : Serializer) (found: FsAutoComplete.WorkspacePeek.Interesting list) = + let mapInt i = + match i with + | FsAutoComplete.WorkspacePeek.Interesting.Directory (p, fsprojs) -> + WorkspacePeekFound.Directory { WorkspacePeekFoundDirectory.Directory = p; Fsprojs = fsprojs } + | FsAutoComplete.WorkspacePeek.Interesting.Solution (p, sd) -> + let rec item (x: FsAutoComplete.WorkspacePeek.SolutionItem) = + let kind = + match x.Kind with + | FsAutoComplete.WorkspacePeek.SolutionItemKind.Unknown + | FsAutoComplete.WorkspacePeek.SolutionItemKind.Unsupported -> + None + | FsAutoComplete.WorkspacePeek.SolutionItemKind.MsbuildFormat msbuildProj -> + Some (WorkspacePeekFoundSolutionItemKind.MsbuildFormat []) + | FsAutoComplete.WorkspacePeek.SolutionItemKind.Folder(children, items) -> + let c = children |> List.choose item + Some (WorkspacePeekFoundSolutionItemKind.Folder(c,items)) + kind + |> Option.map (fun k -> { WorkspacePeekFoundSolutionItem.Guid = x.Guid; Name = x.Name; Kind = k }) + let items = sd.Items |> List.choose item + WorkspacePeekFound.Solution { WorkspacePeekFoundSolution.Path = p; Items = items; Configurations = [] } + + let data = { WorkspacePeekResponse.Found = found |> List.map mapInt } + serialize { Kind = "project"; Data = data } + let completion (serialize : Serializer) (decls: FSharpDeclarationListItem[]) includeKeywords = serialize { Kind = "completion" Data = [ for d in decls do diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index dea0eab0f..49599b3e1 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -396,3 +396,9 @@ type Commands (serialize : Serializer) = else return [Response.info serialize "Union at position not found"] } + + member __.WorkspacePeek (dir: string) (deep: int) = async { + let d = WorkspacePeek.peek dir deep + + return [Response.workspacePeek serialize d] + } diff --git a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj index d6b6d9ed2..60681fa91 100644 --- a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj +++ b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj @@ -59,11 +59,11 @@ + - diff --git a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs index 792ef258e..0fbc14f0e 100644 --- a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs +++ b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs @@ -24,6 +24,7 @@ module Contract = type CompletionRequest = {FileName : string; SourceLine : string; Line : int; Column : int; Filter : string; IncludeKeywords : bool;} type PositionRequest = {FileName : string; Line : int; Column : int; Filter : string} type LintRequest = {FileName : string} + type WorkspacePeekRequest = {Directory : string; Deep: int} [] module internal Utils = @@ -183,6 +184,7 @@ let main argv = path "/lint" >=> handler (fun (data: LintRequest) -> commands.Lint data.FileName) path "/namespaces" >=> positionHandler (fun data tyRes lineStr _ -> commands.GetNamespaceSuggestions tyRes { Line = data.Line; Col = data.Column } lineStr) path "/unionCaseGenerator" >=> positionHandler (fun data tyRes lineStr lines -> commands.GetUnionPatternMatchCases tyRes { Line = data.Line; Col = data.Column } lines lineStr) + path "/workspacePeek" >=> handler (fun (data : WorkspacePeekRequest) -> commands.WorkspacePeek data.Directory data.Deep) ] let main (args: ParseResults) = From 20c3cf002d149e881396d5ff31ae5af052ce789d Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 2 Aug 2017 18:09:53 +0200 Subject: [PATCH 05/24] serializer --- src/FsAutoComplete.Core/CommandResponse.fs | 22 ++++++++++++---- src/FsAutoComplete/JsonSerializer.fs | 30 ++++++++++++++++++++++ 2 files changed, 47 insertions(+), 5 deletions(-) diff --git a/src/FsAutoComplete.Core/CommandResponse.fs b/src/FsAutoComplete.Core/CommandResponse.fs index 0a8146d9b..758a18fbe 100644 --- a/src/FsAutoComplete.Core/CommandResponse.fs +++ b/src/FsAutoComplete.Core/CommandResponse.fs @@ -316,8 +316,15 @@ module CommandResponse = Kind: WorkspacePeekFoundSolutionItemKind } and WorkspacePeekFoundSolutionItemKind = - | MsbuildFormat of WorkspacePeekFoundSolutionConfiguration list - | Folder of (WorkspacePeekFoundSolutionItem list) * (string list) + | MsbuildFormat of WorkspacePeekFoundSolutionItemKindMsbuildFormat + | Folder of WorkspacePeekFoundSolutionItemKindFolder + and [] WorkspacePeekFoundSolutionItemKindMsbuildFormat = { + Configurations: WorkspacePeekFoundSolutionConfiguration list + } + and [] WorkspacePeekFoundSolutionItemKindFolder = { + Items: WorkspacePeekFoundSolutionItem list + Files: string list + } and [] WorkspacePeekFoundSolutionConfiguration = { Id: string ConfigurationName: string @@ -392,10 +399,15 @@ module CommandResponse = | FsAutoComplete.WorkspacePeek.SolutionItemKind.Unsupported -> None | FsAutoComplete.WorkspacePeek.SolutionItemKind.MsbuildFormat msbuildProj -> - Some (WorkspacePeekFoundSolutionItemKind.MsbuildFormat []) - | FsAutoComplete.WorkspacePeek.SolutionItemKind.Folder(children, items) -> + Some (WorkspacePeekFoundSolutionItemKind.MsbuildFormat { + WorkspacePeekFoundSolutionItemKindMsbuildFormat.Configurations = [] + }) + | FsAutoComplete.WorkspacePeek.SolutionItemKind.Folder(children, files) -> let c = children |> List.choose item - Some (WorkspacePeekFoundSolutionItemKind.Folder(c,items)) + Some (WorkspacePeekFoundSolutionItemKind.Folder { + WorkspacePeekFoundSolutionItemKindFolder.Items = c + Files = files + }) kind |> Option.map (fun k -> { WorkspacePeekFoundSolutionItem.Guid = x.Guid; Name = x.Name; Kind = k }) let items = sd.Items |> List.choose item diff --git a/src/FsAutoComplete/JsonSerializer.fs b/src/FsAutoComplete/JsonSerializer.fs index ab9b71e94..1af72a81f 100644 --- a/src/FsAutoComplete/JsonSerializer.fs +++ b/src/FsAutoComplete/JsonSerializer.fs @@ -15,6 +15,34 @@ module private JsonSerializerConverters = | FSharpErrorSeverity.Warning -> "Warning" serializer.Serialize(writer, s) + let workspacePeekFoundWriter (writer: JsonWriter) value (serializer : JsonSerializer) = + let t, v = + match value with + | CommandResponse.WorkspacePeekFound.Directory d -> + "directory", box d + | CommandResponse.WorkspacePeekFound.Solution sln -> + "solution", box sln + writer.WriteStartObject() + writer.WritePropertyName("Type") + writer.WriteValue(t) + writer.WritePropertyName("Data") + serializer.Serialize(writer, v) + writer.WriteEndObject() + + let workspacePeekFoundSolutionItemKindWriter (writer: JsonWriter) value (serializer : JsonSerializer) = + let t, v = + match value with + | CommandResponse.WorkspacePeekFoundSolutionItemKind.Folder d -> + "folder", box d + | CommandResponse.WorkspacePeekFoundSolutionItemKind.MsbuildFormat msbuildProj -> + "msbuildFormat", box msbuildProj + writer.WriteStartObject() + writer.WritePropertyName("Kind") + writer.WriteValue(t) + writer.WritePropertyName("Data") + serializer.Serialize(writer, v) + writer.WriteEndObject() + let rangeWriter (writer: JsonWriter) (range: Range.range) (_serializer : JsonSerializer) = writer.WriteStartObject() writer.WritePropertyName("StartColumn") @@ -68,6 +96,8 @@ module private JsonSerializerConverters = let sameDU ty t = Microsoft.FSharp.Reflection.FSharpType.IsUnion(t) && t.BaseType = ty [| writeOnlyConverter fsharpErrorSeverityWriter (=) writeOnlyConverter rangeWriter (=) + writeOnlyConverter workspacePeekFoundWriter sameDU + writeOnlyConverter workspacePeekFoundSolutionItemKindWriter sameDU writeOnlyConverter projectSdkTypeWriter sameDU writeOnlyConverter projectOutputTypeWriter sameDU |] From 2e722006bf8ac5567de2dcb87ba872657f2c3c85 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Fri, 4 Aug 2017 13:03:55 +0200 Subject: [PATCH 06/24] returned path are always absolute --- src/FsAutoComplete.Core/Workspace.fs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index 5173bf190..5812b2c3b 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -44,6 +44,13 @@ let tryParseSln slnFilePath = match slnFile with | None -> None | Some sln -> + let slnDir = Path.GetDirectoryName slnFilePath + let makeAbsoluteFromSlnDir path = + if Path.IsPathRooted path then + path + else + Path.Combine(slnDir, path) + |> Path.GetFullPath let rec parseItem (item: Microsoft.Build.Construction.ProjectInSolution) = let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) = match item.ProjectType with @@ -55,7 +62,11 @@ let tryParseSln slnFilePath = |> Seq.filter (fun x -> x.ParentProjectGuid = item.ProjectGuid) |> Seq.map parseItem |> List.ofSeq - SolutionItemKind.Folder (children, (item.FolderFiles |> List.ofSeq)) + let files = + item.FolderFiles + |> Seq.map makeAbsoluteFromSlnDir + |> List.ofSeq + SolutionItemKind.Folder (children, files) | Microsoft.Build.Construction.SolutionProjectType.EtpSubProject | Microsoft.Build.Construction.SolutionProjectType.WebDeploymentProject | Microsoft.Build.Construction.SolutionProjectType.WebProject -> From d6875e519e539f7313f8d5e8680ef7d1e51ca049 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Fri, 4 Aug 2017 15:16:23 +0200 Subject: [PATCH 07/24] return full path --- src/FsAutoComplete.Core/Workspace.fs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index 5812b2c3b..35469b928 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -55,7 +55,7 @@ let tryParseSln slnFilePath = let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) = match item.ProjectType with | Microsoft.Build.Construction.SolutionProjectType.KnownToBeMSBuildFormat -> - SolutionItemKind.MsbuildFormat [] + (item.RelativePath |> makeAbsoluteFromSlnDir), SolutionItemKind.MsbuildFormat [] | Microsoft.Build.Construction.SolutionProjectType.SolutionFolder -> let children = sln.ProjectsInOrder @@ -66,18 +66,19 @@ let tryParseSln slnFilePath = item.FolderFiles |> Seq.map makeAbsoluteFromSlnDir |> List.ofSeq - SolutionItemKind.Folder (children, files) + item.ProjectName, SolutionItemKind.Folder (children, files) | Microsoft.Build.Construction.SolutionProjectType.EtpSubProject | Microsoft.Build.Construction.SolutionProjectType.WebDeploymentProject | Microsoft.Build.Construction.SolutionProjectType.WebProject -> - SolutionItemKind.Unsupported + (item.ProjectName |> makeAbsoluteFromSlnDir), SolutionItemKind.Unsupported | Microsoft.Build.Construction.SolutionProjectType.Unknown | _ -> - SolutionItemKind.Unknown + (item.ProjectName |> makeAbsoluteFromSlnDir), SolutionItemKind.Unknown + let name, itemKind = parseKind item { Guid = item.ProjectGuid |> Guid.Parse - Name = item.ProjectName - Kind = parseKind item } + Name = name + Kind = itemKind } let items = sln.ProjectsInOrder From d7ef790612586bf07bd1777157d0854017085cf2 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Sat, 5 Aug 2017 15:32:14 +0200 Subject: [PATCH 08/24] use `Sln` nupkg --- paket.dependencies | 1 + paket.lock | 1 + src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj | 14 +++++++++++--- src/FsAutoComplete.Core/paket.references | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/paket.dependencies b/paket.dependencies index e1379f8d9..04ed39dd1 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -5,6 +5,7 @@ nuget Argu 3.7 nuget FSharp.Compiler.Service 11.0.9 framework: >= net45 nuget FSharp.Compiler.Service.ProjectCracker 11.0.9 nuget Dotnet.ProjInfo 0.7.4 +nuget Sln 0.1.0 nuget Mono.Cecil nuget NDesk.Options nuget Newtonsoft.Json diff --git a/paket.lock b/paket.lock index 35f4a5f42..e0f37e4b9 100644 --- a/paket.lock +++ b/paket.lock @@ -41,6 +41,7 @@ NUGET NUnit.Extension.TeamCityEventListener (>= 1.0.2) NUnit.Extension.VSProjectLoader (>= 3.5) Octokit (0.24) + Sln (0.1) Suave (1.1.3) FSharp.Core (>= 3.1.2.5) System.Collections.Concurrent (4.3) diff --git a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj index 60681fa91..67a11ca98 100644 --- a/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj +++ b/src/FsAutoComplete.Core/FsAutoComplete.Core.fsproj @@ -34,9 +34,6 @@ - - ..\..\..\dotnet-proj-info\src\Sln\bin\Debug\net45\Sln.dll - @@ -178,6 +175,17 @@ + + + + + ..\..\packages\Sln\lib\net45\Sln.dll + True + True + + + + diff --git a/src/FsAutoComplete.Core/paket.references b/src/FsAutoComplete.Core/paket.references index 39dad759d..f90447c45 100644 --- a/src/FsAutoComplete.Core/paket.references +++ b/src/FsAutoComplete.Core/paket.references @@ -1,5 +1,5 @@ FSharp.Compiler.Service.ProjectCracker FSharp.Compiler.Service FSharpLint.Core -Dotnet.ProjInfo -Newtonsoft.Json \ No newline at end of file +Sln +Dotnet.ProjInfoNewtonsoft.Json \ No newline at end of file From b70eaa4447d210bdfed94838b5f0beffc93d182c Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Sat, 5 Aug 2017 16:02:32 +0200 Subject: [PATCH 09/24] bump Sln pkg --- paket.dependencies | 2 +- paket.lock | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/paket.dependencies b/paket.dependencies index 04ed39dd1..2b66a16db 100644 --- a/paket.dependencies +++ b/paket.dependencies @@ -5,7 +5,7 @@ nuget Argu 3.7 nuget FSharp.Compiler.Service 11.0.9 framework: >= net45 nuget FSharp.Compiler.Service.ProjectCracker 11.0.9 nuget Dotnet.ProjInfo 0.7.4 -nuget Sln 0.1.0 +nuget Sln 0.2.0 nuget Mono.Cecil nuget NDesk.Options nuget Newtonsoft.Json diff --git a/paket.lock b/paket.lock index e0f37e4b9..1a9002ee5 100644 --- a/paket.lock +++ b/paket.lock @@ -41,7 +41,7 @@ NUGET NUnit.Extension.TeamCityEventListener (>= 1.0.2) NUnit.Extension.VSProjectLoader (>= 3.5) Octokit (0.24) - Sln (0.1) + Sln (0.2) Suave (1.1.3) FSharp.Core (>= 3.1.2.5) System.Collections.Concurrent (4.3) From 376767b56fee1f4a3f4596be51e54d2d5cbf98ad Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Mon, 7 Aug 2017 18:42:12 +0200 Subject: [PATCH 10/24] excludedDirs now are an argument. match dir name --- src/FsAutoComplete.Core/Commands.fs | 4 ++-- src/FsAutoComplete.Core/Workspace.fs | 6 ++++-- src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/FsAutoComplete.Core/Commands.fs b/src/FsAutoComplete.Core/Commands.fs index 49599b3e1..b5a74d109 100644 --- a/src/FsAutoComplete.Core/Commands.fs +++ b/src/FsAutoComplete.Core/Commands.fs @@ -397,8 +397,8 @@ type Commands (serialize : Serializer) = return [Response.info serialize "Union at position not found"] } - member __.WorkspacePeek (dir: string) (deep: int) = async { - let d = WorkspacePeek.peek dir deep + member __.WorkspacePeek (dir: string) (deep: int) (excludedDirs: string list) = async { + let d = WorkspacePeek.peek dir deep excludedDirs return [Response.workspacePeek serialize d] } diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index 35469b928..5148a326a 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -105,11 +105,13 @@ let private partitionByChoice3 = | Choice3Of3 x -> (a, b, x :: c) Array.fold foldBy ([],[],[]) -let peek (rootDir: string) deep = +let peek (rootDir: string) deep (excludedDirs: string list) = let dirInfo = DirectoryInfo(rootDir) //TODO accept glob list to ignore - let ignored (s: string) = s.StartsWith(".") + let ignored = + let normalizedDirs = excludedDirs |> List.map (fun s -> s.ToUpperInvariant()) |> Array.ofList + (fun (s: string) -> normalizedDirs |> Array.contains (s.ToUpperInvariant())) let scanDir (dirInfo: DirectoryInfo) = let hasExt ext (s: FileInfo) = s.FullName.EndsWith(ext) diff --git a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs index 0fbc14f0e..99525fe9e 100644 --- a/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs +++ b/src/FsAutoComplete.Suave/FsAutoComplete.Suave.fs @@ -24,7 +24,7 @@ module Contract = type CompletionRequest = {FileName : string; SourceLine : string; Line : int; Column : int; Filter : string; IncludeKeywords : bool;} type PositionRequest = {FileName : string; Line : int; Column : int; Filter : string} type LintRequest = {FileName : string} - type WorkspacePeekRequest = {Directory : string; Deep: int} + type WorkspacePeekRequest = {Directory : string; Deep: int; ExcludedDirs: string array} [] module internal Utils = @@ -184,7 +184,7 @@ let main argv = path "/lint" >=> handler (fun (data: LintRequest) -> commands.Lint data.FileName) path "/namespaces" >=> positionHandler (fun data tyRes lineStr _ -> commands.GetNamespaceSuggestions tyRes { Line = data.Line; Col = data.Column } lineStr) path "/unionCaseGenerator" >=> positionHandler (fun data tyRes lineStr lines -> commands.GetUnionPatternMatchCases tyRes { Line = data.Line; Col = data.Column } lines lineStr) - path "/workspacePeek" >=> handler (fun (data : WorkspacePeekRequest) -> commands.WorkspacePeek data.Directory data.Deep) + path "/workspacePeek" >=> handler (fun (data : WorkspacePeekRequest) -> commands.WorkspacePeek data.Directory data.Deep (data.ExcludedDirs |> List.ofArray)) ] let main (args: ParseResults) = From 4a36a0febf751f2508d82ef659cda6ca22554233 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 15:52:30 +0200 Subject: [PATCH 11/24] add test sln --- .../DotNetCore/sample1/sample1.sln | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetCore/sample1/sample1.sln diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/sample1/sample1.sln b/test/FsAutoComplete.IntegrationTests/DotNetCore/sample1/sample1.sln new file mode 100644 index 000000000..05b87ac34 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetCore/sample1/sample1.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "l1", "l1\l1.fsproj", "{67BE40A1-E400-4D79-A995-37F88FEC5078}" +EndProject +Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "c1", "c1\c1.fsproj", "{3719440C-4A1C-4206-9F71-FB095214AE20}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|Any CPU.Build.0 = Debug|Any CPU + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|x64.ActiveCfg = Debug|x64 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|x64.Build.0 = Debug|x64 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|x86.ActiveCfg = Debug|x86 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Debug|x86.Build.0 = Debug|x86 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|Any CPU.ActiveCfg = Release|Any CPU + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|Any CPU.Build.0 = Release|Any CPU + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|x64.ActiveCfg = Release|x64 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|x64.Build.0 = Release|x64 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|x86.ActiveCfg = Release|x86 + {67BE40A1-E400-4D79-A995-37F88FEC5078}.Release|x86.Build.0 = Release|x86 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|x64.ActiveCfg = Debug|x64 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|x64.Build.0 = Debug|x64 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|x86.ActiveCfg = Debug|x86 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Debug|x86.Build.0 = Debug|x86 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|Any CPU.Build.0 = Release|Any CPU + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|x64.ActiveCfg = Release|x64 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|x64.Build.0 = Release|x64 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|x86.ActiveCfg = Release|x86 + {3719440C-4A1C-4206-9F71-FB095214AE20}.Release|x86.Build.0 = Release|x86 + EndGlobalSection +EndGlobal From 3be572c3ed7a9aff5156b525f450ceb25e661421 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 15:52:30 +0200 Subject: [PATCH 12/24] add `workspacepeek` command to stdio based --- src/FsAutoComplete/CommandInput.fs | 15 ++++++++++++++- src/FsAutoComplete/Program.fs | 1 + .../TestHelpers.fsx | 3 +++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/FsAutoComplete/CommandInput.fs b/src/FsAutoComplete/CommandInput.fs index 8d0a59d77..c9ef3e1e6 100644 --- a/src/FsAutoComplete/CommandInput.fs +++ b/src/FsAutoComplete/CommandInput.fs @@ -29,6 +29,7 @@ type Command = | Project of string * bool | Colorization of bool | CompilerLocation + | WorkspacePeek of string * int * string[] | Started | Quit @@ -100,6 +101,18 @@ module CommandInput = return '"' } + // Parse 'parse "" [sync]' command + let workspacePeek = + parser { + let! _ = string "workspacepeek " + let! _ = char '"' + let! dir = some (sat ((<>) '"')) |> Parser.map String.OfSeq + let! _ = char '"' + let! _ = many (string " ") + let! deep = some digit |> Parser.map (String.OfSeq >> int) + let excludeDir = [| |] + return WorkspacePeek (dir, deep, excludeDir) } + // Parse 'completion "" "" [timeout]' command let completionTipOrDecl = parser { let! f = (string "completion " |> Parser.map (fun _ -> Completion)) <|> @@ -156,7 +169,7 @@ module CommandInput = | null -> Quit | input -> let reader = Parsing.createForwardStringReader input 0 - let cmds = compilerlocation <|> helptext <|> declarations <|> lint <|> parse <|> project <|> completionTipOrDecl <|> quit <|> colorizations <|> error + let cmds = compilerlocation <|> helptext <|> declarations <|> lint <|> parse <|> project <|> completionTipOrDecl <|> quit <|> colorizations <|> workspacePeek <|> error let cmd = reader |> Parsing.getFirst cmds match cmd with | Parse (filename,kind,_) -> diff --git a/src/FsAutoComplete/Program.fs b/src/FsAutoComplete/Program.fs index 8dcfa3291..022bdbc2e 100644 --- a/src/FsAutoComplete/Program.fs +++ b/src/FsAutoComplete/Program.fs @@ -66,6 +66,7 @@ module internal Main = | CompilerLocation -> return commands.CompilerLocation() | Colorization enabled -> commands.Colorization enabled; return [] | Lint filename -> return! commands.Lint filename + | WorkspacePeek (dir, deep, excludeDir) -> return! commands.WorkspacePeek dir deep (excludeDir |> List.ofArray) | Error msg -> return commands.Error msg | Quit -> quit <- true diff --git a/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx b/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx index 43f6edb47..f38bb3b59 100644 --- a/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx +++ b/test/FsAutoComplete.IntegrationTests/TestHelpers.fsx @@ -69,6 +69,9 @@ type FsAutoCompleteWrapper() = member x.send (s: string) : unit = fprintf p.StandardInput "%s" s + member x.workspacepeek (dir: string) (deep: int): unit = + fprintf p.StandardInput "workspacepeek \"%s\" %i\n" dir deep + /// Wait for a single line to be output (one JSON message) /// Note that this line will appear at the *start* of output.json, /// so use carefully, and preferably only at the beginning. From 25683c6a215dd8c44f3421b533f99155b4a8a987 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 15:52:30 +0200 Subject: [PATCH 13/24] add test --- .../DotNetCore/WorkspacePeek.fsx | 22 +++++++++ .../DotNetCore/workspacepeek.json | 46 +++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx b/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx new file mode 100644 index 000000000..638419ee6 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx @@ -0,0 +1,22 @@ +#load "../TestHelpers.fsx" +open TestHelpers +open System.IO +open System + +Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ +let outputJson = "workspacepeek.json" +File.Delete outputJson + +runProcess __SOURCE_DIRECTORY__ "dotnet" "--info" |> ignore + +match runProcessCaptureOut __SOURCE_DIRECTORY__ "dotnet" "restore sample1/c1" with +| NonExitCodeResult data -> + data |> processResultLog "failed 'dotnet restore sample1/c1'" |> writeNormalizedOutput outputJson +| _ -> + let p = new FsAutoCompleteWrapper() + + p.workspacepeek (Path.Combine(__SOURCE_DIRECTORY__, "sample1")) 1 + + p.send "quit\n" + p.finalOutput () + |> writeNormalizedOutput outputJson diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json b/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json new file mode 100644 index 000000000..d0dc4493e --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json @@ -0,0 +1,46 @@ +{ + "Kind": "project", + "Data": { + "Found": [ + { + "Type": "solution", + "Data": { + "Path": "/FsAutoComplete.IntegrationTests/DotNetCore/sample1/sample1.sln", + "Items": [ + { + "Guid": "67be40a1-e400-4d79-a995-37f88fec5078", + "Name": "/FsAutoComplete.IntegrationTests/DotNetCore/sample1/l1/l1.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + }, + { + "Guid": "3719440c-4a1c-4206-9f71-fb095214ae20", + "Name": "/FsAutoComplete.IntegrationTests/DotNetCore/sample1/c1/c1.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + } + ], + "Configurations": [] + } + }, + { + "Type": "directory", + "Data": { + "Directory": "/FsAutoComplete.IntegrationTests/DotNetCore/sample1", + "Fsprojs": [ + "/FsAutoComplete.IntegrationTests/DotNetCore/sample1/c1/c1.fsproj", + "/FsAutoComplete.IntegrationTests/DotNetCore/sample1/l1/l1.fsproj" + ] + } + } + ] + } +} From c9ebb7ab74efbcc65dbed7924ee1c675d3708e17 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 15:52:30 +0200 Subject: [PATCH 14/24] add sample sln Proj2.fsproj guid was changed because was equal to Proj1.fsproj --- .../MultiProj/Proj2/Proj2.fsproj | 2 +- .../MultiProj/Sample/Sample.sln | 39 +++++++++++++++++++ .../MultiProj/others/devguide.txt | 3 ++ .../MultiProj/others/readme.md | 1 + 4 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 test/FsAutoComplete.IntegrationTests/MultiProj/Sample/Sample.sln create mode 100644 test/FsAutoComplete.IntegrationTests/MultiProj/others/devguide.txt create mode 100644 test/FsAutoComplete.IntegrationTests/MultiProj/others/readme.md diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj b/test/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj index c73a10091..f032b7f33 100644 --- a/test/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj @@ -5,7 +5,7 @@ x86 8.0.30703 2.0 - {116cc2f9-f987-4b3d-915a-34cac04a73da} + {713bc809-9dc5-422d-b2e6-04f6d26f7a11} Exe Proj2 Proj2 diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/Sample/Sample.sln b/test/FsAutoComplete.IntegrationTests/MultiProj/Sample/Sample.sln new file mode 100644 index 000000000..296823eae --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/Sample/Sample.sln @@ -0,0 +1,39 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.25420.1 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docs", "docs", "{B9FEF411-5F4D-4021-9A20-FB6597FAA915}" + ProjectSection(SolutionItems) = preProject + ..\others\devguide.txt = ..\others\devguide.txt + ..\others\readme.md = ..\others\readme.md + EndProjectSection +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Proj1", "..\Proj1\Proj1.fsproj", "{116CC2F9-F987-4B3D-915A-34CAC04A73DA}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{7FE228F9-217E-41A8-924D-F9DFEDFDD2B4}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "Proj2", "..\Proj2\Proj2.fsproj", "{713BC809-9DC5-422D-B2E6-04F6D26F7A11}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {116CC2F9-F987-4B3D-915A-34CAC04A73DA}.Debug|x86.ActiveCfg = Debug|x86 + {116CC2F9-F987-4B3D-915A-34CAC04A73DA}.Debug|x86.Build.0 = Debug|x86 + {116CC2F9-F987-4B3D-915A-34CAC04A73DA}.Release|x86.ActiveCfg = Release|x86 + {116CC2F9-F987-4B3D-915A-34CAC04A73DA}.Release|x86.Build.0 = Release|x86 + {713BC809-9DC5-422D-B2E6-04F6D26F7A11}.Debug|x86.ActiveCfg = Debug|x86 + {713BC809-9DC5-422D-B2E6-04F6D26F7A11}.Debug|x86.Build.0 = Debug|x86 + {713BC809-9DC5-422D-B2E6-04F6D26F7A11}.Release|x86.ActiveCfg = Release|x86 + {713BC809-9DC5-422D-B2E6-04F6D26F7A11}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {713BC809-9DC5-422D-B2E6-04F6D26F7A11} = {7FE228F9-217E-41A8-924D-F9DFEDFDD2B4} + EndGlobalSection +EndGlobal diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/others/devguide.txt b/test/FsAutoComplete.IntegrationTests/MultiProj/others/devguide.txt new file mode 100644 index 000000000..6fc0bac18 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/others/devguide.txt @@ -0,0 +1,3 @@ +============================== +========= DEV GUIDE ========== +============================== diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/others/readme.md b/test/FsAutoComplete.IntegrationTests/MultiProj/others/readme.md new file mode 100644 index 000000000..a79fbe4ca --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/others/readme.md @@ -0,0 +1 @@ +# Sample proj From 0658f21e20f631e4d09a439b621f6bf2f816a8b3 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 15:52:30 +0200 Subject: [PATCH 15/24] add test --- .../MultiProj/WorkspacePeek.fsx | 17 +++++ .../MultiProj/workspacepeek.json | 72 +++++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx create mode 100644 test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx b/test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx new file mode 100644 index 000000000..d693d7a07 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx @@ -0,0 +1,17 @@ +#load "../TestHelpers.fsx" +open TestHelpers +open System.IO +open System + +Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ +File.Delete "workspacepeek.json" + +let p = new FsAutoCompleteWrapper() + +p.workspacepeek __SOURCE_DIRECTORY__ 2 + +p.send "quit\n" + +p.finalOutput () +|> writeNormalizedOutput "workspacepeek.json" + diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json b/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json new file mode 100644 index 000000000..737fb6edb --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json @@ -0,0 +1,72 @@ +{ + "Kind": "project", + "Data": { + "Found": [ + { + "Type": "solution", + "Data": { + "Path": "/FsAutoComplete.IntegrationTests/MultiProj/Sample/Sample.sln", + "Items": [ + { + "Guid": "b9fef411-5f4d-4021-9a20-fb6597faa915", + "Name": "docs", + "Kind": { + "Kind": "folder", + "Data": { + "Items": [], + "Files": [ + "/FsAutoComplete.IntegrationTests/MultiProj/others/devguide.txt", + "/FsAutoComplete.IntegrationTests/MultiProj/others/readme.md" + ] + } + } + }, + { + "Guid": "116cc2f9-f987-4b3d-915a-34cac04a73da", + "Name": "/FsAutoComplete.IntegrationTests/MultiProj/Proj1/Proj1.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + }, + { + "Guid": "7fe228f9-217e-41a8-924d-f9dfedfdd2b4", + "Name": "Tests", + "Kind": { + "Kind": "folder", + "Data": { + "Items": [ + { + "Guid": "713bc809-9dc5-422d-b2e6-04f6d26f7a11", + "Name": "/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + } + ], + "Files": [] + } + } + } + ], + "Configurations": [] + } + }, + { + "Type": "directory", + "Data": { + "Directory": "/FsAutoComplete.IntegrationTests/MultiProj", + "Fsprojs": [ + "/FsAutoComplete.IntegrationTests/MultiProj/Proj1/Proj1.fsproj", + "/FsAutoComplete.IntegrationTests/MultiProj/Proj2/Proj2.fsproj" + ] + } + } + ] + } +} From 1bf46eef6ab87c839aef5b80de9006ffebe0e6e3 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 16:05:48 +0200 Subject: [PATCH 16/24] test script have Runner suffix --- .../DotNetCore/{WorkspacePeek.fsx => WorkspacePeekRunner.fsx} | 0 .../MultiProj/{WorkspacePeek.fsx => WorkspacePeekRunner.fsx} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename test/FsAutoComplete.IntegrationTests/DotNetCore/{WorkspacePeek.fsx => WorkspacePeekRunner.fsx} (100%) rename test/FsAutoComplete.IntegrationTests/MultiProj/{WorkspacePeek.fsx => WorkspacePeekRunner.fsx} (100%) diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx b/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx similarity index 100% rename from test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeek.fsx rename to test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx b/test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeekRunner.fsx similarity index 100% rename from test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeek.fsx rename to test/FsAutoComplete.IntegrationTests/MultiProj/WorkspacePeekRunner.fsx From 09b90de6876f2772f0a34d6cbea34f33d5ce0a84 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 16:35:21 +0200 Subject: [PATCH 17/24] normalize dir separator in paths, in sln are always windows style --- src/FsAutoComplete.Core/Workspace.fs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index 5148a326a..fd1f06190 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -45,12 +45,14 @@ let tryParseSln slnFilePath = | None -> None | Some sln -> let slnDir = Path.GetDirectoryName slnFilePath - let makeAbsoluteFromSlnDir path = - if Path.IsPathRooted path then - path - else - Path.Combine(slnDir, path) - |> Path.GetFullPath + let makeAbsoluteFromSlnDir = + let makeAbs path = + if Path.IsPathRooted path then + path + else + Path.Combine(slnDir, path) + |> Path.GetFullPath + Utils.normalizeDirSeparators >> makeAbs let rec parseItem (item: Microsoft.Build.Construction.ProjectInSolution) = let parseKind (item: Microsoft.Build.Construction.ProjectInSolution) = match item.ProjectType with From 13903d498aec62a86fbd0b405e0d7e91449b961b Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 17:33:29 +0200 Subject: [PATCH 18/24] fix response kind --- src/FsAutoComplete.Core/CommandResponse.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FsAutoComplete.Core/CommandResponse.fs b/src/FsAutoComplete.Core/CommandResponse.fs index 758a18fbe..c9e60cb00 100644 --- a/src/FsAutoComplete.Core/CommandResponse.fs +++ b/src/FsAutoComplete.Core/CommandResponse.fs @@ -414,7 +414,7 @@ module CommandResponse = WorkspacePeekFound.Solution { WorkspacePeekFoundSolution.Path = p; Items = items; Configurations = [] } let data = { WorkspacePeekResponse.Found = found |> List.map mapInt } - serialize { Kind = "project"; Data = data } + serialize { Kind = "workspacePeek"; Data = data } let completion (serialize : Serializer) (decls: FSharpDeclarationListItem[]) includeKeywords = serialize { Kind = "completion" From 696bc294dacbcd996ba1061bf8fd8ff59f07d3ea Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 17:50:57 +0200 Subject: [PATCH 19/24] option map --- src/FsAutoComplete.Core/Workspace.fs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/FsAutoComplete.Core/Workspace.fs b/src/FsAutoComplete.Core/Workspace.fs index fd1f06190..58df54eb8 100644 --- a/src/FsAutoComplete.Core/Workspace.fs +++ b/src/FsAutoComplete.Core/Workspace.fs @@ -35,15 +35,7 @@ type Interesting = | Directory of string * string list let tryParseSln slnFilePath = - let slnFile = - try - Microsoft.Build.Construction.SolutionFile.Parse(slnFilePath) - |> Some - with _ -> - None - match slnFile with - | None -> None - | Some sln -> + let parseSln (sln: Microsoft.Build.Construction.SolutionFile) = let slnDir = Path.GetDirectoryName slnFilePath let makeAbsoluteFromSlnDir = let makeAbs path = @@ -90,7 +82,17 @@ let tryParseSln slnFilePath = Items = items |> List.ofSeq Configurations = [] } - Some (slnFilePath, data) + (slnFilePath, data) + + let slnFile = + try + Microsoft.Build.Construction.SolutionFile.Parse(slnFilePath) + |> Some + with _ -> + None + + slnFile + |> Option.map parseSln open System.IO From 534684d034990ffbf6ca84aac05ae9b6fdef6bc1 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Tue, 8 Aug 2017 18:58:13 +0200 Subject: [PATCH 20/24] fix tests --- .../DotNetCore/workspacepeek.json | 2 +- .../MultiProj/workspacepeek.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json b/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json index d0dc4493e..36ff92f5c 100644 --- a/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json +++ b/test/FsAutoComplete.IntegrationTests/DotNetCore/workspacepeek.json @@ -1,5 +1,5 @@ { - "Kind": "project", + "Kind": "workspacePeek", "Data": { "Found": [ { diff --git a/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json b/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json index 737fb6edb..89f8407ca 100644 --- a/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json +++ b/test/FsAutoComplete.IntegrationTests/MultiProj/workspacepeek.json @@ -1,5 +1,5 @@ { - "Kind": "project", + "Kind": "workspacePeek", "Data": { "Found": [ { From 4e50b73796e92d3a8412c90979eeaa53bb5c78fd Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 9 Aug 2017 19:29:18 +0200 Subject: [PATCH 21/24] files are the full path of files inside the solution folder --- src/FsAutoComplete.Core/CommandResponse.fs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/FsAutoComplete.Core/CommandResponse.fs b/src/FsAutoComplete.Core/CommandResponse.fs index c9e60cb00..af31244ae 100644 --- a/src/FsAutoComplete.Core/CommandResponse.fs +++ b/src/FsAutoComplete.Core/CommandResponse.fs @@ -323,7 +323,7 @@ module CommandResponse = } and [] WorkspacePeekFoundSolutionItemKindFolder = { Items: WorkspacePeekFoundSolutionItem list - Files: string list + Files: FilePath list } and [] WorkspacePeekFoundSolutionConfiguration = { Id: string From 60479d274a1cf1fdea5da585a684e94b2f510439 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Wed, 30 Aug 2017 23:52:10 +0200 Subject: [PATCH 22/24] updated to latest --- src/FsAutoComplete.Core/paket.references | 3 ++- .../DotNetCore/WorkspacePeekRunner.fsx | 15 +++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/FsAutoComplete.Core/paket.references b/src/FsAutoComplete.Core/paket.references index f90447c45..073338e56 100644 --- a/src/FsAutoComplete.Core/paket.references +++ b/src/FsAutoComplete.Core/paket.references @@ -2,4 +2,5 @@ FSharp.Compiler.Service.ProjectCracker FSharp.Compiler.Service FSharpLint.Core Sln -Dotnet.ProjInfoNewtonsoft.Json \ No newline at end of file +Dotnet.ProjInfo +Newtonsoft.Json diff --git a/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx b/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx index 638419ee6..920e2043a 100644 --- a/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx +++ b/test/FsAutoComplete.IntegrationTests/DotNetCore/WorkspacePeekRunner.fsx @@ -7,12 +7,17 @@ Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ let outputJson = "workspacepeek.json" File.Delete outputJson -runProcess __SOURCE_DIRECTORY__ "dotnet" "--info" |> ignore +let doIt () = + let sdkDir = DotnetCli.sdk1Dir () -match runProcessCaptureOut __SOURCE_DIRECTORY__ "dotnet" "restore sample1/c1" with -| NonExitCodeResult data -> + use _sdk1 = DotnetCli.useSdk sdkDir + + runProcess __SOURCE_DIRECTORY__ "dotnet" "--info" |> ignore + + match runProcessCaptureOut __SOURCE_DIRECTORY__ "dotnet" "restore sample1/c1" with + | NonExitCodeResult data -> data |> processResultLog "failed 'dotnet restore sample1/c1'" |> writeNormalizedOutput outputJson -| _ -> + | _ -> let p = new FsAutoCompleteWrapper() p.workspacepeek (Path.Combine(__SOURCE_DIRECTORY__, "sample1")) 1 @@ -20,3 +25,5 @@ match runProcessCaptureOut __SOURCE_DIRECTORY__ "dotnet" "restore sample1/c1" wi p.send "quit\n" p.finalOutput () |> writeNormalizedOutput outputJson + +doIt () From 935f562edf62a1df72fe12911f6448e4fb74c261 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Thu, 31 Aug 2017 00:05:23 +0200 Subject: [PATCH 23/24] remove dev feed of .net core 2.0 --- .../DotNetSdk2.0/sample1/nuget.config | 6 ------ .../DotNetSdk2.0Crossgen/sample1/nuget.config | 6 ------ .../DotNetSdk2.0CrossgenWithNetFx/sample1/nuget.config | 6 ------ .../DotNetSdk2.0WithOtherDotnetLang/sampleo/nuget.config | 6 ------ 4 files changed, 24 deletions(-) delete mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/nuget.config delete mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0Crossgen/sample1/nuget.config delete mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0CrossgenWithNetFx/sample1/nuget.config delete mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0WithOtherDotnetLang/sampleo/nuget.config diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/nuget.config b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/nuget.config deleted file mode 100644 index ff6b1c83d..000000000 --- a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0Crossgen/sample1/nuget.config b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0Crossgen/sample1/nuget.config deleted file mode 100644 index ff6b1c83d..000000000 --- a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0Crossgen/sample1/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0CrossgenWithNetFx/sample1/nuget.config b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0CrossgenWithNetFx/sample1/nuget.config deleted file mode 100644 index ff6b1c83d..000000000 --- a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0CrossgenWithNetFx/sample1/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0WithOtherDotnetLang/sampleo/nuget.config b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0WithOtherDotnetLang/sampleo/nuget.config deleted file mode 100644 index ff6b1c83d..000000000 --- a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0WithOtherDotnetLang/sampleo/nuget.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - From 8aebbb948b3719d6aae00b3c57762a852ef0e825 Mon Sep 17 00:00:00 2001 From: Enrico Sada Date: Thu, 31 Aug 2017 00:05:46 +0200 Subject: [PATCH 24/24] add test --- .../DotNetSdk2.0/WorkspacePeekRunner.fsx | 29 +++++++++++ .../DotNetSdk2.0/sample1/sample1.sln | 48 +++++++++++++++++++ .../DotNetSdk2.0/workspacepeek.json | 46 ++++++++++++++++++ 3 files changed, 123 insertions(+) create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/WorkspacePeekRunner.fsx create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/sample1.sln create mode 100644 test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/workspacepeek.json diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/WorkspacePeekRunner.fsx b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/WorkspacePeekRunner.fsx new file mode 100644 index 000000000..b394b4125 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/WorkspacePeekRunner.fsx @@ -0,0 +1,29 @@ +#load "../TestHelpers.fsx" +open TestHelpers +open System.IO +open System + +Environment.CurrentDirectory <- __SOURCE_DIRECTORY__ +let outputJson = "workspacepeek.json" +File.Delete outputJson + +let doIt () = + let sdkDir = DotnetCli.sdk2Dir () + + use _sdk1 = DotnetCli.useSdk sdkDir + + runProcess __SOURCE_DIRECTORY__ "dotnet" "--info" |> ignore + + match runProcessCaptureOut __SOURCE_DIRECTORY__ "dotnet" "restore sample1/c1" with + | NonExitCodeResult data -> + data |> processResultLog "failed 'dotnet restore sample1/c1'" |> writeNormalizedOutput outputJson + | _ -> + let p = new FsAutoCompleteWrapper() + + p.workspacepeek (Path.Combine(__SOURCE_DIRECTORY__, "sample1")) 1 + + p.send "quit\n" + p.finalOutput () + |> writeNormalizedOutput outputJson + +doIt () diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/sample1.sln b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/sample1.sln new file mode 100644 index 000000000..24dd78bb3 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/sample1.sln @@ -0,0 +1,48 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.26124.0 +MinimumVisualStudioVersion = 15.0.26124.0 +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "l1", "l1\l1.fsproj", "{EECBF4BF-4F97-488A-A04D-55CDECA39B88}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "c1", "c1\c1.fsproj", "{5686CA40-E1C8-4635-8C49-9BE9415BB8CF}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|x64.ActiveCfg = Debug|x64 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|x64.Build.0 = Debug|x64 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|x86.ActiveCfg = Debug|x86 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Debug|x86.Build.0 = Debug|x86 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|Any CPU.Build.0 = Release|Any CPU + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|x64.ActiveCfg = Release|x64 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|x64.Build.0 = Release|x64 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|x86.ActiveCfg = Release|x86 + {EECBF4BF-4F97-488A-A04D-55CDECA39B88}.Release|x86.Build.0 = Release|x86 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|x64.ActiveCfg = Debug|x64 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|x64.Build.0 = Debug|x64 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|x86.ActiveCfg = Debug|x86 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Debug|x86.Build.0 = Debug|x86 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|Any CPU.Build.0 = Release|Any CPU + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|x64.ActiveCfg = Release|x64 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|x64.Build.0 = Release|x64 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|x86.ActiveCfg = Release|x86 + {5686CA40-E1C8-4635-8C49-9BE9415BB8CF}.Release|x86.Build.0 = Release|x86 + EndGlobalSection +EndGlobal diff --git a/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/workspacepeek.json b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/workspacepeek.json new file mode 100644 index 000000000..4cee9ac87 --- /dev/null +++ b/test/FsAutoComplete.IntegrationTests/DotNetSdk2.0/workspacepeek.json @@ -0,0 +1,46 @@ +{ + "Kind": "workspacePeek", + "Data": { + "Found": [ + { + "Type": "solution", + "Data": { + "Path": "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/sample1.sln", + "Items": [ + { + "Guid": "eecbf4bf-4f97-488a-a04d-55cdeca39b88", + "Name": "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/l1/l1.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + }, + { + "Guid": "5686ca40-e1c8-4635-8c49-9be9415bb8cf", + "Name": "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/c1/c1.fsproj", + "Kind": { + "Kind": "msbuildFormat", + "Data": { + "Configurations": [] + } + } + } + ], + "Configurations": [] + } + }, + { + "Type": "directory", + "Data": { + "Directory": "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1", + "Fsprojs": [ + "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/c1/c1.fsproj", + "/FsAutoComplete.IntegrationTests/DotNetSdk2.0/sample1/l1/l1.fsproj" + ] + } + } + ] + } +}