Add docs for RefactorRename
Additionally, we restructure subcommands section to organise by command type. There are now a significant number of subcommands offering quite powerful features. A flat-list of such commands is not easy for users to discover (citation needed). Restructured into: - GoTo commands - Documenation/type information commands - FixIt/refactor commands This has the following benefits: - features are more discoverable to the user (due to contents page update) - more obvious where to add new subcommand documentation - a place to write notes which apply to multiple commands (such as jump lists, multi-file refactor)
This commit is contained in:
parent
24f1f9c900
commit
e8de632b90
201
README.md
201
README.md
@ -28,6 +28,9 @@ YouCompleteMe: a code-completion engine for Vim
|
|||||||
- [Diagnostic highlighting groups](#diagnostic-highlighting-groups)
|
- [Diagnostic highlighting groups](#diagnostic-highlighting-groups)
|
||||||
- [Commands](#commands)
|
- [Commands](#commands)
|
||||||
- [YcmCompleter subcommands](#ycmcompleter-subcommands)
|
- [YcmCompleter subcommands](#ycmcompleter-subcommands)
|
||||||
|
- [Go to declaration/definition/etc. commands](#goto-commands)
|
||||||
|
- [Semantic type information and documentation](#semantic-information-commands)
|
||||||
|
- [Refactoring and FixIt commands](#refactoring-and-fixit-commands)
|
||||||
- [Options](#options)
|
- [Options](#options)
|
||||||
- [FAQ](#faq)
|
- [FAQ](#faq)
|
||||||
- [Contributor Code of Conduct](#contributor-code-of-conduct)
|
- [Contributor Code of Conduct](#contributor-code-of-conduct)
|
||||||
@ -104,9 +107,21 @@ features plus extra:
|
|||||||
- Supertab
|
- Supertab
|
||||||
- neocomplcache
|
- neocomplcache
|
||||||
|
|
||||||
YCM also provides semantic go-to-definition/declaration commands for C-family
|
### And that's not all...
|
||||||
languages & Python. Expect more IDE features powered by the various YCM semantic
|
|
||||||
engines in the future.
|
YCM also provides [semantic IDE-like features](#quick-feature-summary) in a
|
||||||
|
number of languages, including:
|
||||||
|
|
||||||
|
- finding declarations, definitions, usages, etc. of identifiers,
|
||||||
|
- displaying type information for classes, variables, functions etc.,
|
||||||
|
- displaying documentation for methods, members, etc. in the preview window,
|
||||||
|
- fixing common coding errors, like missing semi-colons, typos, etc.,
|
||||||
|
- semantic renaming of variables across files (JavaScript only).
|
||||||
|
|
||||||
|
Features vary by file type, so make sure to check out the [file type feature
|
||||||
|
summary](#quick-feature-summary) and the
|
||||||
|
[full list of completer subcommands](#ycmcompleter-subcommands) to
|
||||||
|
find out what's available for your favourite languages.
|
||||||
|
|
||||||
You'll also find that YCM has filepath completers (try typing `./` in a file)
|
You'll also find that YCM has filepath completers (try typing `./` in a file)
|
||||||
and a completer that integrates with [UltiSnips][].
|
and a completer that integrates with [UltiSnips][].
|
||||||
@ -682,6 +697,7 @@ Quick Feature Summary
|
|||||||
### JavaScript
|
### JavaScript
|
||||||
|
|
||||||
* Intelligent auto-completion
|
* Intelligent auto-completion
|
||||||
|
* Renaming variables (`RefactorRename <new name>`)
|
||||||
* Go to definition, find references (`GoToDefinition`, `GoToReferences`)
|
* Go to definition, find references (`GoToDefinition`, `GoToReferences`)
|
||||||
* Type information for identifiers (`GetType`)
|
* Type information for identifiers (`GetType`)
|
||||||
* View documentation comments for identifiers (`GetDoc`)
|
* View documentation comments for identifiers (`GetDoc`)
|
||||||
@ -1106,20 +1122,25 @@ purpose.
|
|||||||
|
|
||||||
### The `:YcmCompleter` command
|
### The `:YcmCompleter` command
|
||||||
|
|
||||||
This command can be used to invoke completer-specific commands. If the first
|
This command gives access to a number of additional [IDE-like
|
||||||
|
features](#quick-feature-summary) in YCM, for things like semantic GoTo, type
|
||||||
|
information, FixIt and refactoring.
|
||||||
|
|
||||||
|
Technically the command invokes completer-specific commands. If the first
|
||||||
argument is of the form `ft=...` the completer for that file type will be used
|
argument is of the form `ft=...` the completer for that file type will be used
|
||||||
(for example `ft=cpp`), else the native completer of the current buffer will be
|
(for example `ft=cpp`), else the native completer of the current buffer will be
|
||||||
used.
|
used.
|
||||||
Call `YcmCompleter` without further arguments for information about the
|
Call `YcmCompleter` without further arguments for a list of the
|
||||||
commands you can call for the selected completer.
|
commands you can call for the current completer.
|
||||||
|
|
||||||
See the _YcmCompleter subcommands_ section for more information on the available
|
See the [file type feature summary](#quick-feature-summary) for an overview of
|
||||||
subcommands.
|
the features available for each file type. See the _YcmCompleter subcommands_
|
||||||
|
section for more information on the available subcommands and their usage.
|
||||||
|
|
||||||
YcmCompleter subcommands
|
YcmCompleter subcommands
|
||||||
------------------------
|
------------------------
|
||||||
|
|
||||||
[See the docs for the `YcmCompleter` command before tackling this section.]
|
NOTE: See the docs for the `YcmCompleter` command before tackling this section.
|
||||||
|
|
||||||
The invoked subcommand is automatically routed to the currently active semantic
|
The invoked subcommand is automatically routed to the currently active semantic
|
||||||
completer, so `:YcmCompleter GoToDefinition` will invoke the `GoToDefinition`
|
completer, so `:YcmCompleter GoToDefinition` will invoke the `GoToDefinition`
|
||||||
@ -1131,23 +1152,26 @@ You may also want to map the subcommands to something less verbose; for
|
|||||||
instance, `nnoremap <leader>jd :YcmCompleter GoTo<CR>`
|
instance, `nnoremap <leader>jd :YcmCompleter GoTo<CR>`
|
||||||
maps the `<leader>jd` sequence to the longer subcommand invocation.
|
maps the `<leader>jd` sequence to the longer subcommand invocation.
|
||||||
|
|
||||||
The various `GoTo*` subcommands add entries to Vim's `jumplist` so you can use
|
### GoTo commands
|
||||||
|
|
||||||
|
These commands are useful for jumping around and exploring code. When moving
|
||||||
|
the cursor, the subcommands add entries to Vim's `jumplist` so you can use
|
||||||
`CTRL-O` to jump back to where you where before invoking the command (and
|
`CTRL-O` to jump back to where you where before invoking the command (and
|
||||||
`CTRL-I` to jump forward; see `:h jumplist` for details).
|
`CTRL-I` to jump forward; see `:h jumplist` for details).
|
||||||
|
|
||||||
### The `GoToInclude` subcommand
|
#### The `GoToInclude` subcommand
|
||||||
|
|
||||||
Looks up the current line for a header and jumps to it.
|
Looks up the current line for a header and jumps to it.
|
||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp`
|
Supported in filetypes: `c, cpp, objc, objcpp`
|
||||||
|
|
||||||
### The `GoToDeclaration` subcommand
|
#### The `GoToDeclaration` subcommand
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its declaration.
|
Looks up the symbol under the cursor and jumps to its declaration.
|
||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, python, rust`
|
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, python, rust`
|
||||||
|
|
||||||
### The `GoToDefinition` subcommand
|
#### The `GoToDefinition` subcommand
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its definition.
|
Looks up the symbol under the cursor and jumps to its definition.
|
||||||
|
|
||||||
@ -1159,7 +1183,7 @@ with `#include` directives (directly or indirectly) in that file.
|
|||||||
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python,
|
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python,
|
||||||
rust, typescript`
|
rust, typescript`
|
||||||
|
|
||||||
### The `GoTo` subcommand
|
#### The `GoTo` subcommand
|
||||||
|
|
||||||
This command tries to perform the "most sensible" GoTo operation it can.
|
This command tries to perform the "most sensible" GoTo operation it can.
|
||||||
Currently, this means that it tries to look up the symbol under the cursor and
|
Currently, this means that it tries to look up the symbol under the cursor and
|
||||||
@ -1170,7 +1194,7 @@ jump to it. For C#, implementations are also considered and preferred.
|
|||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python, rust`
|
Supported in filetypes: `c, cpp, objc, objcpp, cs, go, javascript, python, rust`
|
||||||
|
|
||||||
### The `GoToImprecise` subcommand
|
#### The `GoToImprecise` subcommand
|
||||||
|
|
||||||
WARNING: This command trades correctness for speed!
|
WARNING: This command trades correctness for speed!
|
||||||
|
|
||||||
@ -1183,7 +1207,7 @@ latency.
|
|||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp`
|
Supported in filetypes: `c, cpp, objc, objcpp`
|
||||||
|
|
||||||
### The `GoToReferences` subcommand
|
#### The `GoToReferences` subcommand
|
||||||
|
|
||||||
This command attempts to find all of the references within the project to the
|
This command attempts to find all of the references within the project to the
|
||||||
identifier under the cursor and populates the quickfix list with those
|
identifier under the cursor and populates the quickfix list with those
|
||||||
@ -1191,19 +1215,28 @@ locations.
|
|||||||
|
|
||||||
Supported in filetypes: `javascript, python, typescript`
|
Supported in filetypes: `javascript, python, typescript`
|
||||||
|
|
||||||
### The `ClearCompilationFlagCache` subcommand
|
#### The `GoToImplementation` subcommand
|
||||||
|
|
||||||
YCM caches the flags it gets from the `FlagsForFile` function in your
|
Looks up the symbol under the cursor and jumps to its implementation (i.e.
|
||||||
`ycm_extra_conf.py` file if you return them with the `do_cache` parameter set to
|
non-interface). If there are multiple implementations, instead provides a list
|
||||||
`True`. The cache is in memory and is never invalidated (unless you restart Vim
|
of implementations to choose from.
|
||||||
of course).
|
|
||||||
|
|
||||||
This command clears that cache entirely. YCM will then re-query your
|
Supported in filetypes: `cs`
|
||||||
`FlagsForFile` function as needed in the future.
|
|
||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp`
|
#### The `GoToImplementationElseDeclaration` subcommand
|
||||||
|
|
||||||
### The `GetType` subcommand
|
Looks up the symbol under the cursor and jumps to its implementation if one,
|
||||||
|
else jump to its declaration. If there are multiple implementations, instead
|
||||||
|
provides a list of implementations to choose from.
|
||||||
|
|
||||||
|
Supported in filetypes: `cs`
|
||||||
|
|
||||||
|
### Semantic information commands
|
||||||
|
|
||||||
|
These commands are useful for finding static information about the code, such
|
||||||
|
as the types of variables, viewing declarations and documentation strings.
|
||||||
|
|
||||||
|
#### The `GetType` subcommand
|
||||||
|
|
||||||
Echos the type of the variable or method under the cursor, and where it differs,
|
Echos the type of the variable or method under the cursor, and where it differs,
|
||||||
the derived type.
|
the derived type.
|
||||||
@ -1234,7 +1267,7 @@ NOTE: Causes re-parsing of the current translation unit.
|
|||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp, javascript, typescript`
|
Supported in filetypes: `c, cpp, objc, objcpp, javascript, typescript`
|
||||||
|
|
||||||
### The `GetParent` subcommand
|
#### The `GetParent` subcommand
|
||||||
|
|
||||||
Echos the semantic parent of the point under the cursor.
|
Echos the semantic parent of the point under the cursor.
|
||||||
|
|
||||||
@ -1265,7 +1298,26 @@ NOTE: Causes re-parsing of the current translation unit.
|
|||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp`
|
Supported in filetypes: `c, cpp, objc, objcpp`
|
||||||
|
|
||||||
### The `FixIt` subcommand
|
#### The `GetDoc` subcommand
|
||||||
|
|
||||||
|
Displays the preview window populated with quick info about the identifier
|
||||||
|
under the cursor. Depending on the file type, this includes things like:
|
||||||
|
|
||||||
|
* The type or declaration of identifier,
|
||||||
|
* Doxygen/javadoc comments,
|
||||||
|
* Python docstrings,
|
||||||
|
* etc.
|
||||||
|
|
||||||
|
Supported in filetypes: `c, cpp, objc, objcpp, cs, python, typescript,
|
||||||
|
javascript`
|
||||||
|
|
||||||
|
### Refactoring and FixIt commands
|
||||||
|
|
||||||
|
These commands make changes to your source code in order to perform refactoring
|
||||||
|
or code correction. YouCompleteMe does not perform any action which cannot be
|
||||||
|
undone, and never saves or writes files to the disk.
|
||||||
|
|
||||||
|
#### The `FixIt` subcommand
|
||||||
|
|
||||||
Where available, attempts to make changes to the buffer to correct the
|
Where available, attempts to make changes to the buffer to correct the
|
||||||
diagnostic closest to the cursor position.
|
diagnostic closest to the cursor position.
|
||||||
@ -1290,8 +1342,8 @@ indication).
|
|||||||
NOTE: Causes re-parsing of the current translation unit.
|
NOTE: Causes re-parsing of the current translation unit.
|
||||||
|
|
||||||
NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
|
NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
|
||||||
This is due to a technical restriction in vim, and moving the cursor, or issuing
|
This is due to a technical restriction in Vim. Moving the cursor, or issuing
|
||||||
the the `:YcmForceCompileAndDiagnostics` command will refresh the diagnostics.
|
the `:YcmForceCompileAndDiagnostics` command will refresh the diagnostics.
|
||||||
Repeated invocations of the `FixIt` command on a given line, however, _do_ apply
|
Repeated invocations of the `FixIt` command on a given line, however, _do_ apply
|
||||||
all diagnostics as expected without requiring refreshing of the diagnostics UI.
|
all diagnostics as expected without requiring refreshing of the diagnostics UI.
|
||||||
This is particularly useful where there are multiple diagnostics on one line, or
|
This is particularly useful where there are multiple diagnostics on one line, or
|
||||||
@ -1299,34 +1351,81 @@ where after fixing one diagnostic, another fix-it is available.
|
|||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp, cs`
|
Supported in filetypes: `c, cpp, objc, objcpp, cs`
|
||||||
|
|
||||||
### The `GetDoc` subcommand
|
#### The `RefactorRename <new name>` subcommand
|
||||||
|
|
||||||
Displays the preview window populated with quick info about the identifier
|
In supported file types, this command attempts to perform a semantic rename of
|
||||||
under the cursor. This includes, depending on the language, things like:
|
the identifier under the cursor. This includes renaming declarations,
|
||||||
|
definitions and usages of the identifier, or any other language-appropriate
|
||||||
|
action. The specific behavior is defined by the semantic engine in use.
|
||||||
|
|
||||||
* The type or declaration of identifier
|
Similar to `FixIt`, this command applies automatic modifications to your source
|
||||||
* Doxygen/javadoc comments
|
files. Rename operations may involve changes to multiple files, which may or may
|
||||||
* Python docstrings
|
not be open in Vim buffers at the time. YouCompleteMe handles all of this for
|
||||||
* etc.
|
you. The behavior is described in [the following section](#multi-file-refactor).
|
||||||
|
|
||||||
Supported in filetypes: `c, cpp, objc, objcpp, cs, python, typescript,
|
Supported in filetypes: `javascript` (variables only)
|
||||||
javascript`
|
|
||||||
|
|
||||||
### The `StartServer` subcommand
|
#### Multi-file Refactor
|
||||||
|
|
||||||
|
When a Refactor or FixIt command touches multiple files, YouCompleteMe attempts
|
||||||
|
to apply those modifications to any existing open, visible buffer in the current
|
||||||
|
tab. If no such buffer can be found, YouCompleteMe opens the file in a new
|
||||||
|
small horizontal split at the top of the current window, applies the change,
|
||||||
|
and then *hides* the window. NOTE: The buffer remains open, and must be
|
||||||
|
manually saved. A confirmation dialog is opened prior to doing this to remind
|
||||||
|
you that this is about to happen.
|
||||||
|
|
||||||
|
Once the modifications have been made, the quickfix list (see `:help quickfix`)
|
||||||
|
is opened and populated with the locations of all modifications. This can be
|
||||||
|
used to review all automatic changes made. Typically, use the `CTRL-W
|
||||||
|
<enter>` combination to open the selected file in a new split.
|
||||||
|
|
||||||
|
The buffers are *not* saved automatically. That is, you must save the modified
|
||||||
|
buffers manually after reviewing the changes from the quickfix list. Changes
|
||||||
|
can be undone using Vim's powerful undo features (see `:help undo`). Note
|
||||||
|
that Vim's undo is per-buffer, so to undo all changes, the undo commands must
|
||||||
|
be applied in each modified buffer separately.
|
||||||
|
|
||||||
|
NOTE: While applying modifications, Vim may find files which are already open
|
||||||
|
and have a swap file. The command is aborted if you select Abort or Quit in any
|
||||||
|
such prompts. This leaves the Refactor operation partially complete and must be
|
||||||
|
manually corrected using Vim's undo features. The quickfix list is *not*
|
||||||
|
populated in this case. Inspect `:buffers` or equivalent (see `:help buffers`)
|
||||||
|
to see the buffers that were opened by the command.
|
||||||
|
|
||||||
|
### Miscellaneous commands
|
||||||
|
|
||||||
|
These commands are for general administration, rather than IDE-like features.
|
||||||
|
They cover things like the semantic engine server instance and compilation
|
||||||
|
flags.
|
||||||
|
|
||||||
|
#### The `ClearCompilationFlagCache` subcommand
|
||||||
|
|
||||||
|
YCM caches the flags it gets from the `FlagsForFile` function in your
|
||||||
|
`ycm_extra_conf.py` file if you return them with the `do_cache` parameter set to
|
||||||
|
`True`. The cache is in memory and is never invalidated (unless you restart Vim
|
||||||
|
of course).
|
||||||
|
|
||||||
|
This command clears that cache entirely. YCM will then re-query your
|
||||||
|
`FlagsForFile` function as needed in the future.
|
||||||
|
|
||||||
|
Supported in filetypes: `c, cpp, objc, objcpp`
|
||||||
|
|
||||||
|
#### The `StartServer` subcommand
|
||||||
|
|
||||||
Starts the semantic-engine-as-localhost-server for those semantic engines that
|
Starts the semantic-engine-as-localhost-server for those semantic engines that
|
||||||
work as separate servers that YCM talks to.
|
work as separate servers that YCM talks to.
|
||||||
|
|
||||||
Supported in filetypes: `cs, go, javascript, rust`
|
Supported in filetypes: `cs, go, javascript, rust`
|
||||||
|
|
||||||
### The `StopServer` subcommand
|
#### The `StopServer` subcommand
|
||||||
|
|
||||||
Stops the semantic-engine-as-localhost-server for those semantic engines that
|
Stops the semantic-engine-as-localhost-server for those semantic engines that
|
||||||
work as separate servers that YCM talks to.
|
work as separate servers that YCM talks to.
|
||||||
|
|
||||||
Supported in filetypes: `cs, go, javascript, rust`
|
Supported in filetypes: `cs, go, javascript, rust`
|
||||||
|
|
||||||
### The `RestartServer` subcommand
|
#### The `RestartServer` subcommand
|
||||||
|
|
||||||
Restarts the semantic-engine-as-localhost-server for those semantic engines that
|
Restarts the semantic-engine-as-localhost-server for those semantic engines that
|
||||||
work as separate servers that YCM talks to.
|
work as separate servers that YCM talks to.
|
||||||
@ -1340,7 +1439,7 @@ python binary to use to restart the Python semantic engine.
|
|||||||
|
|
||||||
Supported in filetypes: `cs, python, rust`
|
Supported in filetypes: `cs, python, rust`
|
||||||
|
|
||||||
### The `ReloadSolution` subcommand
|
#### The `ReloadSolution` subcommand
|
||||||
|
|
||||||
Instruct the Omnisharp server to clear its cache and reload all files from disk.
|
Instruct the Omnisharp server to clear its cache and reload all files from disk.
|
||||||
This is useful when files are added, removed, or renamed in the solution, files
|
This is useful when files are added, removed, or renamed in the solution, files
|
||||||
@ -1348,22 +1447,6 @@ are changed outside of Vim, or whenever Omnisharp cache is out-of-sync.
|
|||||||
|
|
||||||
Supported in filetypes: `cs`
|
Supported in filetypes: `cs`
|
||||||
|
|
||||||
### The `GoToImplementation` subcommand
|
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its implementation (i.e.
|
|
||||||
non-interface). If there are multiple implementations, instead provides a list
|
|
||||||
of implementations to choose from.
|
|
||||||
|
|
||||||
Supported in filetypes: `cs`
|
|
||||||
|
|
||||||
### The `GoToImplementationElseDeclaration` subcommand
|
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its implementation if one,
|
|
||||||
else jump to its declaration. If there are multiple implementations, instead
|
|
||||||
provides a list of implementations to choose from.
|
|
||||||
|
|
||||||
Supported in filetypes: `cs`
|
|
||||||
|
|
||||||
Functions
|
Functions
|
||||||
--------
|
--------
|
||||||
|
|
||||||
@ -1896,7 +1979,7 @@ let g:ycm_csharp_server_port = 0
|
|||||||
By default, when YCM inserts a namespace, it will insert the `using` statement
|
By default, when YCM inserts a namespace, it will insert the `using` statement
|
||||||
under the nearest `using` statement. You may prefer that the `using` statement is
|
under the nearest `using` statement. You may prefer that the `using` statement is
|
||||||
inserted somewhere, for example, to preserve sorting. If so, you can set this
|
inserted somewhere, for example, to preserve sorting. If so, you can set this
|
||||||
option to override this behaviour.
|
option to override this behavior.
|
||||||
|
|
||||||
When this option is set, instead of inserting the `using` statement itself, YCM
|
When this option is set, instead of inserting the `using` statement itself, YCM
|
||||||
will set the global variable `g:ycm_namespace_to_insert` to the namespace to
|
will set the global variable `g:ycm_namespace_to_insert` to the namespace to
|
||||||
|
@ -5,6 +5,7 @@ Contents ~
|
|||||||
|
|
||||||
1. Introduction |youcompleteme-introduction|
|
1. Introduction |youcompleteme-introduction|
|
||||||
2. Intro |youcompleteme-intro|
|
2. Intro |youcompleteme-intro|
|
||||||
|
1. And that's not all... |youcompleteme-thats-not-all...|
|
||||||
3. Installation |youcompleteme-installation|
|
3. Installation |youcompleteme-installation|
|
||||||
1. Mac OS X Installation |youcompleteme-mac-os-x-installation|
|
1. Mac OS X Installation |youcompleteme-mac-os-x-installation|
|
||||||
2. Ubuntu Linux x64 Installation |youcompleteme-ubuntu-linux-x64-installation|
|
2. Ubuntu Linux x64 Installation |youcompleteme-ubuntu-linux-x64-installation|
|
||||||
@ -48,23 +49,29 @@ Contents ~
|
|||||||
6. The |:YcmToggleLogs| command
|
6. The |:YcmToggleLogs| command
|
||||||
7. The |:YcmCompleter| command
|
7. The |:YcmCompleter| command
|
||||||
7. YcmCompleter subcommands |youcompleteme-ycmcompleter-subcommands|
|
7. YcmCompleter subcommands |youcompleteme-ycmcompleter-subcommands|
|
||||||
1. The |GoToInclude| subcommand
|
1. GoTo commands |youcompleteme-goto-commands|
|
||||||
2. The |GoToDeclaration| subcommand
|
1. The |GoToInclude| subcommand
|
||||||
3. The |GoToDefinition| subcommand
|
2. The |GoToDeclaration| subcommand
|
||||||
4. The |GoTo| subcommand
|
3. The |GoToDefinition| subcommand
|
||||||
5. The |GoToImprecise| subcommand
|
4. The |GoTo| subcommand
|
||||||
6. The |GoToReferences| subcommand
|
5. The |GoToImprecise| subcommand
|
||||||
7. The |ClearCompilationFlagCache| subcommand
|
6. The |GoToReferences| subcommand
|
||||||
8. The |GetType| subcommand
|
7. The |GoToImplementation| subcommand
|
||||||
9. The |GetParent| subcommand
|
8. The |GoToImplementationElseDeclaration| subcommand
|
||||||
10. The |FixIt| subcommand
|
2. Semantic information commands |youcompleteme-semantic-information-commands|
|
||||||
11. The |GetDoc| subcommand
|
1. The |GetType| subcommand
|
||||||
12. The |StartServer| subcommand
|
2. The |GetParent| subcommand
|
||||||
13. The |StopServer| subcommand
|
3. The |GetDoc| subcommand
|
||||||
14. The |RestartServer| subcommand
|
3. Refactoring and FixIt commands |youcompleteme-refactoring-fixit-commands|
|
||||||
15. The |ReloadSolution| subcommand
|
1. The |FixIt| subcommand
|
||||||
16. The |GoToImplementation| subcommand
|
2. The 'RefactorRename <new name>' subcommand |RefactorRename-new-name|
|
||||||
17. The |GoToImplementationElseDeclaration| subcommand
|
3. Multi-file Refactor |youcompleteme-multi-file-refactor|
|
||||||
|
4. Miscellaneous commands |youcompleteme-miscellaneous-commands|
|
||||||
|
1. The |ClearCompilationFlagCache| subcommand
|
||||||
|
2. The |StartServer| subcommand
|
||||||
|
3. The |StopServer| subcommand
|
||||||
|
4. The |RestartServer| subcommand
|
||||||
|
5. The |ReloadSolution| subcommand
|
||||||
8. Functions |youcompleteme-functions|
|
8. Functions |youcompleteme-functions|
|
||||||
1. The |youcompleteme#GetErrorCount| function
|
1. The |youcompleteme#GetErrorCount| function
|
||||||
2. The |youcompleteme#GetWarningCount| function
|
2. The |youcompleteme#GetWarningCount| function
|
||||||
@ -193,6 +200,10 @@ Image: Build Status [1] Image: Build status [3]
|
|||||||
|
|
||||||
- YcmCompleter subcommands
|
- YcmCompleter subcommands
|
||||||
|
|
||||||
|
- Go to declaration/definition/etc. commands
|
||||||
|
- Semantic type information and documentation
|
||||||
|
- Refactoring and FixIt commands
|
||||||
|
|
||||||
- Options
|
- Options
|
||||||
- FAQ
|
- FAQ
|
||||||
- Contributor Code of Conduct
|
- Contributor Code of Conduct
|
||||||
@ -280,9 +291,22 @@ features plus extra:
|
|||||||
- Supertab
|
- Supertab
|
||||||
- neocomplcache
|
- neocomplcache
|
||||||
|
|
||||||
YCM also provides semantic go-to-definition/declaration commands for C-family
|
-------------------------------------------------------------------------------
|
||||||
languages & Python. Expect more IDE features powered by the various YCM
|
*youcompleteme-thats-not-all...*
|
||||||
semantic engines in the future.
|
And that's not all... ~
|
||||||
|
|
||||||
|
YCM also provides semantic IDE-like features in a number of languages,
|
||||||
|
including:
|
||||||
|
|
||||||
|
- finding declarations, definitions, usages, etc. of identifiers,
|
||||||
|
- displaying type information for classes, variables, functions etc.,
|
||||||
|
- displaying documentation for methods, members, etc. in the preview window,
|
||||||
|
- fixing common coding errors, like missing semi-colons, typos, etc.,
|
||||||
|
- semantic renaming of variables across files (JavaScript only).
|
||||||
|
|
||||||
|
Features vary by file type, so make sure to check out the file type feature
|
||||||
|
summary and the full list of completer subcommands to find out what's available
|
||||||
|
for your favourite languages.
|
||||||
|
|
||||||
You'll also find that YCM has filepath completers (try typing './' in a file)
|
You'll also find that YCM has filepath completers (try typing './' in a file)
|
||||||
and a completer that integrates with UltiSnips [17].
|
and a completer that integrates with UltiSnips [17].
|
||||||
@ -911,6 +935,7 @@ TypeScript ~
|
|||||||
JavaScript ~
|
JavaScript ~
|
||||||
|
|
||||||
- Intelligent auto-completion
|
- Intelligent auto-completion
|
||||||
|
- Renaming variables ('RefactorRename <new name>')
|
||||||
- Go to definition, find references (|GoToDefinition|, |GoToReferences|)
|
- Go to definition, find references (|GoToDefinition|, |GoToReferences|)
|
||||||
- Type information for identifiers (|GetType|)
|
- Type information for identifiers (|GetType|)
|
||||||
- View documentation comments for identifiers (|GetDoc|)
|
- View documentation comments for identifiers (|GetDoc|)
|
||||||
@ -1372,20 +1397,24 @@ purpose.
|
|||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *:YcmCompleter* command
|
The *:YcmCompleter* command
|
||||||
|
|
||||||
This command can be used to invoke completer-specific commands. If the first
|
This command gives access to a number of additional IDE-like features in YCM,
|
||||||
|
for things like semantic GoTo, type information, FixIt and refactoring.
|
||||||
|
|
||||||
|
Technically the command invokes completer-specific commands. If the first
|
||||||
argument is of the form 'ft=...' the completer for that file type will be used
|
argument is of the form 'ft=...' the completer for that file type will be used
|
||||||
(for example 'ft=cpp'), else the native completer of the current buffer will be
|
(for example 'ft=cpp'), else the native completer of the current buffer will be
|
||||||
used. Call 'YcmCompleter' without further arguments for information about the
|
used. Call 'YcmCompleter' without further arguments for a list of the commands
|
||||||
commands you can call for the selected completer.
|
you can call for the current completer.
|
||||||
|
|
||||||
See the _YcmCompleter subcommands_ section for more information on the
|
See the file type feature summary for an overview of the features available for
|
||||||
available subcommands.
|
each file type. See the _YcmCompleter subcommands_ section for more information
|
||||||
|
on the available subcommands and their usage.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-ycmcompleter-subcommands*
|
*youcompleteme-ycmcompleter-subcommands*
|
||||||
YcmCompleter subcommands ~
|
YcmCompleter subcommands ~
|
||||||
|
|
||||||
[See the docs for the 'YcmCompleter' command before tackling this section.]
|
NOTE: See the docs for the 'YcmCompleter' command before tackling this section.
|
||||||
|
|
||||||
The invoked subcommand is automatically routed to the currently active semantic
|
The invoked subcommand is automatically routed to the currently active semantic
|
||||||
completer, so ':YcmCompleter GoToDefinition' will invoke the |GoToDefinition|
|
completer, so ':YcmCompleter GoToDefinition' will invoke the |GoToDefinition|
|
||||||
@ -1397,7 +1426,12 @@ You may also want to map the subcommands to something less verbose; for
|
|||||||
instance, 'nnoremap <leader>jd :YcmCompleter GoTo<CR>' maps the '<leader>jd'
|
instance, 'nnoremap <leader>jd :YcmCompleter GoTo<CR>' maps the '<leader>jd'
|
||||||
sequence to the longer subcommand invocation.
|
sequence to the longer subcommand invocation.
|
||||||
|
|
||||||
The various 'GoTo*' subcommands add entries to Vim's 'jumplist' so you can use
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-goto-commands*
|
||||||
|
GoTo commands ~
|
||||||
|
|
||||||
|
These commands are useful for jumping around and exploring code. When moving
|
||||||
|
the cursor, the subcommands add entries to Vim's 'jumplist' so you can use
|
||||||
'CTRL-O' to jump back to where you where before invoking the command (and
|
'CTRL-O' to jump back to where you where before invoking the command (and
|
||||||
'CTRL-I' to jump forward; see ':h jumplist' for details).
|
'CTRL-I' to jump forward; see ':h jumplist' for details).
|
||||||
|
|
||||||
@ -1465,17 +1499,29 @@ locations.
|
|||||||
Supported in filetypes: 'javascript, python, typescript'
|
Supported in filetypes: 'javascript, python, typescript'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *ClearCompilationFlagCache* subcommand
|
The *GoToImplementation* subcommand
|
||||||
|
|
||||||
YCM caches the flags it gets from the 'FlagsForFile' function in your
|
Looks up the symbol under the cursor and jumps to its implementation (i.e. non-
|
||||||
'ycm_extra_conf.py' file if you return them with the 'do_cache' parameter set
|
interface). If there are multiple implementations, instead provides a list of
|
||||||
to 'True'. The cache is in memory and is never invalidated (unless you restart
|
implementations to choose from.
|
||||||
Vim of course).
|
|
||||||
|
|
||||||
This command clears that cache entirely. YCM will then re-query your
|
Supported in filetypes: 'cs'
|
||||||
'FlagsForFile' function as needed in the future.
|
|
||||||
|
|
||||||
Supported in filetypes: 'c, cpp, objc, objcpp'
|
-------------------------------------------------------------------------------
|
||||||
|
The *GoToImplementationElseDeclaration* subcommand
|
||||||
|
|
||||||
|
Looks up the symbol under the cursor and jumps to its implementation if one,
|
||||||
|
else jump to its declaration. If there are multiple implementations, instead
|
||||||
|
provides a list of implementations to choose from.
|
||||||
|
|
||||||
|
Supported in filetypes: 'cs'
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-semantic-information-commands*
|
||||||
|
Semantic information commands ~
|
||||||
|
|
||||||
|
These commands are useful for finding static information about the code, such
|
||||||
|
as the types of variables, viewing declarations and documentation strings.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *GetType* subcommand
|
The *GetType* subcommand
|
||||||
@ -1535,6 +1581,28 @@ NOTE: Causes re-parsing of the current translation unit.
|
|||||||
|
|
||||||
Supported in filetypes: 'c, cpp, objc, objcpp'
|
Supported in filetypes: 'c, cpp, objc, objcpp'
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The *GetDoc* subcommand
|
||||||
|
|
||||||
|
Displays the preview window populated with quick info about the identifier
|
||||||
|
under the cursor. Depending on the file type, this includes things like:
|
||||||
|
|
||||||
|
- The type or declaration of identifier,
|
||||||
|
- Doxygen/javadoc comments,
|
||||||
|
- Python docstrings,
|
||||||
|
- etc.
|
||||||
|
|
||||||
|
Supported in filetypes: 'c, cpp, objc, objcpp, cs, python, typescript,
|
||||||
|
javascript'
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-refactoring-fixit-commands*
|
||||||
|
Refactoring and FixIt commands ~
|
||||||
|
|
||||||
|
These commands make changes to your source code in order to perform refactoring
|
||||||
|
or code correction. YouCompleteMe does not perform any action which cannot be
|
||||||
|
undone, and never saves or writes files to the disk.
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *FixIt* subcommand
|
The *FixIt* subcommand
|
||||||
|
|
||||||
@ -1561,29 +1629,82 @@ indication).
|
|||||||
NOTE: Causes re-parsing of the current translation unit.
|
NOTE: Causes re-parsing of the current translation unit.
|
||||||
|
|
||||||
NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
|
NOTE: After applying a fix-it, the diagnostics UI is not immediately updated.
|
||||||
This is due to a technical restriction in vim, and moving the cursor, or
|
This is due to a technical restriction in Vim. Moving the cursor, or issuing
|
||||||
issuing the the |:YcmForceCompileAndDiagnostics| command will refresh the
|
the |:YcmForceCompileAndDiagnostics| command will refresh the diagnostics.
|
||||||
diagnostics. Repeated invocations of the |FixIt| command on a given line,
|
Repeated invocations of the |FixIt| command on a given line, however, _do_
|
||||||
however, _do_ apply all diagnostics as expected without requiring refreshing of
|
apply all diagnostics as expected without requiring refreshing of the
|
||||||
the diagnostics UI. This is particularly useful where there are multiple
|
diagnostics UI. This is particularly useful where there are multiple
|
||||||
diagnostics on one line, or where after fixing one diagnostic, another fix-it
|
diagnostics on one line, or where after fixing one diagnostic, another fix-it
|
||||||
is available.
|
is available.
|
||||||
|
|
||||||
Supported in filetypes: 'c, cpp, objc, objcpp, cs'
|
Supported in filetypes: 'c, cpp, objc, objcpp, cs'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *GetDoc* subcommand
|
*RefactorRename-new-name*
|
||||||
|
The 'RefactorRename <new name>' subcommand ~
|
||||||
|
|
||||||
Displays the preview window populated with quick info about the identifier
|
In supported file types, this command attempts to perform a semantic rename of
|
||||||
under the cursor. This includes, depending on the language, things like:
|
the identifier under the cursor. This includes renaming declarations,
|
||||||
|
definitions and usages of the identifier, or any other language-appropriate
|
||||||
|
action. The specific behavior is defined by the semantic engine in use.
|
||||||
|
|
||||||
- The type or declaration of identifier
|
Similar to |FixIt|, this command applies automatic modifications to your source
|
||||||
- Doxygen/javadoc comments
|
files. Rename operations may involve changes to multiple files, which may or
|
||||||
- Python docstrings
|
may not be open in Vim buffers at the time. YouCompleteMe handles all of this
|
||||||
- etc.
|
for you. The behavior is described in the following section.
|
||||||
|
|
||||||
Supported in filetypes: 'c, cpp, objc, objcpp, cs, python, typescript,
|
Supported in filetypes: 'javascript' (variables only)
|
||||||
javascript'
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-multi-file-refactor*
|
||||||
|
Multi-file Refactor ~
|
||||||
|
|
||||||
|
When a Refactor or FixIt command touches multiple files, YouCompleteMe attempts
|
||||||
|
to apply those modifications to any existing open, visible buffer in the
|
||||||
|
current tab. If no such buffer can be found, YouCompleteMe opens the file in a
|
||||||
|
new small horizontal split at the top of the current window, applies the
|
||||||
|
change, and then _hides_ the window. NOTE: The buffer remains open, and must be
|
||||||
|
manually saved. A confirmation dialog is opened prior to doing this to remind
|
||||||
|
you that this is about to happen.
|
||||||
|
|
||||||
|
Once the modifications have been made, the quickfix list (see ':help quickfix')
|
||||||
|
is opened and populated with the locations of all modifications. This can be
|
||||||
|
used to review all automatic changes made. Typically, use the 'CTRL-W <enter>'
|
||||||
|
combination to open the selected file in a new split.
|
||||||
|
|
||||||
|
The buffers are _not_ saved automatically. That is, you must save the modified
|
||||||
|
buffers manually after reviewing the changes from the quickfix list. Changes
|
||||||
|
can be undone using Vim's powerful undo features (see ':help undo'). Note that
|
||||||
|
Vim's undo is per-buffer, so to undo all changes, the undo commands must be
|
||||||
|
applied in each modified buffer separately.
|
||||||
|
|
||||||
|
NOTE: While applying modifications, Vim may find files which are already open
|
||||||
|
and have a swap file. The command is aborted if you select Abort or Quit in any
|
||||||
|
such prompts. This leaves the Refactor operation partially complete and must be
|
||||||
|
manually corrected using Vim's undo features. The quickfix list is _not_
|
||||||
|
populated in this case. Inspect ':buffers' or equivalent (see ':help buffers')
|
||||||
|
to see the buffers that were opened by the command.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
*youcompleteme-miscellaneous-commands*
|
||||||
|
Miscellaneous commands ~
|
||||||
|
|
||||||
|
These commands are for general administration, rather than IDE-like features.
|
||||||
|
They cover things like the semantic engine server instance and compilation
|
||||||
|
flags.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
The *ClearCompilationFlagCache* subcommand
|
||||||
|
|
||||||
|
YCM caches the flags it gets from the 'FlagsForFile' function in your
|
||||||
|
'ycm_extra_conf.py' file if you return them with the 'do_cache' parameter set
|
||||||
|
to 'True'. The cache is in memory and is never invalidated (unless you restart
|
||||||
|
Vim of course).
|
||||||
|
|
||||||
|
This command clears that cache entirely. YCM will then re-query your
|
||||||
|
'FlagsForFile' function as needed in the future.
|
||||||
|
|
||||||
|
Supported in filetypes: 'c, cpp, objc, objcpp'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
The *StartServer* subcommand
|
The *StartServer* subcommand
|
||||||
@ -1623,24 +1744,6 @@ files are changed outside of Vim, or whenever Omnisharp cache is out-of-sync.
|
|||||||
|
|
||||||
Supported in filetypes: 'cs'
|
Supported in filetypes: 'cs'
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
The *GoToImplementation* subcommand
|
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its implementation (i.e. non-
|
|
||||||
interface). If there are multiple implementations, instead provides a list of
|
|
||||||
implementations to choose from.
|
|
||||||
|
|
||||||
Supported in filetypes: 'cs'
|
|
||||||
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
The *GoToImplementationElseDeclaration* subcommand
|
|
||||||
|
|
||||||
Looks up the symbol under the cursor and jumps to its implementation if one,
|
|
||||||
else jump to its declaration. If there are multiple implementations, instead
|
|
||||||
provides a list of implementations to choose from.
|
|
||||||
|
|
||||||
Supported in filetypes: 'cs'
|
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
*youcompleteme-functions*
|
*youcompleteme-functions*
|
||||||
Functions ~
|
Functions ~
|
||||||
@ -2137,7 +2240,7 @@ The *g:ycm_csharp_insert_namespace_expr* option
|
|||||||
By default, when YCM inserts a namespace, it will insert the 'using' statement
|
By default, when YCM inserts a namespace, it will insert the 'using' statement
|
||||||
under the nearest 'using' statement. You may prefer that the 'using' statement
|
under the nearest 'using' statement. You may prefer that the 'using' statement
|
||||||
is inserted somewhere, for example, to preserve sorting. If so, you can set
|
is inserted somewhere, for example, to preserve sorting. If so, you can set
|
||||||
this option to override this behaviour.
|
this option to override this behavior.
|
||||||
|
|
||||||
When this option is set, instead of inserting the 'using' statement itself, YCM
|
When this option is set, instead of inserting the 'using' statement itself, YCM
|
||||||
will set the global variable 'g:ycm_namespace_to_insert' to the namespace to
|
will set the global variable 'g:ycm_namespace_to_insert' to the namespace to
|
||||||
|
Loading…
x
Reference in New Issue
Block a user