Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ALEGoToDefinition does nothing#4228

Unanswered
Discussion options

I installed my standard .vimrc on a new laptop (macbook pro running Monterey 12.2.1), and for some reason Ale's ALEGoToDefinition isn't working.

When I call the command, it just doesn't do anything at all.

My .vimrc looks like this:

" Install vim-plug if not installedif empty(glob('~/.vim/autoload/plug.vim'))  silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs    \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim  autocmd VimEnter * PlugInstall --sync | source $MYVIMRCendif" Pluginscall plug#begin()Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }Plug 'junegunn/fzf.vim'Plug 'scrooloose/nerdtree', { 'on':  'NERDTreeToggle' }Plug 'rakr/vim-one'Plug 'dense-analysis/ale'Plug 'tpope/vim-abolish'Plug 'tpope/vim-fugitive'Plug 'tpope/vim-surround'Plug 'tpope/vim-commentary'Plug 'tpope/vim-endwise'Plug 'chaoren/vim-wordmotion'Plug 'neoclide/coc.nvim', {'branch': 'release'}Plug 'jiangmiao/auto-pairs'Plug 'vim-test/vim-test'call plug#end()" Configurate the vimlet mapleader = ","noremap <Space> :noremap ; :set numberset tabstop=4set hlsearchset backspace=2set ignorecaseset smartcasecommand! PrettyJson %!python -m json.toolautocmd BufRead,BufNewFile *.htm,*.html setlocal tabstop=2 shiftwidth=2 softtabstop=2nmap <leader>f :Files<CR>nmap <leader>d :ALEGoToDefinition<CR>nmap <leader>g :NERDTree<CR>nmap <leader><C-t> :Tags<CR>nmap <leader><C-f> :Rg<CR>nmap <silent> <leader>t :TestNearest<CR>nmap <silent> <leader>T :TestFile<CR>nmap <silent> <leader>a :TestSuite<CR>nmap <silent> <leader>l :TestLast<CR>nmap <silent> <leader>G :TestVisit<CR>" Use Coc for autocompleteinoremap <silent><expr> <TAB>      \ pumvisible() ? "\<C-n>" :      \ <SID>check_back_space() ? "\<TAB>" :      \ coc#refresh()inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<C-h>"function! s:check_back_space() abort  let col = col('.') - 1  return !col || getline('.')[col - 1]  =~# '\s'endfunctionlet g:ale_inters_explicit = 1let g:ale_linters = {\'ruby': ['rubocop', 'standardrb'],\'python': ['flake8', 'pylint'],\'javascript': ['eslint'],\}let g:ale_fixers = {\   'python': ['black', 'isort'],\   'javascript': ['prettier'],\'ruby': ['rubocop'],\   'go': ['goimports']\ }let g:lightline = {\   'colorscheme': 'one',\   'active': {\       'left': [\           [ 'mode', 'paste' ],\           [ 'gitbranch', 'readonly', 'relativepath', 'modified' ]\       ],\       'right': [ [ 'lineinfo' ], [ 'project' ] ]\   },\   'component_function': {\       'project': 'CurrentProject',\       'gitbranch': 'fugitive#head',\   },\ }function! CurrentProject()    " the current directory, relative to ~/dev/    return fnamemodify(getcwd(), ':~:s?\~\/dev\/??') endfunction" disable background color erase (BCE) and redraw after 1 line of scroll" workaround for vim bug enabling BCE for terminals that dont' support it" kovidgoyal/kitty#108, microsoft/terminal#832"" Also sets ttyfast, which improves smoothness of redrawing but is only" on by default for certain values of `term`, excluding `xterm-kitty`.if &term == 'xterm-kitty'  set t_ut= | set ttyscroll=1endif" Color schemeset termguicolorsset background=darkcolorscheme oneset laststatus=2call one#highlight('Pmenu', '78d46e', '1f1f1f', 'none')call one#highlight('PmenuSel', '1f1f1f', '78d46e', 'none')" Auto-reload ~/.vimrcaugroup vimrc-reload    autocmd!    autocmd BufWritePost $MYVIMRC nested source $MYVIMRCaugroup END
You must be logged in to vote

Replies: 4 comments

Comment options

Output of ALEInfo would allow others to help. What language you are working on and what LSPs you are using?

You must be logged in to vote
0 replies
Comment options

