@@ -81,6 +81,7 @@ Contents ~
8181 1. Diagnostic Highlighting Groups | youcompleteme-diagnostic-highlighting-groups |
8282 15. Symbol Search | youcompleteme-symbol-search |
8383 1. Closing the popup | youcompleteme-closing-popup |
84+ 16. Type/Call Hierarchy | youcompleteme-type-call-hierarchy |
8485 7. Commands | youcompleteme-commands |
8586 1. The | :YcmRestartServer | command
8687 2. The | :YcmForceCompileAndDiagnostics | command
@@ -280,6 +281,7 @@ Contents ~
280281 - Diagnostic Highlighting Groups
281282
282283 - Symbol Search
284+ - Type/Call Hierarchy
283285
284286- Commands
285287
@@ -892,6 +894,8 @@ C-family languages (C, C++, Objective C, Objective C++, CUDA) ~
892894- Code formatting (| Format | )
893895- Semantic highlighting
894896- Inlay hints
897+ - Type hierarchy
898+ - Call hierarchy
895899
896900-------------------------------------------------------------------------------
897901 *youcompleteme-c*
941945- Type information for identifiers (| GetType | )
942946- Code formatting (| Format | )
943947- Management of 'gopls' server instance
948+ - Inlay hints
949+ - Call hierarchy
944950
945951-------------------------------------------------------------------------------
946952 *youcompleteme-javascript-typescript*
@@ -964,6 +970,7 @@ JavaScript and TypeScript ~
964970- Organize imports (| OrganizeImports | )
965971- Management of 'TSServer' server instance
966972- Inlay hints
973+ - Call hierarchy
967974
968975-------------------------------------------------------------------------------
969976 *youcompleteme-rust*
@@ -984,6 +991,7 @@ Rust ~
984991- Management of 'rust-analyzer' server instance
985992- Semantic highlighting
986993- Inlay hints
994+ - Call hierarchy
987995
988996-------------------------------------------------------------------------------
989997 *youcompleteme-java*
@@ -1009,6 +1017,9 @@ Java ~
10091017- Execute custom server command ('ExecuteCommand <args> ')
10101018- Management of 'jdt.ls' server instance
10111019- Semantic highlighting
1020+ - Inlay hints
1021+ - Type hierarchy
1022+ - Call hierarchy
10121023
10131024-------------------------------------------------------------------------------
10141025 *youcompleteme-user-guide*
@@ -1126,10 +1137,6 @@ Ctrl-l is not a suggestion, just an example.
11261137 *youcompleteme-semantic-highlighting*
11271138Semantic highlighting ~
11281139
1129- **NOTE**: This feature is highly experimental and offered in the hope that it
1130- is useful. It shall not be considered stable; if you find issues with it, feel
1131- free to report them, however.
1132-
11331140Semantic highlighting is the process where the buffer text is coloured
11341141according to the underlying semantic type of the word, rather than classic
11351142syntax highlighting based on regular expressions. This can be powerful
@@ -2137,6 +2144,60 @@ Closing the popup ~
21372144for that, or use a window command (e.g. '<Ctrl-w> j') or the mouse to leave the
21382145prompt buffer window.
21392146
2147+ -------------------------------------------------------------------------------
2148+ *youcompleteme-type-call-hierarchy*
2149+ Type/Call Hierarchy ~
2150+
2151+ **_This feature requires Vim and is not supported in Neovim_**
2152+
2153+ **NOTE**: This feature is highly experimental and offered in the hope that it
2154+ is useful. Please help us by reporting issues and offering feedback.
2155+
2156+ YCM provides a way to view and navigate hierarchies. The following hierarchies
2157+ are supported:
2158+
2159+ - Type hierachy '<Plug> (YCMTypeHierarchy)': Display subtypes and supertypes
2160+ of the symbol under cursor. Expand down to subtypes and up to supertypes.
2161+
2162+ - Call hierarchy '<Plug> (YCMCallHierarchy)': Display callees and callers of
2163+ the symbol under cursor. Expand down to callers and up to callees.
2164+
2165+ Take a look at this Image: asciicast [85] for brief demo.
2166+
2167+ Hierarchy UI can be initiated by mapping something to the indicated plug
2168+ mappings, for example:
2169+ >
2170+ nmap <leader>yth <Plug>(YCMTypeHierarchy)
2171+ nmap <leader>ych <Plug>(YCMCallHierarchy)
2172+ <
2173+ This opens a "modal" popup showing the current element in the hierarchy tree.
2174+ The current tree root is aligned to the left and child and parent nodes are
2175+ expanded to the right. Expand the tree "down" with '<Tab> and "up" with'`.
2176+
2177+ The "root" of the tree can be re-focused to the selected item with '<S-Tab> '
2178+ and further '<S-Tab> ' will show the parents of the selected item. This can take
2179+ a little getting used to, but it's particularly important with multiple
2180+ inheritance where a "child" of the current root may actually have other,
2181+ invisible, parent links. '<S-Tab> ' on that row will show these by setting the
2182+ display root to the selected item.
2183+
2184+ When the hierarchy is displayed, the following keys are intercepted:
2185+
2186+ - '<Tab> ': Drill into the hierarchy at the selected item: expand and show
2187+ children of the selected item.
2188+ - '<S-Tab> ': Show parents of the selected item. When applied to sub-types,
2189+ this will re-root the tree at that type, so that all parent types (are
2190+ displayed). Similar for callers.
2191+ - '<CR> ': Jump to the symbol currently selected.
2192+ - '<Down> ', '<C-n> ', '<C-j> ', 'j': Select the next item
2193+ - '<Up> ', '<C-p> ', '<C-k> ', 'k'; Select the previous item
2194+ - Any other key: closes the popup without jumping to any location
2195+
2196+ **Note:** you might think the call hierarchy tree is inverted, but we think
2197+ this way round is more intuitive because this is the typical way that call
2198+ stacks are displayed (with the current function at the top, and its callers
2199+ below).
2200+
21402201-------------------------------------------------------------------------------
21412202 *youcompleteme-commands*
21422203Commands ~
@@ -2380,6 +2441,9 @@ Supported in filetypes: 'c, cpp, objc, objcpp, cuda, go, java, rust'
23802441-------------------------------------------------------------------------------
23812442The *GoToCallers* and 'GoToCallees' subcommands
23822443
2444+ Note: A much more powerful call and type hierarchy can be viewd interactively.
2445+ See interactive type and call hierarchy.
2446+
23832447Populate the quickfix list with the callers, or callees respectively, of the
23842448function associated with the current cursor position. The semantics of this
23852449differ depending on the filetype and language server.
@@ -2526,7 +2590,7 @@ such as missing trailing semi-colons, spurious characters, or other errors
25262590which the semantic engine can deterministically suggest corrections. A small
25272591demo presenting how diagnostics can be fixed with clangd:
25282592
2529- Image: YcmCompleter-FixIt-OnDiagnostic (see reference [85 ] )
2593+ Image: YcmCompleter-FixIt-OnDiagnostic (see reference [87 ] )
25302594
25312595Completers (LSPs) may also provide refactoring tweaks, which may be available
25322596even when no diagnostic is presented for the current line. These include
@@ -2535,7 +2599,7 @@ generation, ... The tweaks work for a selection as well. Consult your LSP for
25352599available refactorings. A demonstration of refactoring capabilities with
25362600clangd:
25372601
2538- Image: YouCompleter-FixIt-Refactoring (see reference [86 ] )
2602+ Image: YouCompleter-FixIt-Refactoring (see reference [88 ] )
25392603
25402604If no fix-it is available for the current line, or there is no diagnostic on
25412605the current line, this command has no effect on the current buffer. If any
@@ -2581,7 +2645,7 @@ The following additional commands are supported for Python:
25812645- 'RefactorExtractVariable'
25822646- 'RefactorExtractFunction'
25832647
2584- See the jedi docs [87 ] for what they do.
2648+ See the jedi docs [89 ] for what they do.
25852649
25862650Supported in filetypes: 'python'
25872651
@@ -2656,7 +2720,7 @@ server-specific commands. Consult the jdt.ls [17] documentation to find out
26562720what commands are supported and which arguments are expected.
26572721
26582722The support for 'ExecuteCommand' was implemented to support plugins like
2659- Vimspector [88 ] to debug java, but isn't limited to that specific use case.
2723+ Vimspector [90 ] to debug java, but isn't limited to that specific use case.
26602724
26612725-------------------------------------------------------------------------------
26622726The *RestartServer* subcommand
@@ -2692,7 +2756,7 @@ For example:
26922756 call youcompleteme#GetErrorCount()
26932757<
26942758Both this function and | youcompleteme#GetWarningCount | can be useful when
2695- integrating YCM with other Vim plugins. For example, a lightline [89 ] user
2759+ integrating YCM with other Vim plugins. For example, a lightline [91 ] user
26962760could add a diagnostics section to their statusline which would display the
26972761number of errors and warnings.
26982762
@@ -3193,9 +3257,9 @@ string 'virtual-text', and the diagnostic will be displayed inline with the
31933257text, right aligned in the window and wrapping to the next line if there is not
31943258enough space, for example:
31953259
3196- Image: Virtual text diagnostic demo (see reference [90 ] )
3260+ Image: Virtual text diagnostic demo (see reference [92 ] )
31973261
3198- Image: Virtual text diagnostic demo (see reference [91 ] )
3262+ Image: Virtual text diagnostic demo (see reference [93 ] )
31993263
32003264**NOTE**: It's _strongly_ recommended to also set
32013265| g:ycm_update_diagnostics_in_insert_mode | to '0' when using 'virtual-text' for
@@ -3303,15 +3367,15 @@ YCM will not render it.
33033367
33043368The following filter types are supported:
33053369
3306- - "regex": Accepts a string regular expression [92 ] . This type matches when
3370+ - "regex": Accepts a string regular expression [94 ] . This type matches when
33073371 the regex (treated as case-insensitive) is found anywhere in the diagnostic
33083372 text ('re.search', not 're.match')
33093373
33103374- "level": Accepts a string level, either "warning" or "error." This type
33113375 matches when the diagnostic has the same level, that is, specifying 'level:
33123376 "error"' will remove **all** errors from the diagnostics.
33133377
3314- **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [92 ] .
3378+ **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [94 ] .
33153379
33163380Default: '{}'
33173381
@@ -3406,7 +3470,7 @@ from the 'tagfiles()' Vim function which examines the 'tags' Vim option. See
34063470
34073471YCM will re-index your tags files if it detects that they have been modified.
34083472
3409- The only supported tag format is the Exuberant Ctags format [93 ] . The format
3473+ The only supported tag format is the Exuberant Ctags format [95 ] . The format
34103474from "plain" ctags is NOT supported. Ctags needs to be called with the
34113475'--fields=+l' option (that's a lowercase 'L', not a one) because YCM needs the
34123476'language:<lang> ' field in the tags output.
@@ -3810,7 +3874,7 @@ It's also possible to use a regular expression as a trigger. You have to prefix
38103874your trigger with 're!' to signify it's a regex trigger. For instance,
38113875're!\w+\.' would only trigger after the '\w+\.' regex matches.
38123876
3813- **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [92 ] .
3877+ **NOTE:** The regex syntax is **NOT** Vim's, it's Python's [94 ] .
38143878
38153879Default: '[see next line]'
38163880>
@@ -3960,9 +4024,7 @@ Default: '[]'
39604024The *g:ycm_disable_signature_help* option
39614025
39624026This option allows you to disable all signature help for all completion
3963- engines. There is no way to disable it per-completer. This option is
3964- _reserved_, meaning that while signature help support remains experimental, its
3965- values and meaning may change and it may be removed in a future version.
4027+ engines. There is no way to disable it per-completer.
39664028
39674029Default: '0'
39684030>
@@ -4056,17 +4118,17 @@ The FAQ section has been moved to the wiki [8].
40564118Contributor Code of Conduct ~
40574119
40584120Please note that this project is released with a Contributor Code of Conduct
4059- [94 ]. By participating in this project you agree to abide by its terms.
4121+ [96 ]. By participating in this project you agree to abide by its terms.
40604122
40614123-------------------------------------------------------------------------------
40624124 *youcompleteme-contact*
40634125Contact ~
40644126
40654127If you have questions about the plugin or need help, please join the Gitter
4066- room [1] or use the ycm-users [95 ] mailing list.
4128+ room [1] or use the ycm-users [97 ] mailing list.
40674129
40684130If you have bug reports or feature suggestions, please use the issue tracker
4069- [96 ]. Before you do, please carefully read CONTRIBUTING.md [97 ] as this asks
4131+ [98 ]. Before you do, please carefully read CONTRIBUTING.md [99 ] as this asks
40704132for important diagnostics which the team will use to help get you going.
40714133
40724134The latest version of the plugin is available at
@@ -4081,7 +4143,7 @@ contact the YouCompleteMe maintainers directly using the contact details.
40814143 *youcompleteme-license*
40824144License ~
40834145
4084- This software is licensed under the GPL v3 license [98 ] . © 2015-2018
4146+ This software is licensed under the GPL v3 license [100 ] . © 2015-2018
40854147YouCompleteMe contributors
40864148
40874149-------------------------------------------------------------------------------
@@ -4092,10 +4154,10 @@ If you like YCM so much that you're willing to part with your hard-earned cash,
40924154please consider donating to one of the following charities, which are
40934155meaningful to the current maintainers (in no particular order):
40944156
4095- - Hector's Greyhound Rescue [99 ]
4096- - Be Humane [100 ]
4097- - Cancer Research UK [101 ]
4098- - ICCF Holland [102 ]
4157+ - Hector's Greyhound Rescue [101 ]
4158+ - Be Humane [102 ]
4159+ - Cancer Research UK [103 ]
4160+ - ICCF Holland [104 ]
40994161- Any charity of your choosing.
41004162
41014163Please note: The YCM maintainers do not specifically endorse nor necessarily
@@ -4190,23 +4252,25 @@ References ~
41904252[82] https://github.com/Valloric/ListToggle
41914253[83] https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C
41924254[84] https://asciinema.org/a/4JmYLAaz5hOHbZDD0hbsQpY8C.svg
4193- [85] https://user-images.githubusercontent.com/17928698/206855014-9131a49b-87e8-4ed4-8d91-f2fe7808a0b9.gif
4194- [86] https://user-images.githubusercontent.com/17928698/206855713-3588c8de-d0f5-4725-b65e-bc51110252cc.gif
4195- [87] https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.extract_variable
4196- [88] https://github.com/puremourning/vimspector
4197- [89] https://github.com/itchyny/lightline.vim
4198- [90] https://user-images.githubusercontent.com/10584846/185707973-39703699-0263-47d3-82ac-639d52259bea.png
4199- [91] https://user-images.githubusercontent.com/10584846/185707993-14ff5fd7-c082-4e5a-b825-f1364e619b6a.png
4200- [92] https://docs.python.org/2/library/re.html#regular-expression-syntax
4201- [93] http://ctags.sourceforge.net/FORMAT
4202- [94] https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
4203- [95] https://groups.google.com/forum/?hl=en#!forum/ycm-users
4204- [96] https://github.com/ycm-core/YouCompleteMe/issues?state=open
4205- [97] https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md
4206- [98] https://www.gnu.org/copyleft/gpl.html
4207- [99] https://www.hectorsgreyhoundrescue.org
4208- [100] https://www.budihuman.rs/en
4209- [101] https://www.cancerresearchuk.org
4210- [102] https://iccf.nl
4255+ [85] https://asciinema.org/a/659925
4256+ [86] https://asciinema.org/a/659925.svg
4257+ [87] https://user-images.githubusercontent.com/17928698/206855014-9131a49b-87e8-4ed4-8d91-f2fe7808a0b9.gif
4258+ [88] https://user-images.githubusercontent.com/17928698/206855713-3588c8de-d0f5-4725-b65e-bc51110252cc.gif
4259+ [89] https://jedi.readthedocs.io/en/latest/docs/api.html#jedi.Script.extract_variable
4260+ [90] https://github.com/puremourning/vimspector
4261+ [91] https://github.com/itchyny/lightline.vim
4262+ [92] https://user-images.githubusercontent.com/10584846/185707973-39703699-0263-47d3-82ac-639d52259bea.png
4263+ [93] https://user-images.githubusercontent.com/10584846/185707993-14ff5fd7-c082-4e5a-b825-f1364e619b6a.png
4264+ [94] https://docs.python.org/2/library/re.html#regular-expression-syntax
4265+ [95] http://ctags.sourceforge.net/FORMAT
4266+ [96] https://github.com/ycm-core/YouCompleteMe/blob/master/CODE_OF_CONDUCT.md
4267+ [97] https://groups.google.com/forum/?hl=en#!forum/ycm-users
4268+ [98] https://github.com/ycm-core/YouCompleteMe/issues?state=open
4269+ [99] https://github.com/ycm-core/YouCompleteMe/blob/master/CONTRIBUTING.md
4270+ [100] https://www.gnu.org/copyleft/gpl.html
4271+ [101] https://www.hectorsgreyhoundrescue.org
4272+ [102] https://www.budihuman.rs/en
4273+ [103] https://www.cancerresearchuk.org
4274+ [104] https://iccf.nl
42114275
42124276vim: ft=help
0 commit comments