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

fsautocomplete error on startup when using analyzer #41

Open
joprice opened this issue Jan 6, 2025 · 2 comments
Open

fsautocomplete error on startup when using analyzer #41

joprice opened this issue Jan 6, 2025 · 2 comments

Comments

@joprice
Copy link

joprice commented Jan 6, 2025

Describe the bug

After following the instructions to install using paket, fsautocomplete throws the following error on initialization:

System.Collections.Generic.KeyNotFoundException: An index satisfying the predicate was not found in the collection.\n   at Microsoft.FSharp.Collections.ArrayModule.loop@1117-39[T](FSharpFunc`2 predicate, T[] array, Int32 i) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\array.fs:line 1119\n   at Microsoft.FSharp.Collections.ArrayModule.Find[T](FSharpFunc`2 predicate, T[] array) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\array.fs:line 1125\n   at <StartupCode$FSharp-Analyzers-SDK>.$FSharp.Analyzers.SDK.Client.findFSharpAnalyzerSDKVersion@179(Assembly assembly) in /_//src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.Client.fs:line 181\n   at <StartupCode$FSharp-Analyzers-SDK>.$FSharp.Analyzers.SDK.Client.analyzers@188.Invoke(Tuple`2 tupledArg) in /_//src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.Client.fs:line 189\n   at Microsoft.FSharp.Collections.ArrayModule.Filter.createMask[a](FSharpFunc`2 f, a[] src, UInt32[]& maskArrayOut, UInt32& leftoverMaskOut) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\array.fs:line 867\n   at Microsoft.FSharp.Collections.ArrayModule.Filter.filter[a](FSharpFunc`2 f, a[] src) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\array.fs:line 1061\n   at Microsoft.FSharp.Collections.ArrayModule.Filter[T](FSharpFunc`2 predicate, T[] array) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\array.fs:line 1068\n   at FSharp.Analyzers.SDK.Client`2.LoadAnalyzers(String dir, FSharpOption`1 excludeInclude) in /_//src/FSharp.Analyzers.SDK/FSharp.Analyzers.SDK.Client.fs:line 187\n   at FsAutoComplete.Lsp.AdaptiveState.loadAnalyzers(FSharpConfig config, FSharpOption`1 rootPath) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveServerState.fs:line 266\n   at <StartupCode$fsautocomplete>.$AdaptiveServerState.-ctor@309-46.Invoke(Tuple`3 tupledArg) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveServerState.fs:line 314\n   at FSharp.Control.Reactive.ObservableModule.subscribe@1681-2.Invoke(T delegateArg0)\n   at System.Reactive.AnonymousObserver`1.OnNextCore(T value) in /_/Rx.NET/Source/src/System.Reactive/AnonymousObserver.cs:line 67\n   at System.Reactive.ObserverBase`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34\n   at System.Reactive.AutoDetachObserver`1.OnNextCore(T value) in /_/Rx.NET/Source/src/System.Reactive/Internal/AutoDetachObserver.cs:line 61\n   at System.Reactive.ObserverBase`1.OnNext(T value) in /_/Rx.NET/Source/src/System.Reactive/ObserverBase.cs:line 34\n   at FsAutoComplete.Adaptive.AVal.Observable.onValueChangedWeak@166-1.Invoke(b value)\n   at FSharp.Data.Adaptive.Transaction.runFinalizers()\n   at FSharp.Data.Adaptive.Transaction.System.IDisposable.Dispose()\n   at FSharp.Data.Adaptive.TransactionModule.transact[T](FSharpFunc`2 action)\n   at FSharp.Data.Adaptive.TransactionModule.transact[T](FSharpFunc`2 action)\n   at <StartupCode$fsautocomplete>.$AdaptiveFSharpLspServer.FsAutoComplete-Lsp-IFSharpLspServer-WorkspaceDidChangeConfiguration@1764-11.Invoke(Unit unitVar) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs:line 1769\n   at Microsoft.FSharp.Control.AsyncPrimitives.CallThenInvoke[T,TResult](AsyncActivation`1 ctxt, TResult result1, FSharpFunc`2 part2) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs:line 510\n   at Microsoft.FSharp.Control.Trampoline.Execute(FSharpFunc`2 firstAction) in D:\\a\\_work\\1\\s\\src\\FSharp.Core\\async.fs

It seems to be failing to find FSharp.Analyzers.SDK. Is there some compatibility requirement with sdk versions or fsautocomplete that I need to abide by?

@Zaid-Ajaj
Copy link
Owner

it must a compat issue, it's been a while since I've updated the analyzer to keep up with changes in ionide.

Honestly the easiest way to use this is via the ubik cli option since it doesn't rely on any external tooling 🤞

@joprice
Copy link
Author

joprice commented Jan 9, 2025

Yes I have been using that one, but just got other analyzers working and thought it would be nice to see the immediate output directly in vim in realtime. I can try updating the project to the latest.

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