Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ale does not set sign priority #3109

Closed
cridemichel opened this issue Apr 16, 2020 · 9 comments
Closed

ale does not set sign priority #3109

cridemichel opened this issue Apr 16, 2020 · 9 comments
Labels

Comments

@cridemichel
Copy link

cridemichel commented Apr 16, 2020

Information

Ale sign priority is not correctly set and gitgutter signs take precedence over
ale ones.
Indeed, if in my .vimrc I set:

let g:ale_sign_priority=30 
let g:gitgutter_sign_priority=10

which are the default values, I get gitgutter sign rendered on top of ale sign, i.e. as if
it has higher priority than ale sign.
Anyway if I set:

let g:ale_sign_priority=30 
let g:gitgutter_sign_priority=9

i.e. a value less than 10 for gitgutter sign (where 10 is the default value assigned to signs by vim), the ale sign is correctly rendered with higher priority.
This behavior suggests that ale_sign_priority is not handled correctly, i.e. the priority of ale signs is always set to the default value (i.e. 10). To support this conclusion, if set

let g:ale_sign_priority=8
let g:gitgutter_sign_priority=9

ale still has higher priority than gitgutter sign, being rendered on top of gitgutter sign.
In conclusion, it seems that ale signs are always rendered as if they have a priority equal to 10.
To confirm my guess by issuing the command:

:sign place group=* buffer=bufnr('%')

I get:

 line=285  id=1  group=gitgutter  name=GitGutterLineModified  priority=9
    line=378  id=1000001  name=ALEWarningSign  priority=10
    line=381  id=1000002  name=ALEWarningSign  priority=10
    line=417  id=1000003  name=ALEWarningSign  priority=10
    line=421  id=1000004  name=ALEWarningSign  priority=10
    line=570  id=2  group=gitgutter  name=GitGutterLineModified  priority=9
    line=601  id=1000020  name=ALEWarningSign  priority=10
    line=602  id=1000021  name=ALEWarningSign  priority=10
    line=628  id=3  group=gitgutter  name=GitGutterLineModified  priority=9
    line=730  id=1000022  name=ALEWarningSign  priority=10
    line=731  id=1000023  name=ALEWarningSign  priority=10
    line=927  id=1000005  name=ALEWarningSign  priority=10
    line=931  id=1000006  name=ALEWarningSign  priority=10
    line=1036  id=4  group=gitgutter  name=GitGutterLineModified  priority=9
    line=1059  id=5  group=gitgutter  name=GitGutterLineModified  priority=9
    line=1367  id=1000024  name=ALEWarningSign  priority=10
    line=1814  id=6  group=gitgutter  name=GitGutterLineModified  priority=9

VIM version

VIM - Vi IMproved 8.2 (2019 Dec 12, compiled Apr 12 2020 00:47:07)
macOS version
Included patches: 1-539

Operating System:
Mac OSX Catilina 10.15.4

What went wrong

Something went wrong in specifically this place, and I also searched through both open and closed issues for the same problem before reporting a bug here.

Are you having trouble configuring ALE? Try asking for help on Stack Exchange or perhaps on Reddit instead. The GitHub issue tracker should be used for reporting bugs or asking for new features.

Reproducing the bug

to reproduce the bug please use the following minimal vimrc
file:

vimrc_ale_gitgutter.gz

see information section
  1. I did this.
  2. Then this happened.

:ALEInfo

 Current Filetype: c
Available Linters: ['ccls', 'clang', 'clangd', 'clangtidy', 'cppcheck', 'cquery', 'flawfinder', 'gcc']
  Enabled Linters: ['clang', 'gcc']
 Suggested Fixers:
  '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_build_dir = ''
