From 19702b102b70078c1f63cd422a31624eec98c26c Mon Sep 17 00:00:00 2001 From: BooksBaum <15612932+Booksbaum@users.noreply.github.com> Date: Fri, 17 Feb 2023 11:37:50 +0100 Subject: [PATCH] Remove Active Pattern FullName bug example fixed with #1043 (Upgrade to dotnet 7 & new FCS) (see https://github.com/fsharp/FsAutoComplete/pull/1037#discussion_r1109282501 ) --- .../FindReferencesTests.fs | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs b/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs index 2d554b449..e52ea2161 100644 --- a/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs +++ b/test/FsAutoComplete.Tests.Lsp/FindReferencesTests.fs @@ -703,51 +703,6 @@ let tryFixupRangeTests = testList (nameof Tokenizer.tryFixupRange) [ "Should be correct ranges" } - //TODO: why does this fail? Succeeds when run outside of FSAC - // For example in Script file with `#r "nuget: FSharp.Compiler.Service, 41.0.5"` - // Note: It doesn't use any FSAC stuff -- just FCS - ptestCase "FCS: Active Pattern Case in Declaration" <| fun _ -> - let test () = - let checker = FSharp.Compiler.CodeAnalysis.FSharpChecker.Create() - - let text = """ -let (|Even|Odd|) v = - if v % 2 = 0 then Even else Odd -match 2 with -| Even -> () -| Odd -> () - """ - let file = "code.fsx" - let source = FSharp.Compiler.Text.SourceText.ofString (text) - // decl - let pos = FSharp.Compiler.Text.Position.mkPos 3 24 - // usage - // let pos = FSharp.Compiler.Text.Position.mkPos 5 6 - let names = ["Even"] - - let projOptions, _ = - checker.GetProjectOptionsFromScript (file, source) - |> Async.RunSynchronously - let (parseResults, checkResults') = - checker.ParseAndCheckFileInProject(file, 0, source, projOptions) - |> Async.RunSynchronously - let checkResults = - match checkResults' with - | FSharp.Compiler.CodeAnalysis.FSharpCheckFileAnswer.Succeeded checkResults -> checkResults - | _ -> failwith "CheckFile -> aborted" - - let symbolUse = - checkResults.GetSymbolUseAtLocation(pos.Line, pos.Column, source.GetLineString (pos.Line-1), names) - |> Option.defaultWith (fun _ -> failwith "no symbol at location") - - printfn "DisplayNameCore=%A" symbolUse.Symbol.DisplayNameCore - printfn "FullName=%A" symbolUse.Symbol.FullName - - if symbolUse.Symbol.DisplayNameCore = "" then - failwith $"No display name for symbol with full name '{symbolUse.Symbol.FullName}'" - - test() - testCaseAsync "Active Pattern - simple" <| check false """