feat(refactor.navigation): allow a fallback_function for goto_definition

`fallback_function` is called when nvim-treesitter can not resolve the
variable under the cursor.
This commit is contained in:
Stephan Seitz 2020-08-29 11:37:26 +02:00 committed by Thomas Vigouroux
parent 6352cdc943
commit bc36521967
3 changed files with 19 additions and 7 deletions

View file

@ -244,6 +244,11 @@ Supported options:
- keymaps:
- goto_definition: go to the definition of the symbol under the cursor.
Defaults to `gnd`.
- goto_definition_lsp_fallback: go to the definition of the symbol under
the cursor or use vim.lsp.buf.definition if the symbol can not be
resolved. You can use your own fallback function if create a mapping for
`lua require'nvim-treesitter.refactor.navigation(nil, fallback_function)<cr>` .
No default mapping
- list_definitions: list all definitions from the current file.
Defaults to `gnD`.
- goto_next_usage: go to next usage of identifier under the cursor.