let g:ale_c_build_dir_names = ['build', 'bin']
let g:ale_c_clang_executable = 'clang'
let g:ale_c_clang_options = '-Wall'
let g:ale_c_gcc_executable = 'gcc-9'
let g:ale_c_gcc_options = '-std=c11 -Wall'
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 = 0
let g:ale_command_wrapper = ''
let g:ale_completion_delay = v:null
let g:ale_completion_enabled = 0
let g:ale_completion_max_suggestions = v:null
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 g:ale_fix_on_save = 0
let g:ale_fixers = {'tex': ['remove_trailing_lines', 'trim_whitespace'], 'python': ['black', 'isort']}
let g:ale_history_enabled = 1
let g:ale_history_log_output = 1
let g:ale_keep_list_window_open = 0
let g:ale_lint_delay = 200
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 = {'c': ['gcc', 'clang'], 'tex': ['chktex', 'lacheck', 'texlab'], 'cpp': ['gcc', 'clang'], 'python': ['mypy', 'pylint', 'pyflakes']}
let g:ale_linters_explicit = 0
let g:ale_list_vertical = 0
let g:ale_list_window_size = 10
let g:ale_loclist_msg_format = '%code: %%s'
let g:ale_lsp_root = {}
let g:ale_max_buffer_history_size = 20
let g:ale_max_signs = -1
let g:ale_maximum_file_size = v:null
let g:ale_open_list = 0
let g:ale_pattern_options = v:null
let g:ale_pattern_options_enabled = v:null
let g:ale_set_balloons = 0
let g:ale_set_highlights = 1
let g:ale_set_loclist = 1
let g:ale_set_quickfix = 0
let g:ale_set_signs = 1
let g:ale_sign_column_always = 0
let g:ale_sign_error = '>>'
let g:ale_sign_info = '--'
let g:ale_sign_offset = 1000000
let g:ale_sign_style_error = '>>'
let g:ale_sign_style_warning = '--'
let g:ale_sign_warning = '--'
let g:ale_sign_highlight_linenrs = 0
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) clang
(finished - exit code 0) ['/bin/bash', '-c', '''clang'' -S -x c -fsyntax-only -iquote ''/Users/demichel/MDREPO/MDsimul/ellipsoid'' -Wall -D MD_MAC -O3 -D NO_REMOVE_PARALLEL -D HC_ALGO_OPT -D MC_BOUNDING_SPHERES -D ALIGN_POT -D MC_BOND_POS -D MC_NVE -D MC_FLIP_MOVE -D MCIN_OPT -D MC_HC -D MC_SUS -D MD_NO_SYSTEM -D MC_GRANDCAN -D MC_SIMUL -D MD_LXYZ -D MD_DYNAMIC_OPROG -D MD_SCALEPHI_STAGES -D MD_OPT_SCALEPHI -D MD_GRAZING_TRYHARDER -D MD_GHOST_IGG -D MD_RABBIT -D MD_SAVE_SPOTS -D MD_SUPERELLIPSOID -D MD_BASIC_DT -D MD_BIG_DT -D MD_ASYM_ITENS -D EDHE_FLEX -D MD_PATCHY_HE -D MD_GLOBALNRD -D MD_GLOBALNRNL -D MD_GLOBALNRDNL -D MD_STOREMGL -D MD_LOADMESH -D XDISP -D MOLPTENS -I /usr/include/lam -I ''/Users/demichel/MDREPO/MDsimul/ellipsoid/.'' -I /Users/demichel/MDREPO/MDsimul/include -I /Users/demichel/MDREPO/MDsimul/commSrc -Wall - < ''/var/folders/26/9q3nft3x4xg2zbj45nzm__100000gn/T/vBj1qqo/1/montecarlo.c''']

<<<OUTPUT STARTS>>>
<stdin>:1430:19: warning: unused variable 'k2' [-Wunused-variable]
  int tt, kk, k1, k2;
                  ^
<stdin>:1429:17: warning: unused variable 'dx' [-Wunused-variable]
  double sa[3], dx;
                ^
<stdin>:1430:15: warning: unused variable 'k1' [-Wunused-variable]
  int tt, kk, k1, k2;
              ^
<stdin>:3929:23: warning: unused variable 'k1' [-Wunused-variable]
  int extraspots, kk, k1;
                      ^
<stdin>:4827:30: warning: unused variable 'bb' [-Wunused-variable]
  long long int jj, jj2, aa, bb;
                             ^
<stdin>:4827:21: warning: unused variable 'jj2' [-Wunused-variable]
  long long int jj, jj2, aa, bb;
                    ^
<stdin>:4827:26: warning: unused variable 'aa' [-Wunused-variable]
  long long int jj, jj2, aa, bb;
                         ^
<stdin>:7818:11: warning: unused variable 'nv' [-Wunused-variable]
          double nv[3];
                 ^
<stdin>:7263:18: warning: unused variable 'rmin1' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                 ^
<stdin>:7263:25: warning: unused variable 'rmin2' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                        ^
<stdin>:7263:32: warning: unused variable 'rmin' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                               ^
<stdin>:7263:38: warning: unused variable 'rmax' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                                     ^
<stdin>:7263:44: warning: unused variable 'drSq' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                                           ^
<stdin>:7263:50: warning: unused variable 'verso' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
                                                 ^
<stdin>:7273:17: warning: unused variable 'normo' [-Wunused-variable]
  double rB[3], normo;
                ^
<stdin>:7278:7: warning: unused variable 'nbf' [-Wunused-variable]
  int nbf, ierr, bonded, k1, k2, trials, nbold;
      ^
<stdin>:7265:50: warning: unused variable 'normB' [-Wunused-variable]
  double bondlen, dist=0.0, rA[3], rat[3], norm, normB, sax, cc[3], ene;
                                                 ^
<stdin>:7263:10: warning: unused variable 'sphrad' [-Wunused-variable]
  double sphrad, rmin1, rmin2, rmin, rmax, drSq, verso;
         ^
<stdin>:7854:7: warning: unused variable 'nb' [-Wunused-variable]
  int nb;
      ^
<stdin>:7855:25: warning: unused variable 'ii' [-Wunused-variable]
  long long int aa, bb, ii, jj, jj2;
                        ^
<stdin>:7855:21: warning: unused variable 'bb' [-Wunused-variable]
  long long int aa, bb, ii, jj, jj2;
                    ^
<stdin>:7855:17: warning: unused variable 'aa' [-Wunused-variable]
  long long int aa, bb, ii, jj, jj2;
                ^
<stdin>:7855:33: warning: unused variable 'jj2' [-Wunused-variable]
  long long int aa, bb, ii, jj, jj2;
                                ^
<stdin>:7880:32: warning: unused variable 'k2' [-Wunused-variable]
  int j, i, l, nout, ierr, k1, k2, dorej, nb, nbc;
                               ^
<stdin>:7880:13: warning: unused variable 'l' [-Wunused-variable]
  int j, i, l, nout, ierr, k1, k2, dorej, nb, nbc;
            ^
<stdin>:7880:47: warning: unused variable 'nbc' [-Wunused-variable]
  int j, i, l, nout, ierr, k1, k2, dorej, nb, nbc;
                                              ^
<stdin>:7880:28: warning: unused variable 'k1' [-Wunused-variable]
  int j, i, l, nout, ierr, k1, k2, dorej, nb, nbc;
                           ^
<stdin>:14747:38: warning: unused variable 'eno' [-Wunused-variable]
  double acceptance, traaccept, ene, eno, rotaccept, volaccept=0.0, volfrac;
                                     ^
<stdin>:14747:33: warning: unused variable 'ene' [-Wunused-variable]
  double acceptance, traaccept, ene, eno, rotaccept, volaccept=0.0, volfrac;
                                ^
29 warnings generated.
<<<OUTPUT ENDS>>>

(executable check - success) gcc-9
(finished - exit code 0) ['/bin/bash', '-c', '''gcc-9'' -S -x c -o /dev/null -iquote ''/Users/demichel/MDREPO/MDsimul/ellipsoid'' -Wall -D MD_MAC -O3 -D NO_REMOVE_PARALLEL -D HC_ALGO_OPT -D MC_BOUNDING_SPHERES -D ALIGN_POT -D MC_BOND_POS -D MC_NVE -D MC_FLIP_MOVE -D MCIN_OPT -D MC_HC -D MC_SUS -D MD_NO_SYSTEM -D MC_GRANDCAN -D MC_SIMUL -D MD_LXYZ -D MD_DYNAMIC_OPROG -D MD_SCALEPHI_STAGES -D MD_OPT_SCALEPHI -D MD_GRAZING_TRYHARDER -D MD_GHOST_IGG -D MD_RABBIT -D MD_SAVE_SPOTS -D MD_SUPERELLIPSOID -D MD_BASIC_DT -D MD_BIG_DT -D MD_ASYM_ITENS -D EDHE_FLEX -D MD_PATCHY_HE -D MD_GLOBALNRD -D MD_GLOBALNRNL -D MD_GLOBALNRDNL -D MD_STOREMGL -D MD_LOADMESH -D XDISP -D MOLPTENS -I /usr/include/lam -I ''/Users/demichel/MDREPO/MDsimul/ellipsoid/.'' -I /Users/demichel/MDREPO/MDsimul/include -I /Users/demichel/MDREPO/MDsimul/commSrc -std=c11 -Wall - < ''/var/folders/26/9q3nft3x4xg2zbj45nzm__100000gn/T/vBj1qqo/2/montecarlo.c''']

<<<OUTPUT STARTS>>>
<stdin>: In function 'build_parallelepipeds':
<stdin>:1430:19: warning: unused variable 'k2' [-Wunused-variable]
<stdin>:1430:15: warning: unused variable 'k1' [-Wunused-variable]
<stdin>:1429:17: warning: unused variable 'dx' [-Wunused-variable]
<stdin>: In function 'rot_move':
<stdin>:1854:17: warning: variable 'thetaSq' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'pbc':
<stdin>:3444:17: warning: variable 'Ll' set but not used [-Wunused-but-set-variable]
<stdin>:3444:10: warning: variable 'L2' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'check_alloc_GC':
<stdin>:3929:23: warning: unused variable 'k1' [-Wunused-variable]
<stdin>: In function 'store_bonds_mc':
<stdin>:4827:30: warning: unused variable 'bb' [-Wunused-variable]
<stdin>:4827:26: warning: unused variable 'aa' [-Wunused-variable]
<stdin>:4827:21: warning: unused variable 'jj2' [-Wunused-variable]
<stdin>: In function 'check_bond_added':
<stdin>:7062:25: warning: variable 'jj' set but not used [-Wunused-but-set-variable]
<stdin>:7062:21: warning: variable 'bb' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'mcin':
<stdin>:7818:11: warning: unused variable 'nv' [-Wunused-variable]
<stdin>:7278:7: warning: unused variable 'nbf' [-Wunused-variable]
<stdin>:7273:17: warning: unused variable 'normo' [-Wunused-variable]
<stdin>:7273:10: warning: variable 'rB' set but not used [-Wunused-but-set-variable]
<stdin>:7265:62: warning: variable 'cc' set but not used [-Wunused-but-set-variable]
<stdin>:7265:50: warning: unused variable 'normB' [-Wunused-variable]
<stdin>:7265:10: warning: variable 'bondlen' set but not used [-Wunused-but-set-variable]
<stdin>:7263:50: warning: unused variable 'verso' [-Wunused-variable]
<stdin>:7263:44: warning: unused variable 'drSq' [-Wunused-variable]
<stdin>:7263:38: warning: unused variable 'rmax' [-Wunused-variable]
<stdin>:7263:32: warning: unused variable 'rmin' [-Wunused-variable]
<stdin>:7263:25: warning: unused variable 'rmin2' [-Wunused-variable]
<stdin>:7263:18: warning: unused variable 'rmin1' [-Wunused-variable]
<stdin>:7263:10: warning: unused variable 'sphrad' [-Wunused-variable]
<stdin>: In function 'are_bonded':
<stdin>:7855:33: warning: unused variable 'jj2' [-Wunused-variable]
<stdin>:7855:25: warning: unused variable 'ii' [-Wunused-variable]
<stdin>:7855:21: warning: unused variable 'bb' [-Wunused-variable]
<stdin>:7855:17: warning: unused variable 'aa' [-Wunused-variable]
<stdin>:7854:7: warning: unused variable 'nb' [-Wunused-variable]
<stdin>: In function 'mcoutin':
<stdin>:7881:19: warning: variable 'epotenoldj' set but not used [-Wunused-but-set-variable]
<stdin>:7880:47: warning: unused variable 'nbc' [-Wunused-variable]
<stdin>:7880:32: warning: unused variable 'k2' [-Wunused-variable]
<stdin>:7880:28: warning: unused variable 'k1' [-Wunused-variable]
<stdin>:7880:13: warning: unused variable 'l' [-Wunused-variable]
<stdin>: In function 'find_bonds_fake':
<stdin>:8049:25: warning: variable 'dist' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'mcinout':
<stdin>:8119:19: warning: variable 'epotenoldj' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'is_bonded_mc':
<stdin>:8218:25: warning: variable 'jj' set but not used [-Wunused-but-set-variable]
<stdin>:8218:21: warning: variable 'bb' set but not used [-Wunused-but-set-variable]
<stdin>: In function 'move':
<stdin>:14763:12: warning: variable 'movetype' set but not used [-Wunused-but-set-variable]
<stdin>:14747:38: warning: unused variable 'eno' [-Wunused-variable]
<stdin>:14747:33: warning: unused variable 'ene' [-Wunused-variable]
<stdin>: In function 'dyn_realloc_oprog':
<stdin>:3777:11: warning: 'sushisto' may be used uninitialized in this function [-Wmaybe-uninitialized]
<<<OUTPUT ENDS>>>
@RyanSquared
Copy link
Member

