Coder Social home page Coder Social logo

faldor20 / fsharp-language-server Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fsprojects/fsharp-language-server

34.0 34.0 3.0 72.59 MB

License: Other

F# 94.90% TypeScript 2.22% Shell 0.56% C# 0.63% Emacs Lisp 1.28% Dockerfile 0.23% Nix 0.12% PowerShell 0.07%

fsharp-language-server's People

Contributors

acco32 avatar adam-becker avatar adamnew123456 avatar adelarsq avatar faldor20 avatar georgewfraser avatar herr-felix avatar hoetz avatar inosik avatar joerobich avatar johngalambos avatar mangelmaxime avatar mdarocha avatar mistiara avatar mrbech avatar shalokshalom avatar tboby avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

fsharp-language-server's Issues

Implimment better logging.

The current logging system is pretty lackluster.

It would be good to implement something else.

Probably Serilog with a nice f# wrapper which i can grab from another one of my projects.

Add support for markdown docs in tooltips

Currently, we do not support the markdown style docs when showing tooltips.

///Adds b and c
let add b c=
b+c

That does not show anything in hover docs.
This is because currently we only parse docs as xml.

I should take a look at how FSAC is doing it.

Support fsx files

I don't know if they ever worked but at present .fsx files do not have intellisense highlighting etc.
I believe they are not being loaded correctly

Exception in language server System.IO.FileNotFoundException

I feel like it's something trivial, but can't put my finger on it

dotnet new console --language "f#" --name dummy
code -r dummy

Output -> F# Language server logs:

starting
Logging started
./logs/debugLog-12-10_22;19-28s--.log
logger created
[22:19:28 INF] info log
[22:19:28 WRN] warn log
[22:19:28 ERR] erroor log
fist log should have happened
[22:19:28 INF] created new Project Manager
[22:19:28 WRN] Couldn't find FSharp.Core.dll in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.25
[22:19:28 WRN] Couldn't find System.ComponentModel.Composition.dll in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.25
[22:19:28 WRN] Couldn't find System.Runtime.InteropServices.WindowsRuntime.dll in C:\Program Files\dotnet\shared\Microsoft.NETCore.App\6.0.25
[22:19:29 INF] Add workspace root c:\code\dummy
[22:19:29 INF] returning capabilities
[22:19:29 INF] Running inititialization
[22:19:29 INF] New configuration { settings =
   {
  "fsharp": {
    "trace": {
      "server": "off"
    },
    "debug": {
      "enable": false
    },
    "customCommand": null,
    "customCommandArgs": null,
    "customDllPath": null
  }
}}
[22:19:29 INF] No cracked project references Program.fs, looking at uncracked projects...
[22:19:29 INF] The text of dummy.fsproj contains the string Program.fs', cracking
[22:19:29 INF] Analyzing dummy.fsproj
[22:19:29 INF] No up to date cached projectOptions file found for 'C:\code\dummy\dummy.fsproj', cracking normally 
[22:19:30 ERR] Exception in language server System.IO.FileNotFoundException: Could not load file or assembly 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified.
File name: 'System.Runtime, Version=7.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at Ionide.ProjInfo.ProjectLoader.loadProject(String path, BinaryLogGeneration binaryLogs, FSharpList`1 globalProperties)
   at <StartupCode$Ionide-ProjInfo>.$Library.loadProject@825(WorkspaceLoader __, FSharpList`1 customProperties, BinaryLogGeneration binaryLogs, Dictionary`2 cache, String p) in D:\a\proj-info\proj-info\src\Ionide.ProjInfo\Library.fs:line 826
   at <StartupCode$Ionide-ProjInfo>.$Library.loadProjectList@853(WorkspaceLoader __, FSharpList`1 customProperties, BinaryLogGeneration binaryLogs, Dictionary`2 cache, FSharpList`1 projectList) in D:\a\proj-info\proj-info\src\Ionide.ProjInfo\Library.fs:line 863
   at Ionide.ProjInfo.WorkspaceLoader.Ionide.ProjInfo.IWorkspaceLoader.LoadProjects(FSharpList`1 projects, FSharpList`1 customProperties, BinaryLogGeneration binaryLogs) in D:\a\proj-info\proj-info\src\Ionide.ProjInfo\Library.fs:line 871
   at ProjInfo.crack(String path) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\ProjInfo\Library.fs:line 35
   at FSharpLanguageServer.ProjectManager.Manager.analyzeWithProjInfo@329(ProjectManager this, FileInfo fsproj) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\ProjectManager\ProjectManager.fs:line 342
   at [email protected](Unit unitVar) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\ProjectManager\ProjectManager.fs:line 359
   at System.Lazy`1.ViaFactory(LazyThreadSafetyMode mode)
   at System.Lazy`1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
   at System.Lazy`1.CreateValue()
   at FSharpLanguageServer.ProjectManager.Manager.crackLazily@482.GenerateNext(IEnumerable`1& next) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\ProjectManager\ProjectManager.fs:line 495
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 372
   at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System.Collections.IEnumerator.MoveNext() in D:\a\_work\1\s\src\fsharp\FSharp.Core\seqcore.fs:line 404
   at Microsoft.FSharp.Collections.SeqModule.TryHead[T](IEnumerable`1 source) in D:\a\_work\1\s\src\fsharp\FSharp.Core\seq.fs:line 1370
   at FSharpLanguageServer.ProjectManager.Manager.ProjectManager.FindProjectOptions(FileInfo sourceFile) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\ProjectManager\ProjectManager.fs:line 498
   at FSharpLanguageServer.Program.Server.needsRecompile(FileInfo goal) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 301
   at FSharpLanguageServer.Program.LSP-Types-ILanguageServer-DidOpenTextDocument@598.Invoke(Unit unitVar) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 602
   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\a\_work\1\s\src\fsharp\FSharp.Core\async.fs:line 446
   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, Boolean debugAttach) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\LSP\LanguageServer.fs:line 238
   at FSharpLanguageServer.Program.main(String[] argv) in C:\Users\edowling\Desktop\code\FSharp\fsharp-language-server\src\FSharpLanguageServer\Program.fs:line 948
[22:19:32 INF] Cancelling request 5
PS C:\code\dummy> dotnet --list-sdks
6.0.417 [C:\Program Files\dotnet\sdk]
7.0.404 [C:\Program Files\dotnet\sdk]
PS C:\code\dummy> dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Building/running dummy project works fine, but language server seems to be crashing every time

type aliases broken

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 [email protected](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 ->.

Add setting to specify solution

Thanks a lot for working on this! I've checked out the new extension and looks good :)

Some of my repos contain multiple solutions but most frequently I'm only working with one of them at a time, so I'd prefer the extension doesn't try to parse files not needed. It'd be nice to have an option to select the solution instead of rely always on auto-detection. I gave it a quick try here but it didn't seem to work properly, probably because of conflicts with the auto detection, I need to check again: alfonsogarciacaro@93679b2

Hover causing crashes on some functions.

""Any chance you could release a new version of the VSCode extension covering the fix at line 108 in TipFormatter.fs? Thanks!

Later edit: Just noticed that the extension was last updated on the 28th of November. I assume it should include this fix, however I'm still getting the crash when hovering over certain symbols (IE: the "html" function in the new Fable.Lit sample app)
""

Impliment those nice end of line signature things from fsac

This could be done, but it would add a rather large amount of code and probably slow the extension down.
I don't find it worth it, but if someone wanted to submit a PR that also allowed enabling and disabling the feature, I'd happily accept it

|> color is incorect ?

|> is colored in white instead of blue:

image

As a reference here is the scope affected by FSAC

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.