Skip to content

support gotoCmd for workspace/symbol #704

Open
@timbertson

Description

@timbertson

Describe the bug

The gotoCmd option is respected by textDocument_definition, but not workspace_symbol (it always replaces the current document).

From looking at the source, it looks like a few similar functions delegate to find_locations which seems to be the only place gotoCmd is used, but workspace_symbol does things a bit differently, so it might need explicit support for gotoCmd.

Environment

  • neovim/vim version (nvim --version or vim --version): nvim 0.3.1
  • This plugin version (git rev-parse --short HEAD): unknown (version 2018-09-07 from nixpkgs)
  • This plugin's binary version (bin/languageclient --version): languageclient 0.1.119
  • Minimal vimrc content (A minimal vimrc is the smallest vimrc that could
    reproduce the issue. Refer to an example [here][min-vimrc.vim]):
let g:my_languageclient_select_opts = {
	\ 'gotoCmd': 'split',
	\ }
nmap <leader>d :call LanguageClient#textDocument_definition(g:my_languageclient_select_opts)<cr>
nmap <leader>t :call LanguageClient#workspace_symbol("", g:my_languageclient_select_opts)<cr>

To Reproduce

  1. open a supported filetype
  2. press <leader>t
  3. select a symbol from a different file

Current behavior

The current window is used to show the symbol

Expected behavior

The new symbol should appear in a split screen

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions