From dda72f69aaabc5faaf8c427885ae87c845c77496 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 10 Jun 2025 08:49:12 +0000 Subject: [PATCH 01/12] Initial plan for issue From a7a33933bd072eac02f484b4c61d9027ce6af41a Mon Sep 17 00:00:00 2001 From: Adam Boniecki <20281641+abonie@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:13:50 +0200 Subject: [PATCH 02/12] Update copilot-setup-steps.yml Run on windows --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 5091aec9f0d..1c08d56db99 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -6,7 +6,7 @@ on: workflow_dispatch jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: - runs-on: ubuntu-latest + runs-on: windows-latest permissions: contents: read From f36dffa77976c61f4fe49e4db0a12b3358fedeb3 Mon Sep 17 00:00:00 2001 From: Adam Boniecki <20281641+abonie@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:28:03 +0200 Subject: [PATCH 03/12] Update copilot-setup-steps.yml Go back to ubuntu but run build.sh --- .github/workflows/copilot-setup-steps.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 1c08d56db99..a206a5ead1e 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -6,7 +6,7 @@ on: workflow_dispatch jobs: # The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot. copilot-setup-steps: - runs-on: windows-latest + runs-on: ubuntu-latest permissions: contents: read @@ -21,7 +21,7 @@ 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 From 7643c297092bd88939d5e293c51a5d1d4f0ebbe4 Mon Sep 17 00:00:00 2001 From: Adam Boniecki <20281641+abonie@users.noreply.github.com> Date: Tue, 10 Jun 2025 12:45:37 +0200 Subject: [PATCH 04/12] Update FSharp.VisualStudio.Extension.csproj Reference Framework assemblies to build on ubuntu --- .../FSharp.VisualStudio.Extension.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj b/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj index fae776deb73..fe4368995ce 100644 --- a/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj +++ b/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj @@ -9,6 +9,7 @@ + From 71b9f09b55a9a3b1f9883a4801eb833b229f59a0 Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Thu, 12 Jun 2025 20:17:43 +0200 Subject: [PATCH 05/12] Change target to net8.0 to build on ubuntu --- .../FSharp.VisualStudio.Extension.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj b/src/FSharp.VisualStudio.Extension/FSharp.VisualStudio.Extension.csproj index fe4368995ce..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 @@ -9,7 +9,6 @@ - From 8d6c90a7bac3ed5f78d0995685e3c1c92c76737b Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Thu, 12 Jun 2025 20:31:35 +0200 Subject: [PATCH 06/12] Add a solution to develop LSP on ubuntu machine --- LSPSolutionSlim.slnx | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 LSPSolutionSlim.slnx diff --git a/LSPSolutionSlim.slnx b/LSPSolutionSlim.slnx new file mode 100644 index 00000000000..76e9713a7c3 --- /dev/null +++ b/LSPSolutionSlim.slnx @@ -0,0 +1,8 @@ + + + + + + + + From 13aef21ea0f2b510d6efe209bb0e39197f18688e Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Thu, 12 Jun 2025 20:39:03 +0200 Subject: [PATCH 07/12] Change which solution copilot builds for LSP --- .github/workflows/copilot-setup-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index a206a5ead1e..85f15ff4ae1 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -25,7 +25,7 @@ jobs: - name: Restore the language server solution env: CI: false - run: dotnet build ./VSFSharpExtension.sln --verbosity quiet + run: dotnet build ./LSPSolutionSlim.slnx -c Release --verbosity quiet - name: Restore dotnet tools env: CI: false From e7eaf7a252509444467942bb977f084e0f88c489 Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Thu, 12 Jun 2025 20:58:23 +0200 Subject: [PATCH 08/12] Add .sln file instead of .slnx --- LSPSolutionSlim.sln | Bin 0 -> 5576 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 LSPSolutionSlim.sln diff --git a/LSPSolutionSlim.sln b/LSPSolutionSlim.sln new file mode 100644 index 0000000000000000000000000000000000000000..df4069d8649532625b65159e4f0c069f67c1344c GIT binary patch literal 5576 zcmd6rO;6iE5QgVUrTzz$UZ_-CcD_0EU>v7C&5Msh1Baz*cuv0LddHZ;8< zqqmG{f51qa)|GVSgJ}=Z)n{g+r%P}2DCtXCT=BTn@;l^hmX6RlJ-cbwH}S`Q4emqc;~ zB0Ex&d+;htfFC}sUD*>yYSNMlmxEt*dI2q!P;Cw}Wm+xz4O$KQ4Wg>cZ?wH93XQXb zu0#0&?y+2BJtQ}MT1jSNMh*>{cZ{6TDw%AR$W2WDcuxL!MSU*J8DUR(bor?Lo>-dP zA=>ovO{|eb<5ocQO~yiE4@~?O6J3o6D@5GnYB3U-SQXERY;|T(eO);3lY@cu%g)m%a zX%*1b{Zh6EMr)O4XtY;&Y91Y)KDxEO?9s3Cba>|(xhf-x)i&dywW?%QUKg7`sc&7F zKdJV1uCJnLHVdoFb*XM?b;&2v2qYAFtx*p6R6(dlODpiMK}-8utu<#MC^dQNTG0IJ zueXrrpV%3Pa!O6OGV5VWo{wm4(0w7}F`O%OskT zN}i2IB9;AqXJ!|88CH7gxyeK;&;84_VDFNPga>zE8j{uC()lRP$31wX=ZOyW&-+jQ z*_oA%qkZ0l+xcQ?x9L)C=kc`9dGa&AeR^}eEXv0;92eKId)8cDXB}7Ud0U^CMf#eC zr#-$WUgmcK+8i&7@-Yp^Wq6sVfA+ks&&wixO~cb3-xDwMJMV3dmqq!QhT}54EXqIi z<(hNGkkjdECyhKkv@>h{l~bgzX&JZ2x0#h=x0$T0`OMpAC7!PTH8K0el>Bpd4Hskc o)zw}48|yQt Date: Thu, 12 Jun 2025 20:59:24 +0200 Subject: [PATCH 09/12] Adjust copilot-setup-steps --- .github/workflows/copilot-setup-steps.yml | 2 +- LSPSolutionSlim.slnx | 8 -------- 2 files changed, 1 insertion(+), 9 deletions(-) delete mode 100644 LSPSolutionSlim.slnx diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml index 85f15ff4ae1..40d01e7cf51 100644 --- a/.github/workflows/copilot-setup-steps.yml +++ b/.github/workflows/copilot-setup-steps.yml @@ -25,7 +25,7 @@ jobs: - name: Restore the language server solution env: CI: false - run: dotnet build ./LSPSolutionSlim.slnx -c Release --verbosity quiet + run: dotnet build ./LSPSolutionSlim.sln -c Release --verbosity quiet - name: Restore dotnet tools env: CI: false diff --git a/LSPSolutionSlim.slnx b/LSPSolutionSlim.slnx deleted file mode 100644 index 76e9713a7c3..00000000000 --- a/LSPSolutionSlim.slnx +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - From 21e041a32f4fb815753f29fd49b1265a2d1578ed Mon Sep 17 00:00:00 2001 From: Adam Boniecki Date: Mon, 16 Jun 2025 19:17:47 +0200 Subject: [PATCH 10/12] Fix the new sln file --- LSPSolutionSlim.sln | Bin 5576 -> 8465 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/LSPSolutionSlim.sln b/LSPSolutionSlim.sln index df4069d8649532625b65159e4f0c069f67c1344c..dc97321b0a1b5a6535b572ecbf28e8b6434df490 100644 GIT binary patch literal 8465 zcmb`M%aWru6o%LBr*L&Pld2J=8weJ&KnRk>OjlQ2$*MPut#(LkaAAAWU7dNdEb>Ts zg^0Gf$v1IX*_OnoU*|tZVDaBS|4zOn^E}&T&%5bw$#x&FrnB9Ckz~_Zw%YHKES*Nl zN`9P1S-y_d7@2R2MuaU0CqHP{RK09+fE`$6^QS3d7PJWRAhB#uO`Rs|{rbXCsD@IA zk!PXFW1jsX=erO0Zy4DyB!mDr5&@vtC%~hO0^}3Vb_8`q=zhQdar$X`zs=|OAFGcy z7qbusf&k920F-eD_>L<8vpvW?H{`_Q-|r`3x;W0(Z`L4NZ&bwcV(RAiHTE{{prFu>v_9T!7hd?#Y!3t89<02KwVz|E*J*^Cm~`1hoMKtQ!M00 zrVE+QU%$j@yp*~1uwTkuDg3DS!l-gN7rL9P;=&;~#2h%jLjkp2A8MMHiRUKkq-s>2j~qsL20AHLCrfR9#kq)gE=DyJ-}|folic1rDQXRZxBN zJ>?r>2!^&=s<@Ix=0;V!b5YRiEN$ym8`UnGXDchp2tE& z=W)^cxQchr>UOj(cKJ;%%R!U7J0ZXBmw)@|>oj=$RrR)hSN$&zt@_mWy4`i^cGpqu zzsQx0x3WRhS{h>x)UyA;t$w|e8^0!Z>ORw2tG@K(P3X$Xv+b_2bhF*sYDL8IRhYlY z;CWfC`xra5u3kXCPgV;H4#lbHji;@Ejit+VM%1NXgLRcTb@Z*JPU|!GRJ*XDQtRoC z)SVp#SVwURsx#53p8vlG0spy1Rp6W9iad z9j5Dg-I~Qq%d1;;+YeetPn)i&+ipnR*-?OF>eCz^uCL|t8JyAo(Jpn{2Uth&B&ECH zbaw~C#?qy^I!sr~(Vi$R5pLD3nF%_yj-J+2)NMDU?(8VQG4*K<57*an`3%nJ#HCB! z_5s!rJjuf@INjaBu(5P$t`5`HaYi5EDt)r*)6m{DTsXIFga7=xg!^8Ep zTt0_0IScGmw>^M$1W)s@15S5$Fl;PcnybTfwH)n<(h}ij-5QyoL+j{iJ@0kf38_0f z3UEw)n#05OwOl^I-8!BwPoC8=^+x8qM4mZ~|2bJyhw~5FLaI~Y$p1VGZy$a?$n8#+ z?_tl7&0eOe`OMz>7U^R2vh$s2@*cM!8l8u9(rEP8uM^Sep|lgx=yutSXi~@>h$pFC HHB9~o&7)G| literal 5576 zcmd6rO;6iE5QgVUrTzz$UZ_-CcD_0EU>v7C&5Msh1Baz*cuv0LddHZ;8< zqqmG{f51qa)|GVSgJ}=Z)n{g+r%P}2DCtXCT=BTn@;l^hmX6RlJ-cbwH}S`Q4emqc;~ zB0Ex&d+;htfFC}sUD*>yYSNMlmxEt*dI2q!P;Cw}Wm+xz4O$KQ4Wg>cZ?wH93XQXb zu0#0&?y+2BJtQ}MT1jSNMh*>{cZ{6TDw%AR$W2WDcuxL!MSU*J8DUR(bor?Lo>-dP zA=>ovO{|eb<5ocQO~yiE4@~?O6J3o6D@5GnYB3U-SQXERY;|T(eO);3lY@cu%g)m%a zX%*1b{Zh6EMr)O4XtY;&Y91Y)KDxEO?9s3Cba>|(xhf-x)i&dywW?%QUKg7`sc&7F zKdJV1uCJnLHVdoFb*XM?b;&2v2qYAFtx*p6R6(dlODpiMK}-8utu<#MC^dQNTG0IJ zueXrrpV%3Pa!O6OGV5VWo{wm4(0w7}F`O%OskT zN}i2IB9;AqXJ!|88CH7gxyeK;&;84_VDFNPga>zE8j{uC()lRP$31wX=ZOyW&-+jQ z*_oA%qkZ0l+xcQ?x9L)C=kc`9dGa&AeR^}eEXv0;92eKId)8cDXB}7Ud0U^CMf#eC zr#-$WUgmcK+8i&7@-Yp^Wq6sVfA+ks&&wixO~cb3-xDwMJMV3dmqq!QhT}54EXqIi z<(hNGkkjdECyhKkv@>h{l~bgzX&JZ2x0#h=x0$T0`OMpAC7!PTH8K0el>Bpd4Hskc o)zw}48|yQt Date: Mon, 16 Jun 2025 17:57:49 +0000 Subject: [PATCH 11/12] Implement textDocument/definition LSP endpoint Co-authored-by: abonie <20281641+abonie@users.noreply.github.com> --- .../Handlers/LanguageFeaturesHandler.fs | 57 +++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs b/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs index 474758924d0..3827eb29474 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,58 @@ 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 From a148ae45c5acb0a41eaf3fa34927ce9b8aaeefd2 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 16 Jun 2025 20:25:38 +0000 Subject: [PATCH 12/12] Add DefinitionProvider capability and fix formatting Co-authored-by: abonie <20281641+abonie@users.noreply.github.com> --- .../Common/CapabilitiesManager.fs | 1 + .../Handlers/LanguageFeaturesHandler.fs | 50 +++++++++++-------- .../Add multiple projects with references.md | 14 ++++++ .../Add project to workspace.md | 9 ++++ .../Change file in workspace.md | 9 ++++ .../Close file in workspace.md | 9 ++++ .../Create references in existing projects.md | 14 ++++++ .../CompilerService/Open file in workspace.md | 9 ++++ .../Propagate changes to snapshots.md | 19 +++++++ .../Update project by adding a reference.md | 14 ++++++ .../Update project by adding a source file.md | 10 ++++ ...pdate project by removing a source file.md | 9 ++++ .../Works with signature files.md | 11 ++++ 13 files changed, 157 insertions(+), 21 deletions(-) create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Add multiple projects with references.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Add project to workspace.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Change file in workspace.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Close file in workspace.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Create references in existing projects.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Open file in workspace.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Propagate changes to snapshots.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a reference.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by adding a source file.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Update project by removing a source file.md create mode 100644 tests/FSharp.Compiler.ComponentTests/CompilerService/Works with signature files.md 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 3827eb29474..edfe1d34960 100644 --- a/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs +++ b/src/FSharp.Compiler.LanguageServer/Handlers/LanguageFeaturesHandler.fs @@ -62,55 +62,63 @@ type LanguageFeaturesHandler() = interface IRequestHandler, FSharpRequestContext> with [] - member _.HandleRequestAsync(request: TextDocumentPositionParams, context: FSharpRequestContext, cancellationToken: CancellationToken) = + 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 + // 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] - + let fullIdent = qualifyingIdents @ [ partialIdent ] + if not (List.isEmpty fullIdent) && not (String.IsNullOrEmpty partialIdent) then // Get declaration location using F# Compiler Service - let declarationResult = + let declarationResult = checkResults.GetDeclarationLocation(fcsLine, col, lineText, fullIdent, false) - + match declarationResult with | FindDeclResult.DeclFound targetRange -> - let location = + let location = Microsoft.VisualStudio.LanguageServer.Protocol.Location( Uri = System.Uri(targetRange.FileName), - Range = + 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) + 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([||]) + | _ -> return SumType([||]) else return SumType([||]) - with - | _ -> return SumType([||]) - | None -> - return SumType([||]) - | _ -> - return SumType([||]) + with _ -> + return SumType([||]) + | None -> return SumType([||]) + | _ -> return SumType([||]) } |> CancellableTask.start cancellationToken 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