I'm using this in Ruby (new to Ruby fwiw), and usingrubocop.

 Current Filetype: ruby                                                                              Available Linters: ['brakeman', 'cspell', 'debride', 'rails_best_practices', 'reek', 'rubocop', 'ruby', 'solargraph', 'sorbet', 'standardrb']                                                                Linter Aliases:                                                                                   'sorbet' -> ['srb']                                                                                    Enabled Linters: ['rubocop', 'standardrb']                                                           Ignored Linters: []                                                                                 Suggested Fixers:                                                                                     'prettier' - Apply prettier to a file.                                                               'remove_trailing_lines' - Remove all blank lines at the end of a file.                               'rubocop' - Fix ruby files with rubocop --auto-correct.                                              'rufo' - Fix ruby files with rufo                                                                    'sorbet' - Fix ruby files with srb tc --autocorrect.                                                 'standardrb' - Fix ruby files with standardrb --fix                                                  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.             Linter Variables:                                                                                   let g:ale_ruby_rails_best_practices_executable = 'rails_best_practices'                              let g:ale_ruby_rails_best_practices_options = ''                                                     let g:ale_ruby_rubocop_executable = 'rubocop'                                                        let g:ale_ruby_rubocop_options = ''                                                                  let g:ale_ruby_standardrb_executable = 'standardrb'                                                  let g:ale_ruby_standardrb_options = ''                                                                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_disable_lsp = 0                                                                            let g:ale_echo_cursor = 1                                                                            let g:ale_echo_msg_error_str = 'Error'                                                               let g:ale_echo_msg_format = v:null                                                                   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 = {'go': ['goimports'], 'ruby': ['rubocop'], 'javascript': ['prettier'], '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 = {'ruby': ['rubocop', 'standardrb'], 'javascript': ['eslint'], 'python': ['flake8', 'pylint']}                                                                                         let g:ale_linters_explicit = 0                                                                       let g:ale_linters_ignore = {}                                                                        let g:ale_list_vertical = 0                                                                          let g:ale_list_window_size = 10                                                                      let g:ale_loclist_msg_format = '%code: %%s'                                                          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_root = {}                                                                                  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 = 0let 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) rubocop                                                                 (finished - exit code 1) ['/bin/zsh', '-c', '''rubocop'' --format json --force-exclusion  --stdin ''/Users/robby/code/backend/app/models/drop.rb'' < ''/var/folders/rm/xkrxh2lj0llg180d355y76mh0000gn/T/vKTqop1/4/drop.rb''']                                                                                  <<<OUTPUT STARTS>>>                                                                                  {"metadata":{"rubocop_version":"1.27.0","ruby_engine":"ruby","ruby_version":"3.0.0","ruby_patchlevel":"0","ruby_platform":"arm64-darwin21"},"files":[{"path":"app/models/drop.rb","offenses":[{"severity":"convention","message":"Missing top-level documentation comment for `class Drop`.","cop_name":"Style/Documentation","corrected":false,"correctable":false,"location":{"start_line":1,"start_column":1,"last_line":1,"last_column":10,"length":10,"line":1,"column":1}},{"severity":"convention","message":"Missing frozen string literal comment.","cop_name":"Style/FrozenStringLiteralComment","corrected":false,"correctable":true,"location":{"start_line":1,"start_column":1,"last_line":1,"last_column":1,"length":1,"line":1,"column":1}},{"severity":"convention","message":"Freeze mutable objects assigned to constants.","cop_name":"Style/MutableConstant","corrected":false,"correctable":true,"location":{"start_line":2,"start_column":11,"last_line":2,"last_column":84,"length":74,"line":2,"column":11}},{"severity":"convention","message":"`%w`-literals should be delimited by `[` and `]`.","cop_name":"Style/PercentLiteralDelimiters","corrected":false,"correctable":true,"location":{"start_line":2,"start_column":11,"last_line":2,"last_column":84,"length":74,"line":2,"column":11}}]}],"summary":{"offense_count":4,"target_file_count":1,"inspected_file_count":1}}                                                          <<<OUTPUT ENDS>>>                                                                                    (executable check - success) standardrb                                                              (finished - exit code 1) ['/bin/zsh', '-c', '''standardrb'' --format json --force-exclusion  --stdin ''/Users/robby/code/backend/app/models/drop.rb'' < ''/var/folders/rm/xkrxh2lj0llg180d355y76mh0000gn/T/vKTqop1/5/drop.rb''']                                                                               <<<OUTPUT STARTS>>>                                                                                  {"metadata":{"rubocop_version":"1.23.0","ruby_engine":"ruby","ruby_version":"3.0.0","ruby_patchlevel":"0","ruby_platform":"arm64-darwin21"},"files":[{"path":"app/models/drop.rb","offenses":[{"severity":"convention","message":"`%w`-literals should be delimited by `[` and `]`.","cop_name":"Style/PercentLiteralDelimiters","corrected":false,"correctable":true,"location":{"start_line":2,"start_column":11,"last_line":2,"last_column":84,"length":74,"line":2,"column":11}}]}],"summary":{"offense_count":1,"target_file_count":1,"inspected_file_count":1}}                                                         <<<OUTPUT ENDS>>>
You must be logged in to vote
0 replies
Comment options

Rubocop is not a LSP so these functions won't work. You will need to install and configuresolargraph to get this functionality. Note that solargraph requires some pre-configuration before it can work properly so make sure to read configuration, scanning, and if using rails also read the section on rails setup.

You must be logged in to vote
0 replies
Comment options

Hello,

I've got also ALEGoToDefinition / ALEGoToImplementation not working, but for python this time. I'm using pylsp as lsp server with vim 9.1.

Here my ALEInfo:

 Current Filetype: pythonAvailable Linters: ['bandit', 'cspell', 'flake8', 'flakehell', 'jedils', 'mypy', 'prospector', 'pycln', 'pycodestyle', 'pydocstyle', 'pyflakes', 'pylama', 'pylint', 'pylsp', 'pyre', 'pyright', 'refurb', 'ruff', 'unimport', 'vulture']   Linter Aliases:'jedils' -> ['jedi_language_server']  Enabled Linters: ['flake8', 'mypy', 'pylint', 'pyright', 'ruff']  Ignored Linters: ['pyright'] Suggested Fixers:  'add_blank_lines_for_python_control_statements' - Add blank lines before control statements.  'autoflake' - Fix flake issues with autoflake.  'autoimport' - Fix import issues with autoimport.  'autopep8' - Fix PEP8 issues with autopep8.  'black' - Fix PEP8 issues with black.  'isort' - Sort Python imports with isort.  'pycln' - remove unused python import statements  'pyflyby' - Tidy Python imports with pyflyby.  'remove_trailing_lines' - Remove all blank lines at the end of a file.  'reorder-python-imports' - Sort Python imports with reorder-python-imports.  'ruff' - A python linter/fixer for Python written in Rust  'ruff_format' - Fix python files with the ruff formatter.  'trim_whitespace' - Remove all trailing whitespace characters at the end of every line.  'yapf' - Fix Python files with yapf.  Linter Variables:let g:ale_python_auto_pipenv = 1let g:ale_python_auto_poetry = 0let g:ale_python_auto_uv = 0let g:ale_python_auto_virtualenv = 0let g:ale_python_flake8_auto_pipenv = 0let g:ale_python_flake8_auto_poetry = 0let g:ale_python_flake8_auto_uv = 0let g:ale_python_flake8_change_directory = 'project'let g:ale_python_flake8_executable = 'flake8'let g:ale_python_flake8_options = ''let g:ale_python_flake8_use_global = 0let g:ale_python_mypy_auto_pipenv = 0let g:ale_python_mypy_auto_poetry = 0let g:ale_python_mypy_auto_uv = 0let g:ale_python_mypy_executable = 'mypy'let g:ale_python_mypy_ignore_invalid_syntax = 0let g:ale_python_mypy_options = ''let g:ale_python_mypy_show_notes = 1let g:ale_python_mypy_use_global = 0let g:ale_python_pylint_auto_pipenv = 0let g:ale_python_pylint_auto_poetry = 0let g:ale_python_pylint_auto_uv = 0let g:ale_python_pylint_change_directory = 1let g:ale_python_pylint_executable = 'pylint'let g:ale_python_pylint_options = ''let g:ale_python_pylint_use_global = 0let g:ale_python_pylint_use_msg_id = 0let g:ale_python_pyright_auto_pipenv = 0let g:ale_python_pyright_auto_poetry = 0let g:ale_python_pyright_auto_uv = 0let g:ale_python_pyright_config = {}let g:ale_python_pyright_executable = 'pyright-langserver'let g:ale_python_pyright_use_global = 0let g:ale_python_ruff_auto_pipenv = 0let g:ale_python_ruff_auto_poetry = 0let g:ale_python_ruff_auto_uv = 0let g:ale_python_ruff_change_directory = 1let g:ale_python_ruff_executable = 'ruff'let g:ale_python_ruff_options = ''let g:ale_python_ruff_use_global = 0  Global Variables:let g:ale_cache_executable_check_failures = v:nulllet g:ale_change_sign_column_color = 0let g:ale_command_wrapper = ''let g:ale_completion_delay = 100let g:ale_completion_enabled = 1let g:ale_completion_max_suggestions = 50let g:ale_disable_lsp = 1let g:ale_echo_cursor = 1let 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 = 1let g:ale_fix_on_save = 0let g:ale_fixers = {}let g:ale_history_enabled = 1let g:ale_info_default_mode = 'preview'let g:ale_history_log_output = 1let g:ale_keep_list_window_open = 0let g:ale_lint_delay = 200let g:ale_lint_on_enter = 1let g:ale_lint_on_filetype_changed = 1let g:ale_lint_on_insert_leave = 1let g:ale_lint_on_save = 1let g:ale_lint_on_text_changed = 'normal'let g:ale_linter_aliases = {}let g:ale_linters = {'typescript': ['eslint', 'tsserver', 'typecheck'], 'c': ['clang'], 'javascript': ['eslint']}let g:ale_linters_explicit = 0let g:ale_linters_ignore = {}let g:ale_list_vertical = 0let g:ale_list_window_size = 10let g:ale_loclist_msg_format = '%code: %%s'let g:ale_max_buffer_history_size = 20let g:ale_max_signs = -1let g:ale_maximum_file_size = v:nulllet g:ale_open_list = 1let g:ale_pattern_options = v:nulllet g:ale_pattern_options_enabled = v:nulllet g:ale_root = {}let g:ale_set_balloons = 0let g:ale_set_highlights = 1let g:ale_set_loclist = 1let g:ale_set_quickfix = 0let g:ale_set_signs = 1let g:ale_sign_column_always = 0let g:ale_sign_error = 'E'let g:ale_sign_info = 'I'let g:ale_sign_offset = 1000000let g:ale_sign_style_error = 'E'let g:ale_sign_style_warning = 'W'let g:ale_sign_warning = 'W'let g:ale_sign_highlight_linenrs = 0let g:ale_type_map = {}let g:ale_use_neovim_diagnostics_api = 0let g:ale_use_global_executables = v:nulllet g:ale_virtualtext_cursor = 'all'let g:ale_warn_about_trailing_blank_lines = 1let g:ale_warn_about_trailing_whitespace = 1   Command History:(finished - exit code 0) ['/bin/bash', '-c', '''pylint'' --version']<<<OUTPUT STARTS>>>pylint 3.1.0astroid 3.1.0Python 3.12.3 (main, Feb  4 2025, 14:48:35) [GCC 13.3.0]<<<OUTPUT ENDS>>>(executable check - success) flake8(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''flake8'' --version']<<<OUTPUT STARTS>>>7.0.0 (mccabe: 0.7.0, pycodestyle: 2.11.1, pyflakes: 3.2.0) CPython 3.12.3 on Linux<<<OUTPUT ENDS>>>(executable check - success) /home/bree/.cache/pypoetry/virtualenvs/mmsx-34asXHEB-py3.12/bin/mypy(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''/home/bree/.cache/pypoetry/virtualenvs/mmsx-34asXHEB-py3.12/bin/mypy'' --show-column-numbers --shadow-file ''/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py'' ''/tmp/v0uunvM/1/intersec-connector.py'' ''/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py''']<<<OUTPUT STARTS>>>Success: no issues found in 1 source file<<<OUTPUT ENDS>>>(executable check - success) /home/bree/.cache/pypoetry/virtualenvs/mmsx-34asXHEB-py3.12/bin/pylint(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''/home/bree/.cache/pypoetry/virtualenvs/mmsx-34asXHEB-py3.12/bin/pylint'' --output-format text --msg-template="{path}:{line}:{column}: {msg_id} ({symbol}) {msg}" --reports n --from-stdin ''/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py'' < ''/tmp/v0uunvM/2/intersec-connector.py''']<<<OUTPUT STARTS>>>------------------------------------Your code has been rated at 10.00/10<<<OUTPUT ENDS>>>(executable check - success) ruff(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''ruff'' --version']<<<OUTPUT STARTS>>>ruff 0.11.4<<<OUTPUT ENDS>>>(finished - exit code 0) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''ruff'' check -q --no-fix --output-format json-lines --stdin-filename ''/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py'' - < ''/tmp/v0uunvM/3/intersec-connector.py''']<<<NO OUTPUT RETURNED>>>(finished - exit code 1) ['/bin/bash', '-c', 'cd ''/home/bree/dev/2024-dev-mmsx'' && ''flake8'' --format=default --stdin-display-name ''/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py'' - < ''/tmp/v0uunvM/4/intersec-connector.py''']<<<OUTPUT STARTS>>>/home/bree/dev/2024-dev-mmsx/geosafe-ea/intersec-connector.py:69:31: E261 at least two spaces before inline comment<<<OUTPUT ENDS>>>
You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Labels
None yet
3 participants
@robbytables@hsanson@Raoul555

[8]ページ先頭

©2009-2025 Movatter.jp