faldor20 / fsharp-language-server Goto Github PK
View Code? Open in Web Editor NEWThis project forked from fsprojects/fsharp-language-server
License: Other
This project forked from fsprojects/fsharp-language-server
License: Other
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.
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.
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
eg
type a=
let testfunc testparam:int =
testparam+1
The tool tip will just show testfunc: int->int
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
When i open the tests project in this repo the hover time is often 3ish seconds all of which is spent during checking
It appears to lack the appropriate execute permissions eg chmod +x
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 ->.
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
""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)
""
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
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.