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

[Feature request] Asynchronous GoToReferences #4112

Open
6 tasks
zeminzhou opened this issue Jan 5, 2023 · 1 comment
Open
6 tasks

[Feature request] Asynchronous GoToReferences #4112

zeminzhou opened this issue Jan 5, 2023 · 1 comment
Labels
enhancement PR Welcome A good quality PR for this feature would be considered.

Comments

@zeminzhou
Copy link

zeminzhou commented Jan 5, 2023

Issue Prelude

Please complete these steps and check these boxes (by putting an x inside
the brackets) before filing your issue:

  • I have read and understood YCM's CONTRIBUTING document.
  • I have read and understood YCM's CODE_OF_CONDUCT document.
  • I have read and understood YCM's README, especially the
    Frequently Asked Questions section.
  • I have searched YCM's issue tracker to find issues similar to the one I'm
    about to report and couldn't find an answer to my problem. (Example Google
    search.
    )
  • If filing a bug report, I have included the output of vim --version.
  • If filing a bug report, I have included the output of :YcmDebugInfo.
  • If filing a bug report, I have attached the contents of the logfiles using
    the :YcmToggleLogs command.
  • If filing a bug report, I have included which OS (including specific OS
    version) I am using.
  • If filing a bug report, I have included a minimal test case that reproduces
    my issue, using vim -Nu /path/to/YCM/vimrc_ycm_minimal, including what I
    expected to happen and what actually happened.
  • If filing a installation failure report, I have included the entire output
    of install.py (or cmake/make/ninja) including its invocation
  • I understand this is an open-source project staffed by volunteers and
    that any help I receive is a selfless, heartfelt gift of their free time. I
    know I am not entitled to anything and will be polite and courteous.
  • I understand my issue may be closed if it becomes obvious I didn't
    actually perform all of these steps.

Thank you for adhering to this process! It ensures your issue is resolved
quickly and that neither your nor our time is needlessly wasted.

Issue Details

Provide a clear description of the problem, including the following key
questions:

  • What did you do?
    Generally, vim stuck for a while when I call GoToReferences in go project(because the project is large).
    So I want to know if there is a way to make vim not stuck for a while (meaning I can still move the cursor) when I call GoToReferences.
    Thanks!

Include steps to reproduce here.

  1. vim -Nu /path/to/YCM/ycm_vimrc_minimal
  2. :edit test.py
  3. Enter insert mode and type .....

Include description of a minimal test case, including any actual code required
to reproduce the issue.

If you made changes to vimrc_ycm_minimal, pase them here:

" YCM
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_enable_inlay_hints = 0
let g:ycm_update_diagnostics_in_insert_mode = 1
let g:ycm_show_detailed_diag_in_popup = 1
let g:ycm_global_ycm_extra_conf = '/root/.ycm_extra_conf.py'
let g:ycm_autoclose_preview_window_after_completion = 1
let g:ycm_show_diagnostics_ui = 1
let g:ycm_error_symbol = 'xx'
let g:ycm_warning_symbol = '>>'
let g:ycm_collect_identifiers_from_tags_files = 1
let g:ycm_key_detailed_diagnostics = '<leader>ym'
let g:ycm_add_preview_to_completeopt = 'popup'
let g:ycm_enable_semantic_highlighting = 1
let g:ycm_seed_identifiers_with_syntax=0
let g:ycm_complete_in_comments=1
let g:ycm_complete_in_strings=1
nnoremap <leader>yw <Plug>(YCMFindSymbolInWorkspace)
nnoremap <silent> <leader>yc :YcmCompleter GoToDeclaration<CR>
nnoremap <silent> <leader>yd :YcmCompleter GoToDefinition<CR>
nnoremap <silent> <leader>ys :YcmCompleter GoToSymbol <C-R><C-W><CR>
nnoremap <silent> <leader>yi :YcmCompleter GoToImplementation<CR>
nnoremap <silent> <leader>yr :YcmCompleter GoToReferences<CR>
nnoremap <silent> <leader>yf :YcmCompleter GoToInclude<CR>
nnoremap <silent> <leader>ye :YcmDiags<CR>
nnoremap <silent> <leader>yt :let g:ycm_auto_trigger = g:ycm_auto_trigger == 1 ? 0 : 1<CR>
let g:ycm_language_server =
  \ [
  \   {
  \     'name': 'rust',
  \     'cmdline': [ '/Users/zzm/.local/bin/rust-analyzer' ],
  \     'filetypes': [ 'rust' ],
  \     'project_root_files': [ 'Cargo.toml' ]
  \   },
  \   {
  \     'name': 'go',
  \     'cmdline': [ '/Users/zzm/go/bin/gopls' ],
  \     'filetypes': [ 'go' ],
  \     'project_root_files': [ 'go.mod' ]
  \   },
  \ ]
  • What did you expect to happen?

Include description of the expected behaviour.

  • What actually happened?

Include description of the observed behaviour, including actual output,
screenshots, etc.

Diagnostic data

Output of vim --version

VIM - Vi IMproved 9.0 (2022 Jun 28, compiled Oct 08 2022 18:26:41)
macOS version - arm64
Included patches: 1-700
Compiled by Homebrew

Output of YcmDebugInfo

Paste output here

Output of YcmDiags

Paste output here

Output of git rev-parse HEAD in YouCompleteMe installation directory

paste output here

Contents of YCM, ycmd and completion engine logfiles

Reproduce the issue with vim -Nu /path/to/YCM/vimrc_ycm_minimal, which
enabled debug logging and other useful diagnostics. Include a link to a
gist containing all of the log files listed by :YcmToggleLogs.

OS version, distribution, etc.

Include system information here.

Output of build/install commands

Include link to a gist containing the invocation and entire output of
install.py if reporting an installation issue.

@puremourning puremourning changed the title vim stuck for a while when I call GoToReferences in go project [Feature request] Asynchronous GoToReferences Jan 5, 2023
@puremourning puremourning added enhancement PR Welcome A good quality PR for this feature would be considered. labels Jan 5, 2023
@bstaletic
Copy link
Collaborator

Needs more testing, but I have this implemented here: https://github.com/bstaletic/YouCompleteMe/tree/async-commands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement PR Welcome A good quality PR for this feature would be considered.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants