dense-analysis / dense-analysis/ale

Neovim only: Use LibUV to automatically stop language servers

Open
#4,459 0 comments 2 reactions 1 assignee Claimed by @w0rp View on GitHub
enhancement
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

We must implement #4458 first to implement this.

In Vim it is effectively impossible to watch for changes to files. In Neovim, it's pretty easy to do, provided you are running the right OS, you have the right libraries, and all planets align. We can test to see if planets do align and prevent errors from appearing in Neovim. We can use the [built-in support for LibUV in Neovim](https://neovim.io/doc/user/luvref.html). We will be free to write the LibUV specific parts only in Lua.

We will support the following addition to linter definitions:

```vim
call ale#linter#Define('go', {
\ 'name': 'gopls',
\ ...
\ 'restart_on': function('ale_linters#go#gopls#FindProjectFiles'),
\})
```

The `restart_on` functions must return a `List` of `String` values naming files to watch, which must be absolute paths to files. We must support `ale#command#Run` deferred return values so we can apply semver checks to know if we need to watch certain files or not. (Say for example `gopls` is later updated to react to `go.sum` file modifications, so we stop watching that file for newer `gopls` versions.)

Implementing this feature will allow us to easily overcome a shortcoming of many language servers, which is that they do not react to project files being changed.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.