diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 5091aec9f0d..40d01e7cf51 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -21,11 +21,11 @@ jobs: - name: Restore the compiler service solution env: CI: false - run: dotnet build ./FSharp.Compiler.Service.sln --verbosity quiet + run: ./build.sh -c Release --verbosity quiet - name: Restore the language server solution env: CI: false - run: dotnet build ./VSFSharpExtension.sln --verbosity quiet + run: dotnet build ./LSPSolutionSlim.sln -c Release --verbosity quiet - name: Restore dotnet tools env: CI: false diff --git a/LSPSolutionSlim.sln b/LSPSolutionSlim.sln new file mode 100644 index 00000000000..dc97321b0a1 --- /dev/null +++ b/LSPSolutionSlim.sln @@ -0,0 +1,117 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Compiler", "Compiler", "{87D01E8D-2580-81A2-8FDB-46C6008C302D}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.Service", "src\Compiler\FSharp.Compiler.Service.fsproj", "{876C64E7-1131-48AD-BD7B-CB3E17CB0E93}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.DependencyManager.Nuget", "src\FSharp.DependencyManager.Nuget\FSharp.DependencyManager.Nuget.fsproj", "{BD632E2B-6A64-458A-B236-37D5B35F3ACD}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Core", "src\FSharp.Core\FSharp.Core.fsproj", "{350BB272-96EF-462C-BDF7-1E711FB1C684}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FSharp.VisualStudio.Extension", "src\FSharp.VisualStudio.Extension\FSharp.VisualStudio.Extension.csproj", "{F78BF321-03DE-41B0-BBDA-700A49DDD541}" +EndProject +Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "FSharp.Compiler.LanguageServer", "src\FSharp.Compiler.LanguageServer\FSharp.Compiler.LanguageServer.fsproj", "{72C85CB8-674E-40B8-A972-1710E503DDCD}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.CommonLanguageServerProtocol.Framework.Proxy", "src\Microsoft.CommonLanguageServerProtocol.Framework.Proxy\Microsoft.CommonLanguageServerProtocol.Framework.Proxy.csproj", "{71F0B4AC-786A-498E-88C7-2B922025F192}" +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(ProjectConfigurationPlatforms) = postSolution + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|Any CPU.Build.0 = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|x64.ActiveCfg = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|x64.Build.0 = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|x86.ActiveCfg = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Debug|x86.Build.0 = Debug|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|Any CPU.ActiveCfg = Release|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|Any CPU.Build.0 = Release|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|x64.ActiveCfg = Release|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|x64.Build.0 = Release|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|x86.ActiveCfg = Release|Any CPU + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93}.Release|x86.Build.0 = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|x64.ActiveCfg = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|x64.Build.0 = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|x86.ActiveCfg = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Debug|x86.Build.0 = Debug|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|Any CPU.Build.0 = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|x64.ActiveCfg = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|x64.Build.0 = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|x86.ActiveCfg = Release|Any CPU + {BD632E2B-6A64-458A-B236-37D5B35F3ACD}.Release|x86.Build.0 = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|Any CPU.Build.0 = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|x64.ActiveCfg = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|x64.Build.0 = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|x86.ActiveCfg = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Debug|x86.Build.0 = Debug|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|Any CPU.ActiveCfg = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|Any CPU.Build.0 = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|x64.ActiveCfg = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|x64.Build.0 = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|x86.ActiveCfg = Release|Any CPU + {350BB272-96EF-462C-BDF7-1E711FB1C684}.Release|x86.Build.0 = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|x64.ActiveCfg = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|x64.Build.0 = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|x86.ActiveCfg = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Debug|x86.Build.0 = Debug|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|Any CPU.Build.0 = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|x64.ActiveCfg = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|x64.Build.0 = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|x86.ActiveCfg = Release|Any CPU + {F78BF321-03DE-41B0-BBDA-700A49DDD541}.Release|x86.Build.0 = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|x64.ActiveCfg = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|x64.Build.0 = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|x86.ActiveCfg = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Debug|x86.Build.0 = Debug|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|Any CPU.Build.0 = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|x64.ActiveCfg = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|x64.Build.0 = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|x86.ActiveCfg = Release|Any CPU + {72C85CB8-674E-40B8-A972-1710E503DDCD}.Release|x86.Build.0 = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|Any CPU.Build.0 = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|x64.ActiveCfg = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|x64.Build.0 = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|x86.ActiveCfg = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Debug|x86.Build.0 = Debug|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|Any CPU.ActiveCfg = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|Any CPU.Build.0 = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|x64.ActiveCfg = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|x64.Build.0 = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|x86.ActiveCfg = Release|Any CPU + {71F0B4AC-786A-498E-88C7-2B922025F192}.Release|x86.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {87D01E8D-2580-81A2-8FDB-46C6008C302D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {876C64E7-1131-48AD-BD7B-CB3E17CB0E93} = {87D01E8D-2580-81A2-8FDB-46C6008C302D} + {BD632E2B-6A64-458A-B236-37D5B35F3ACD} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {350BB272-96EF-462C-BDF7-1E711FB1C684} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {F78BF321-03DE-41B0-BBDA-700A49DDD541} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {72C85CB8-674E-40B8-A972-1710E503DDCD} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + {71F0B4AC-786A-498E-88C7-2B922025F192} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B} + EndGlobalSection +EndGlobal diff --git a/src/FSharp.Compiler.LanguageServer/Common/CapabilitiesManager.fs b/src/FSharp.Compiler.LanguageServer/Common/CapabilitiesManager.fs index 556a1d96edc..85d0172097d 100644 --- a/src/FSharp.Compiler.LanguageServer/Common/CapabilitiesManager.fs +++ b/src/FSharp.Compiler.LanguageServer/Common/CapabilitiesManager.fs @@ -34,6 +34,7 @@ type CapabilitiesManager(config: FSharpLanguageServerConfig, scOverrides: IServe )), //CompletionProvider = CompletionOptions(TriggerCharacters = [| "."; " " |], ResolveProvider = true, WorkDoneProgress = true), //HoverProvider = SumType(HoverOptions(WorkDoneProgress = true)) + DefinitionProvider = SumType(true), SemanticTokensOptions = addIf config.EnabledFeatures.SemanticHighlighting diff --git a/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs b/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs index 474758924d0..edfe1d34960 100644 --- a/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs +++ b/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs @@ -1,5 +1,6 @@ ο»Ώnamespace FSharp.Compiler.LanguageServer.Handlers +open System open Microsoft.CommonLanguageServerProtocol.Framework open Microsoft.VisualStudio.LanguageServer.Protocol open Microsoft.VisualStudio.FSharp.Editor.CancellableTasks @@ -9,6 +10,7 @@ open System.Threading.Tasks open System.Threading open System.Collections.Generic open Microsoft.VisualStudio.FSharp.Editor +open FSharp.Compiler.EditorServices #nowarn "57" @@ -57,3 +59,66 @@ type LanguageFeaturesHandler() = return SemanticTokens(Data = tokens) } |> CancellableTask.start cancellationToken + + interface IRequestHandler, FSharpRequestContext> with + [] + member _.HandleRequestAsync + (request: TextDocumentPositionParams, context: FSharpRequestContext, cancellationToken: CancellationToken) + = + cancellableTask { + let file = request.TextDocument.Uri + let line = int request.Position.Line + let col = int request.Position.Character + + let! _, checkResults = context.Workspace.Query.GetParseAndCheckResultsForFile file + + match checkResults with + | Some checkResults -> + let! sourceText = context.Workspace.Query.GetSource file + + match sourceText with + | Some sourceText -> + try + // Convert LSP position to F# compiler position + let lineText = sourceText.GetLineString(line) + let fcsLine = FSharp.Compiler.Text.Line.fromZ line + + // Try to find the identifier at the position using QuickParse + let qualifyingIdents, partialIdent = QuickParse.GetPartialLongName(lineText, col) + let fullIdent = qualifyingIdents @ [ partialIdent ] + + if not (List.isEmpty fullIdent) && not (String.IsNullOrEmpty partialIdent) then + // Get declaration location using F# Compiler Service + let declarationResult = + checkResults.GetDeclarationLocation(fcsLine, col, lineText, fullIdent, false) + + match declarationResult with + | FindDeclResult.DeclFound targetRange -> + let location = + Microsoft.VisualStudio.LanguageServer.Protocol.Location( + Uri = System.Uri(targetRange.FileName), + Range = + Microsoft.VisualStudio.LanguageServer.Protocol.Range( + Start = + Microsoft.VisualStudio.LanguageServer.Protocol.Position( + Line = targetRange.StartLine - 1, + Character = targetRange.StartColumn + ), + End = + Microsoft.VisualStudio.LanguageServer.Protocol.Position( + Line = targetRange.EndLine - 1, + Character = targetRange.EndColumn + ) + ) + ) + + return SumType([| location |]) + | _ -> return SumType([||]) + else + return SumType([||]) + with _ -> + return SumType([||]) + | None -> return SumType([||]) + | _ -> return SumType([||]) + } + |> CancellableTask.start cancellationToken diff --git a/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj b/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj index fae776deb73..26a97a9f9c0 100644 --- a/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj +++ b/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj @@ -1,6 +1,6 @@ ο»Ώ - net8.0-windows + net8.0 enable 12 en-US diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Add multiple projects with references.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Add multiple projects with references.md new file mode 100644 index 00000000000..c9bfcf017f3 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Add multiple projects with references.md @@ -0,0 +1,14 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] --> 0[ProjectConfig /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 2[File /test1.fs] +5[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] --> 4[Reference on disk /...] +6[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 5[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] +6[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] +8[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 6[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] +8[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 7[File /test2.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Add project to workspace.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Add project to workspace.md new file mode 100644 index 00000000000..3b01117388d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Add project to workspace.md @@ -0,0 +1,9 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] --> 0[ProjectConfig /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 2[File /test.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Change file in workspace.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Change file in workspace.md new file mode 100644 index 00000000000..25142028df1 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Change file in workspace.md @@ -0,0 +1,9 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles FSharp-Test-Project-b5a7d97b-/test.fsproj πŸ‘’ FSharp-Test-Project-b5a7d97b-/test.dll] --> 0[ProjectConfig FSharp-Test-Project-b5a7d97b-/test.fsproj πŸ‘’ FSharp-Test-Project-b5a7d97b-/test.dll] +3[ProjectSnapshot FSharp-Test-Project-b5a7d97b-/test.fsproj πŸ‘’ FSharp-Test-Project-b5a7d97b-/test.dll] --> 1[ProjectWithoutFiles FSharp-Test-Project-b5a7d97b-/test.fsproj πŸ‘’ FSharp-Test-Project-b5a7d97b-/test.dll] +3[ProjectSnapshot FSharp-Test-Project-b5a7d97b-/test.fsproj πŸ‘’ FSharp-Test-Project-b5a7d97b-/test.dll] --> 2[File /test.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Close file in workspace.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Close file in workspace.md new file mode 100644 index 00000000000..0aace1f0138 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Close file in workspace.md @@ -0,0 +1,9 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles FSharp-Test-Project-6bab5035-/test.fsproj πŸ‘’ FSharp-Test-Project-6bab5035-/test.dll] --> 0[ProjectConfig FSharp-Test-Project-6bab5035-/test.fsproj πŸ‘’ FSharp-Test-Project-6bab5035-/test.dll] +3[ProjectSnapshot FSharp-Test-Project-6bab5035-/test.fsproj πŸ‘’ FSharp-Test-Project-6bab5035-/test.dll] --> 1[ProjectWithoutFiles FSharp-Test-Project-6bab5035-/test.fsproj πŸ‘’ FSharp-Test-Project-6bab5035-/test.dll] +3[ProjectSnapshot FSharp-Test-Project-6bab5035-/test.fsproj πŸ‘’ FSharp-Test-Project-6bab5035-/test.dll] --> 2[File c16d9b38/9f9bc6ed.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Create references in existing projects.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Create references in existing projects.md new file mode 100644 index 00000000000..372991c502a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Create references in existing projects.md @@ -0,0 +1,14 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] --> 0[ProjectConfig /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 2[File /test1.fs] +4[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] --> 8[Reference on disk /...] +5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 4[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] +5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] +7[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] +7[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 6[File /test2.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Open file in workspace.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Open file in workspace.md new file mode 100644 index 00000000000..3b01117388d --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Open file in workspace.md @@ -0,0 +1,9 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] --> 0[ProjectConfig /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 2[File /test.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Propagate changes to snapshots.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Propagate changes to snapshots.md new file mode 100644 index 00000000000..f094d3c77ca --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Propagate changes to snapshots.md @@ -0,0 +1,19 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] --> 0[ProjectConfig FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] +3[ProjectSnapshot FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] --> 1[ProjectWithoutFiles FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] +3[ProjectSnapshot FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] --> 2[File 1312aeed/c8029696.fs] +5[ProjectConfig FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] --> 4[Reference on disk /...] +6[ProjectWithoutFiles FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] --> 5[ProjectConfig FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] +6[ProjectWithoutFiles FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] --> 3[ProjectSnapshot FSharp-Test-Project-194fd74a-/p1.fsproj πŸ‘’ FSharp-Test-Project-194fd74a-/p1.dll] +8[ProjectSnapshot FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] --> 6[ProjectWithoutFiles FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] +8[ProjectSnapshot FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] --> 7[File 632fef9a/317698e6.fs] +9[ProjectConfig FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] --> 4[Reference on disk /...] +10[ProjectWithoutFiles FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] --> 9[ProjectConfig FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] +10[ProjectWithoutFiles FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] --> 8[ProjectSnapshot FSharp-Test-Project-ffd9d9b1-/p2.fsproj πŸ‘’ FSharp-Test-Project-ffd9d9b1-/p2.dll] +12[ProjectSnapshot FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] --> 10[ProjectWithoutFiles FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] +12[ProjectSnapshot FSharp-Test-Project-2a48ead7-/p3.fsproj πŸ‘’ FSharp-Test-Project-2a48ead7-/p3.dll] --> 11[File 21dbcf49/f1e381b7.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a reference.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a reference.md new file mode 100644 index 00000000000..372991c502a --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a reference.md @@ -0,0 +1,14 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] --> 0[ProjectConfig /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 1[ProjectWithoutFiles /test1.fsproj πŸ‘’ /test1.dll] +3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] --> 2[File /test1.fs] +4[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] --> 8[Reference on disk /...] +5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 4[ProjectConfig /test2.fsproj πŸ‘’ /test2.dll] +5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] --> 3[ProjectSnapshot /test1.fsproj πŸ‘’ /test1.dll] +7[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 5[ProjectWithoutFiles /test2.fsproj πŸ‘’ /test2.dll] +7[ProjectSnapshot /test2.fsproj πŸ‘’ /test2.dll] --> 6[File /test2.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a source file.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a source file.md new file mode 100644 index 00000000000..4627af1c5e0 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a source file.md @@ -0,0 +1,10 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] --> 0[ProjectConfig /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 2[File /test.fs] +3[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 4[File /newTest.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by removing a source file.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by removing a source file.md new file mode 100644 index 00000000000..6111c1797db --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by removing a source file.md @@ -0,0 +1,9 @@ +```mermaid + +graph LR + +1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] --> 0[ProjectConfig /test.fsproj πŸ‘’ /test.dll] +4[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 1[ProjectWithoutFiles /test.fsproj πŸ‘’ /test.dll] +4[ProjectSnapshot /test.fsproj πŸ‘’ /test.dll] --> 2[File /test.fs] + +``` \ No newline at end of file diff --git a/tests/FSharp.Compiler.ComponentTests/CompilerService/Works with signature files.md b/tests/FSharp.Compiler.ComponentTests/CompilerService/Works with signature files.md new file mode 100644 index 00000000000..3b3dd7dcb55 --- /dev/null +++ b/tests/FSharp.Compiler.ComponentTests/CompilerService/Works with signature files.md @@ -0,0 +1,11 @@ +```mermaid + +graph LR + +1[ProjectConfig FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] --> 0[Reference on disk /...] +2[ProjectWithoutFiles FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] --> 1[ProjectConfig FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] +4[ProjectSnapshot FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] --> 2[ProjectWithoutFiles FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] +4[ProjectSnapshot FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] --> 5[File FSharp-Test-Project-71a2e74e-/test.fsi] +4[ProjectSnapshot FSharp-Test-Project-71a2e74e-/test.fsproj.fsproj πŸ‘’ /] --> 3[File FSharp-Test-Project-71a2e74e-/test.fs] + +``` \ No newline at end of file