Saghen / blink.cmp

Performant, batteries-included completion plugin for Neovim
MIT License
631 stars 26 forks source link

Fsautocomplete crashes when accepting an item #76

Open nathanjcollins opened 22 hours ago

nathanjcollins commented 22 hours ago

I receive this error when I accept an item from the list:

Screenshot 2024-10-10 at 11 31 46

Error in the Lsp Log:

[ERROR][2024-10-10 11:31:35] .../vim/lsp/rpc.lua:770    "rpc"   "/Users/nathancollins/.local/share/nvim/mason/bin/fsautocomplete"   "stderr"    "[11:31:35.118 ERR] [Startup] Start - LSP mode crashed\nSystem.AggregateException: One or more errors occurred. (Could not create an instance of the type 'U2`2')\n ---> System.Exception: Could not create an instance of the type 'U2`2'\n   at Ionide.LanguageServerProtocol.JsonUtils.ErasedUnionConverter.ReadJson(JsonReader reader, Type t, Object _existingValue, JsonSerializer serializer) in /_//src/JsonUtils.fs:line 220\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.DeserializeConvertable(JsonConverter converter, JsonReader reader, Type objectType, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\n   at Ionide.LanguageServerProtocol.JsonUtils.OptionConverter.ReadJson(JsonReader reader, Type t, Object _existingValue, JsonSerializer serializer) in /_//src/OptionConverter.fs:line 120\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.ResolvePropertyAndCreatorValues(JsonObjectContract contract, JsonProperty containerProperty, JsonReader reader, Type objectType)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObjectUsingCreatorWithParameters(JsonReader reader, JsonObjectContract contract, JsonProperty containerProperty, ObjectConstructor`1 creator, String id)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateObject(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.CreateValueInternal(JsonReader reader, Type objectType, JsonContract contract, JsonProperty member, JsonContainerContract containerContract, JsonProperty containerMember, Object existingValue)\n   at Newtonsoft.Json.Serialization.JsonSerializerInternalReader.Deserialize(JsonReader reader, Type objectType, Boolean checkAdditionalContent)\n   at Newtonsoft.Json.JsonSerializer.DeserializeInternal(JsonReader reader, Type objectType)\n   at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType, JsonSerializer jsonSerializer)\n   at StreamJsonRpc.JsonMessageFormatter.InboundJsonRpcRequest.TryGetTypedArguments(ReadOnlySpan`1 parameters, Span`1 typedArguments)\n   at StreamJsonRpc.TargetMethod.TryGetArguments(JsonRpcRequest request, MethodSignature method, Span`1 arguments)\n   at StreamJsonRpc.TargetMethod..ctor(JsonRpcRequest request, List`1 candidateMethodTargets, SynchronizationContext fallbackSynchronizationContext)\n   at StreamJsonRpc.Reflection.RpcTargetInfo.TryGetTargetMethod(JsonRpcRequest request, TargetMethod& targetMethod)\n   at StreamJsonRpc.JsonRpc.DispatchIncomingRequestAsync(JsonRpcRequest request)\n   at StreamJsonRpc.JsonRpc.DispatchIncomingRequestAsync(JsonRpcRequest request)\n   at StreamJsonRpc.JsonRpc.HandleRpcAsync(JsonRpcMessage rpc)\n   --- End of inner exception stack trace ---\n   at Ionide.LanguageServerProtocol.Server.startWithSetupCore[client](FSharpFunc`2 setupRequestHandlings, IJsonRpcMessageHandler jsonRpcHandler, FSharpFunc`2 clientCreator, FSharpFunc`2 customizeRpc) in /_//src/LanguageServerProtocol.fs:line 214\n   at Ionide.LanguageServerProtocol.Server.startWithSetup[client](FSharpFunc`2 setupRequestHandlings, Stream input, Stream output, FSharpFunc`2 clientCreator, FSharpFunc`2 customizeRpc) in /_//src/LanguageServerProtocol.fs:line 229\n   at Ionide.LanguageServerProtocol.Server.start@401-1.Invoke(FSharpFunc`2 customizeRpc)\n   at FsAutoComplete.Lsp.AdaptiveFSharpLspServerModule.startCore[a,a](a toolsPath, FSharpFunc`2 workspaceLoaderFactory, ISourceTextFactory sourceTextFactory, Boolean useTransparentCompiler) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs:line 3157\n   at FsAutoComplete.Parser.lspFactory@157.Invoke(Unit unitVar0) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/Parser.fs:line 158\n   at FsAutoComplete.Lsp.AdaptiveFSharpLspServerModule.start(FSharpFunc`2 startCore) in /home/runner/work/FsAutoComplete/FsAutoComplete/src/FsAutoComplete/LspServers/AdaptiveFSharpLspServer.fs:line 3196\n"

This only happens in .fs files with fsautocomplete, other language servers seem fine.

My config if it helps:

return {
  'saghen/blink.cmp',
  lazy = false, -- lazy loading handled internally
  -- optional: provides snippets for the snippet source
  dependencies = 'rafamadriz/friendly-snippets',

  -- use a release tag to download pre-built binaries
  version = 'v0.*',
  -- OR build from source, requires nightly: https://rust-lang.github.io/rustup/concepts/channels.html#working-with-nightly-rust
  -- build = 'cargo build --release',
  -- On musl libc based systems you need to add this flag
  -- build = 'RUSTFLAGS="-C target-feature=-crt-static" cargo build --release',

  opts = {
    highlight = {
      -- sets the fallback highlight groups to nvim-cmp's highlight groups
      -- useful for when your theme doesn't support blink.cmp
      -- will be removed in a future release, assuming themes add support
      use_nvim_cmp_as_default = true,
    },
    -- set to 'mono' for 'Nerd Font Mono' or 'normal' for 'Nerd Font'
    -- adjusts spacing to ensure icons are aligned
    nerd_font_variant = 'normal',

    -- experimental auto-brackets support
    accept = { auto_brackets = { enabled = true } },

    -- experimental signature help support
    trigger = { signature_help = { enabled = true } },

    keymap = {
      accept = '<CR>',
      select_prev = { '<C-p>' },
      select_next = { '<C-n>' },
    },
  },
}