ionide / ionide/FsAutoComplete

FsAutoComplete causes Neovim 0.12.2 to freeze

Open
#1,534 2 comments 17 reactions 0 assignees View on GitHub
bug
Dominant language
F#
Stars
486
Forks
169
Avg merge
2d 8h
Merged PRs (30d)
5

Description

### 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

```zsh
brew install neovim
```

2. Install FSAC

```zsh
dotnet tool install --global fsautocomplete
```

3. Add to `~/.config/nvim/init.lua`

```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' })
```

4. Create new .NET console project

```zsh
dotnet new console -lang F#
```

5. Paste code from https://github.com/ionide/FsAutoComplete/blob/main/src/FsAutoComplete.Core/Commands.fs in `Program.fs` and neovim will freeze.

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

### Details

From an F# project:

```zsh
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:

```lua
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

- [x] I have looked through existing issues to make sure that this bug has not been reported before
- [x] I have provided a descriptive title for this issue
- [x] I have made sure that that this bug is reproducible on the latest version of the package
- [x] 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

Contributor guide

Open the contributing guide

Research direction

Reproduce the freeze with Neovim 0.12.2, FsAutoComplete v0.83.0, the init.lua configuration, and the F# Program.fs content copied from src/FsAutoComplete.Core/Commands.fs. Start by comparing behavior with semantic tokens enabled and disabled; done means the project opens and Neovim exits normally without requiring the workaround.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp, neovim
Domain
devtools, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.