dense-analysis / dense-analysis/ale
Completion lag on a C file with clangd
- Dominant language
- Vim Script
- Stars
- 14k
- Forks
- 1.5k
- Avg merge
- 17h 49m
- Merged PRs (30d)
- 1
Description
## Information
Running `NVIM v0.5.0-dev+1311-gf8173df4d` on Debian.
## What went wrong
On a rather large codebase (with submodules and some Python code) in insert mode, starting to type any character will result in a lag from 2 to dozens of seconds with a CPU hog by the `nvim` process. It seems to be recursively looking for matches in all directories, even the `venv` (used for the Python part of the repo).
The `compile_commands.json` was generated using `bear`.
## Reproducing the bug
1. Go to / clone the repo
2. Generate the `compile_commands` using `bear`
3. Start typing eg an include or a variable name
4. Experience the CPU hog and the freeze of `nvim` for few (long) seconds
### :ALEInfo
```
Current Filetype: c
Available Linters: ['cc', 'ccls', 'clangd', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder']
Linter Aliases:
'cc' -> ['gcc', 'clang']
Enabled Linters: ['clangd']
Ignored Linters: []
Suggested Fixers:
'astyle' - Fix C/C++ with astyle.
'clang-format' - Fix C/C++ and cuda files with clang-format.
'clangtidy' - Fix C/C++ and ObjectiveC files with clang-tidy.
'remove_trailing_lines' - Remove all blank lines at the end of a file.
'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.
'uncrustify' - Fix C, C++, C#, ObjectiveC, ObjectiveC++, D, Java, Pawn, and VALA files with uncrustify.
Linter Variables:
let g:ale_c_always_make = 1
let g:ale_c_build_dir = ''
let g:ale_c_build_dir_names = ['build', 'bin']
let g:ale_c_clangd_executable = 'clangd'
let g:ale_c_clangd_options = ''
let b:ale_c_clangd_options = '-j 8'
let g:ale_c_parse_compile_commands = 1
let g:ale_c_parse_makefile = 0
Global Variables:
let g:ale_cache_executable_check_failures = v:null
let g:ale_change_sign_column_color = v:null
let g:ale_command_wrapper = ''
let g:ale_completion_delay = 2
let b:ale_completion_delay = 2
let g:ale_completion_enabled = 1
let g:ale_completion_max_suggestions = 7
let g:ale_disable_lsp = 0
let g:ale_echo_cursor = 1
let g:ale_echo_msg_error_str = 'Error'
let g:ale_echo_msg_format = '%code: %%s'
let g:ale_echo_msg_info_str = 'Info'
let g:ale_echo_msg_warning_str = 'Warning'
let g:ale_enabled = 1
let b:ale_enabled = 1
let g:ale_fix_on_save = 0
let b:ale_fix_on_save = 0
let g:ale_fixers = {}
let b:ale_fixers = []
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = v:null
let g:ale_lint_delay = 500
let g:ale_lint_on_enter = 1
let g:ale_lint_on_filetype_changed = 1
let g:ale_lint_on_insert_leave = 1
let g:ale_lint_on_save = 1
let g:ale_lint_on_text_changed = 'normal'
let g:ale_linter_aliases = {}
let g:ale_linters = {}
let b:ale_linters = ['clangd']
let g:ale_linters_explicit = 1
let g:ale_linters_ignore = {}
let g:ale_list_vertical = v:null
let g:ale_list_window_size = v:null
let g:ale_loclist_msg_format = v:null
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = v:null
let g:ale_maximum_file_size = v:null
let g:ale_open_list = v:null
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_root = {}
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 0
let g:ale_set_quickfix = 0
let g:ale_set_signs = 0
let g:ale_sign_column_always = v:null
let g:ale_sign_error = v:null
let g:ale_sign_info = v:null
let g:ale_sign_offset = v:null
let g:ale_sign_style_error = v:null
let g:ale_sign_style_warning = v:null
let g:ale_sign_warning = v:null
let g:ale_sign_highlight_linenrs = v:null
let g:ale_statusline_format = v:null
let g:ale_type_map = {}
let g:ale_use_global_executables = v:null
let g:ale_virtualtext_cursor = 0
let g:ale_warn_about_trailing_blank_lines = 1
let g:ale_warn_about_trailing_whitespace = 1
Command History:
(executable check - success) clangd
(started) ['/bin/bash', '-c', '''clangd'' -j 8 -compile-commands-dir=''/home/darosior/projects/lightning''']
(started) ['/bin/bash', '-c', '''clangd'' -j 8 -compile-commands-dir=''/home/darosior/projects/lightning''']
(started) ['/bin/bash', '-c', '''clangd'' -j 8 -compile-commands-dir=''/home/darosior/projects/lightning''']
(started) ['/bin/bash', '-c', '''clangd'' -j 8 -compile-commands-dir=''/home/darosior/projects/lightning''']
(started) ['/bin/bash', '-c', '''clangd'' -j 8 -compile-commands-dir=''/home/darosior/projects/lightning''']
```
Contributor guide
Assessment
This issue has not been assessed yet.