Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type aliases broken #1

Closed
faldor20 opened this issue Nov 19, 2021 · 2 comments
Closed

type aliases broken #1

faldor20 opened this issue Nov 19, 2021 · 2 comments

Comments

@faldor20
Copy link
Owner

Thanks for working on this! I constantly have to disable and then re-enable Ionide to get autocomplete to work, so having an alternative is great.

I've found a bug though. I'd open an issue on GitHub, but they seem to be disabled. Hovering over a call to a function which is annotated with a type abbreviation causes an exception which causes the extension to stop working.
let mustBeAdmin: HttpHandler = requiresRole "Admin" (challenge JwtBearerDefaults.AuthenticationScheme)

Hover over mustBeAdmin
Hover tooltipText=ToolTipText
  [Group
     [{ MainDescription =
         [|val(tag: Keyword);  (tag: Space); mustBeAdmin(tag: Function);
           :(tag: Punctuation);  (tag: Space); HttpHandler(tag: Alias)|]
        XmlDoc = None
        TypeMapping = []
        Remarks =
         Some
           [|Full name(tag: Text); :(tag: Punctuation);  (tag: Space);
             Server(tag: Namespace); .(tag: Punctuation);
             HttpHandlers(tag: Namespace); .(tag: Punctuation);
             mustBeAdmin(tag: ModuleBinding)|]
        ParamName = None }]]
Exception in language server System.Collections.Generic.KeyNotFoundException: An index satisfying the predicate was not found in the collection.
   at Microsoft.FSharp.Primitives.Basics.Array.loop@1017-19[T](FSharpFunc`2 predicate, T[] array, Int32 i) in D:\a\_work\1\s\src\fsharp\FSharp.Core\local.fs:line 1018
   at FSharpLanguageServer.TipFormatter.formatTaggedTexts(TaggedText[] t) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\FSharpLanguageServer\TipFormatter.fs:line 108
   at FSharpLanguageServer.Conversions.asHover(ToolTipText _arg1) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\FSharpLanguageServer\Conversions.fs:line 138
   at FSharpLanguageServer.Program.LSP-Types-ILanguageServer-Hover@662-1.Invoke(FSharpResult`2 c) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 677
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvokeNoHijackCheck[a,b](AsyncActivation`1 ctxt, b result1, FSharpFunc`2 userCode) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 464
   at FSharpLanguageServer.Program.recompile@264-5.Invoke(AsyncActivation`1 ctxt) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 264
   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 104
--- End of stack trace from previous location ---
   at Microsoft.FSharp.Control.AsyncResult`1.Commit() in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 391
   at Microsoft.FSharp.Control.AsyncPrimitives.QueueAsyncAndWaitForResultSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1044
   at Microsoft.FSharp.Control.AsyncPrimitives.RunSynchronously[T](CancellationToken cancellationToken, FSharpAsync`1 computation, FSharpOption`1 timeout) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1070
   at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 1365
   at LSP.LanguageServer.connect(FSharpFunc`2 serverFactory, BinaryReader receive, BinaryWriter send) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\LSP\LanguageServer.fs:line 116
   at FSharpLanguageServer.Program.main(String[] argv) in C:\Users\Eli\Documents\programming\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 887

I believe this is because formatTaggedTexts wrongly assumes that the signature must contain ->.

@faldor20
Copy link
Owner Author

This should be fixed now

@LiteracyFanatic
Copy link

Works great now, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants