Skip to content

FsAutoComplete causes Neovim 0.12.2 to freeze #1534

Description

@mslizh

Version

v0.83.0+96fabed8e9181b74e19e211717626c204c32b2c2

Dotnet Info

.NET SDK:
Version: 10.0.201
Commit: 4d3023de60
Workload version: 10.0.200-manifests.0793c108
MSBuild version: 18.3.0-release-26153-122+4d3023de6

Runtime Environment:
OS Name: Mac OS X
OS Version: 26.5
OS Platform: Darwin
RID: osx-arm64
Base Path: /usr/local/share/dotnet/sdk/10.0.201/

.NET workloads installed:
There are no installed workloads to display.
Configured to use workload sets when installing new manifests.
No workload sets are installed. Run "dotnet workload restore" to install a workload set.

Host:
Version: 10.0.5
Architecture: arm64
Commit: a612c2a105

.NET SDKs installed:
10.0.100 [/usr/local/share/dotnet/sdk]
10.0.201 [/usr/local/share/dotnet/sdk]

.NET runtimes installed:
Microsoft.AspNetCore.App 10.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 10.0.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 10.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
Microsoft.NETCore.App 10.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Other architectures found:
None

Environment variables:
Not set

global.json file:
Not found

Steps to reproduce

  1. Install Neovim 0.12.2
brew install neovim
  1. Install FSAC
dotnet tool install --global fsautocomplete
  1. Add to ~/.config/nvim/init.lua
vim.pack.add {
  { src = 'https://github.com/neovim/nvim-lspconfig' },
}

vim.lsp.config('fsautocomplete', {
  -- on_attach = function(client, bufnr)
  --   client.server_capabilities.semanticTokensProvider = nil
  -- end,
})

vim.lsp.enable({ 'fsautocomplete' })
  1. Create new .NET console project
dotnet new console -lang F#
  1. Paste code from https://github.com/ionide/FsAutoComplete/blob/main/src/FsAutoComplete.Core/Commands.fs in Program.fs and neovim will freeze.

  2. Uncomment on_attach in ~/.config/nvim/init.lua and Neovim will stop freezing.

Details

From an F# project:

nvim Program.fs

Expected:
Neovim exits after 5 seconds.

Actual:
Neovim hangs and must be killed. CPU usage stays close to 100%.

LSP Log

After clearing Neovim's LSP log, the log stays empty while Neovim hangs.
Before that, there were many semantic token related errors from previous runs, but the current hang happens without new log output.

Workaround

Disabling semantic tokens for the fsautocomplete client appears to avoid the hang:

vim.lsp.config('fsautocomplete', {
  on_attach = function(client)
    client.server_capabilities.semanticTokensProvider = nil
  end,
})

Question

Could fsautocomplete be returning invalid or unexpectedly large semantic token/range data that causes Neovim to spin in offset conversion?

Logs

No response

Checklist

  • I have looked through existing issues to make sure that this bug has not been reported before
  • I have provided a descriptive title for this issue
  • I have made sure that that this bug is reproducible on the latest version of the package
  • I have provided all the information needed to reproduce this bug as efficiently as possible
  • I or my company would be willing to contribute this fix

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions