dense-analysis / dense-analysis/ale

Support compile_flags.txt with clang-based tools

Open
#2,831 3 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Vim Script
Stars
14k
Forks
1.5k
Avg merge
17h 49m
Merged PRs (30d)
1

Description

Clang-based tools also support a file `compile_flags.txt`, which is a simpler alternative to a full `compile_commands.json` file (see [here](https://clang.llvm.org/docs/JSONCompilationDatabase.html#alternatives)). However, the [`ale#c#FindProjectRoot`](https://github.com/dense-analysis/ale/blob/b8949aaac33e152b195d3adf11ddbe863c0feef1/autoload/ale/c.vim#L190) function does not attempt to locate such a file, since [`ale#c#FindCompileCommands`](https://github.com/dense-analysis/ale/blob/b8949aaac33e152b195d3adf11ddbe863c0feef1/autoload/ale/c.vim#L161) does not look for `compile_flags.txt`.

This seems like an easy feature to add, and I'd be happy to do it. The only question I had was whether this should be made in `FindCompileCommands` or in `FindProjectRoot` (or neither). Changing `FindCompileCommands` would require the smallest diff, but it would also make the name slightly misleading. It also might break some other user of the function.

The main impetus for this is that it doesn't seem like `clangd` will start if ALE cannot find a `compile_commands.json` file to use, even if there is a `compile_flags.txt` file available. (Also, `clangd` can provide useful results even without a compilation database present. Is there a way to force it to be started?)

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.