related: #23 #569

to repost from there from @hsanson:

With #2786 it is possible to set g:ale_sign_priority to a value higher than 10 to ensure ALE signs take precedence over other plugins. Also this PR adds support for sign groups that ensure ALE sign manipulations do not interfere with other plugins signs.

Notes:

Only works for NeoVim 0.4.0 and Vim 8.1.0614 and latter.
Other plugins may also support sign-priority. Ensure you set g:ale_sign_priority to your needs.
gitgutter does not use priority therefore any value larger than 10 ensures ALE will take
precedence over it.

@cridemichel
Copy link
Author

cridemichel commented Apr 16, 2020

Dear RyanSquared,
I am on latest macvim (8.2.539) and I have correctly set ale sign priority
(please see my bug report). Latest version of Gitgutter does support sign priority
by setting g:gitgutter_sign_priority and indeed
it is the only way to have gitgutter signs with lower priority than ale ones...
best Cristiano

@hsanson
Copy link
Contributor

hsanson commented Apr 17, 2020

@cridemichel seems ALE is not enabling sign priority and groups for you. When ALE enables these features all signs should have "group=ale" and priority correctly set to g:ale_sign_priority.

This seems to be a problem with vim 8.2 and newer and there is already a PR to fix it: #3050

@cridemichel
Copy link
Author

ok, thank you for pointing it out, do you know when this patch will be merged into master branch?

@hsanson
Copy link
Contributor

hsanson commented Apr 17, 2020

Just did, please close the issue if it fixes it for you.

@cridemichel
Copy link
Author

it works as expected now,
thank you very much!

@RyanSquared
Copy link
Member

@cridemichel this was merged as of 14 hours ago, do you mind testing it now?

@hsanson
Copy link
Contributor

hsanson commented Apr 18, 2020

Submitter reports works as expected so closing.

@hsanson hsanson closed this as completed Apr 18, 2020
@cridemichel
Copy link
Author

cridemichel commented Apr 18, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants