Skip to content
This repository was archived by the owner on Apr 13, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
48cbf7b
Remove `shell=True` for python 3.5+ subprocess
feltech Jan 27, 2018
b596af7
Support `--diagnose-all`
feltech Jan 27, 2018
317426a
Sort errors above warnings in quickfix/location list
feltech Jan 27, 2018
94b6a77
Support location list for `DiagnosticsAll`
feltech Jan 27, 2018
ed7187c
Improve error message handling
feltech Jan 27, 2018
70f126b
Add automatic diagnostics via complete refactor of python code + extras
feltech Feb 23, 2018
26af7bb
Fix getting project for buffers with blank filenames (e.g. loclist)
feltech Feb 24, 2018
a99f31a
Fix quickfix/loclist sort order and improve rendering
feltech Feb 24, 2018
4841cef
Construct list for rc command arguments from the get-go
feltech Feb 24, 2018
6835c3b
Fix detection of buffer modification state
feltech Feb 24, 2018
51c2a39
PEP8 fixes
feltech Feb 24, 2018
6b839dd
Fix completion request to use list for rc args
feltech Feb 25, 2018
eefacac
Unify + tidy vim + python logging
feltech Feb 25, 2018
1e44d39
Remove unused vim `CompleteAtCursor` function - python is used instead
feltech Feb 25, 2018
f20546a
Improve completion popup text description
feltech Feb 25, 2018
fa013a2
Fix cleaning wiped out buffers
feltech Feb 25, 2018
056fc61
Fix error logging
feltech Feb 25, 2018
fbde890
Add polling for diagnostics
feltech Feb 25, 2018
1c71cdd
Fix cleaning wiped out buffers
feltech Feb 25, 2018
b2e4772
Move method down for easier reading + update comment on dirty check.
feltech Feb 25, 2018
2add51b
Update some documentation
feltech Feb 25, 2018
2e21362
More documentation updates
feltech Feb 26, 2018
24eb630
Minor tidying
feltech Mar 3, 2018
b81e092
Don't include docstring in completion if it just repeats the completion
feltech Mar 3, 2018
8fcab21
Separate out buffer cache cleaning for easier testing and readability
feltech Mar 3, 2018
a65d808
Unit tests of python code
feltech Mar 3, 2018
5f802c1
Use utility rather than raw eval for getting auto diagnostics toggle
feltech Mar 3, 2018
986e2d8
Split `--unsaved-file` filename part to support filenames with spaces
feltech Mar 3, 2018
af6566d
Prefix underscore onto private `Diagnostic` members
feltech Mar 3, 2018
b87730b
Add `RtagsResetCaches` command to clear all `Buffer` etc caches
feltech Mar 4, 2018
1e7173c
Fix python units tests for python2 compatibility
feltech Mar 4, 2018
c2951ba
Update README
feltech Mar 4, 2018
878a216
Remove a spammy useless log
feltech Mar 4, 2018
6ba7607
Dont bother repeating completion word in menu description column
feltech Mar 4, 2018
a13fd12
Set omnifunc for c as well cpp
feltech Mar 4, 2018
147db47
Only poll for changes if current buffer is of cpp or c filetype
feltech Mar 4, 2018
e8c7e52
Merge branch 'master' into diagnostics_tweaks
feltech May 12, 2018
cc5cb99
Add `--current-file` to `--diagnose-all` to ensure correct project
feltech May 13, 2018
a02ba21
Add log when starting rdm
feltech May 12, 2018
9ae5a10
Better check of project update + reset when it fails
feltech May 13, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ default mappings can be disabled:

let g:rtagsUseDefaultMappings = 0

Diagnostics will be retrieved from rtags automatically and displayed as signs in the gutter column.
To disable this behaviour, set:

let g:rtagsAutoDiagnostics = 0

By default, search results are showed in a location list. Location lists
are local to the current window. To use the vim QuickFix window, which is
shared between all windows, set:
Expand Down Expand Up @@ -76,6 +81,8 @@ It is possible to set its maximum size (number of entries), default is 100:
| <Leader>rw | -e -r --rename | Rename symbol under cursor |
| <Leader>rv | -k -r | Find virtuals |
| <Leader>rd | --diagnose | Diagnose file for warnings and errors |
| <Leader>rD | --diagnose-all | Diagnose all files in project |
| <Leader>rx | --fixits | Apply diagnostic fixits to current buffer |
| <Leader>rb | N/A | Jump to previous location |

## Unite sources
Expand All @@ -87,15 +94,17 @@ This plugin defines three Unite sources:
* `rtags/project` - list/switch projects.

## Code completion
Code completion functionality uses ```completefunc``` (i.e. CTRL-X CTRL-U). If ```completefunc```
is set, vim-rtags will not override it with ```RtagsCompleteFunc```. This functionality is still
unstable, but if you want to try it you will have to set ```completefunc``` by
The ```omnifunc``` (i.e. CTRL-X CTRL-O) is overridden with ```RtagsCompleteFunc``` for cpp
filetypes by default. This can be toggled using ```let g:rtagsCppOmnifunc = 0```.
If ```g:rtagsCppOmnifunc``` is set to ```0``` then the ```completefunc``` (i.e. CTRL-X CTRL-U)
will be set instead, but only if it's not already used.

set completefunc=RtagsCompleteFunc

Also ```RtagsCompleteFunc``` can be used as omnifunc. For example, you can use
such approach with [neocomplete](https://github.com/Shougo/neocomplete.vim)(for more details read it's docs):
Compatibility with [YouCompleteMe](https://valloric.github.io/YouCompleteMe/) is just a matter of
disabling their built-in cpp completions and allowing vim-rtags to take over via their fallback to
the ```omnifunc```.

Compatibility with [neocomplete](https://github.com/Shougo/neocomplete.vim) can be achieved with
(for more details read it's docs):
```
function! SetupNeocompleteForCppWithRtags()
" Enable heavy omni completion.
Expand All @@ -105,14 +114,13 @@ function! SetupNeocompleteForCppWithRtags()
let g:neocomplete#sources#omni#input_patterns = {}
endif
let l:cpp_patterns='[^.[:digit:] *\t]\%(\.\|->\)\|\h\w*::'
let g:neocomplete#sources#omni#input_patterns.cpp = l:cpp_patterns
let g:neocomplete#sources#omni#input_patterns.cpp = l:cpp_patterns
set completeopt+=longest,menuone
endfunction

autocmd FileType cpp,c call SetupNeocompleteForCppWithRtags()

```
Such config provides automatic calls, of omnicompletion on c and cpp entity accessors.
Such config provides automatic calls of omnicompletion on c and cpp entity accessors.

### Current limitations
* There is no support for overridden functions and methods
Expand All @@ -123,6 +131,8 @@ Such config provides automatic calls, of omnicompletion on c and cpp entity acce

# Development
Unit tests for some plugin functions can be found in ```tests``` directory.
To run tests, execute:

To run tests, execute (note `nose` is required for python tests):
```
$ vim tests/test_rtags.vim +UnitTest
$ nosetests tests
```
75 changes: 69 additions & 6 deletions doc/rtags.txt
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ g:rtagsRdmCmd
location if it is installed to a non standard location or the location
doesn't appear in the PATH.

*g:rtagsAutoLaunchRdm*
*rtags-variable-auto-launch-rdm*
*g:rtagsAutoLaunchRdm*
*rtags-variable-auto-launch-rdm*
g:rtagsAutoLaunchRdm

Default: 0.
Expand Down Expand Up @@ -79,15 +79,24 @@ g:rtagsUseDefaultMappings
Otherwise, no mappings are set up and custom mappings can be configured by
a user.

*g:rtagsMinCharsForCommandCompletion*
*rtags-variable-min-chars-for-cmd-compl*
*g:rtagsCppOmnifunc*
*rtags-variable-cpp-omnifunc*
g:rtagsMinCharsForCommandCompletion

Default: 4.
Minimum number of characters to be typed before argument completion is
available for commands provided by the plugin or pluging mappings that
require user input.

*g:rtagsMinCharsForCommandCompletion*
*rtags-variable-min-chars-for-cmd-compl*
g:rtagsCppOmnifunc

Default: 1.
Override the vim completion |omnifunc| for the cpp filetype. If disabled,
then the |completefunc| will be used instead, but only if it's not already
set.

*g:rtagsMaxSearchResultWindowHeight*
*rtags-variable-max-search-result-window-height*
g:rtagsMaxSearchResultWindowHeight
Expand All @@ -96,13 +105,39 @@ g:rtagsMaxSearchResultWindowHeight
Determines the maximum height of the search result window. When number of
results is less than this parameter, the height is set to the number of
results.
*g:rtagsAutoDiagnostics*
*rtags-variable-auto-diagnostics*
g:rtagsAutoDiagnostics

Default: 1
If enabled then diagnostic gutter signs will be updated in the currently
active buffer automatically, and each line's diagnostic message will show
in the message window as the cursor moves through the file.

*g:rtagsDiagnosticsPollingInterval*
*rtags-variable-diagnostics-polling-interval*
g:rtagsDiagnosticsPollingInterval

Default: 3000
If |g:rtagsAutoDiagnostics| is enabled, then poll for changes to the RTags
project with this interval and update diagnostic signs and lists if changes
are found. Set to <=0 to disable polling. If disabled, updates to
diagnostics will be checked only after |CursorHold| and |BufEnter| events.

*g:rtagsLog*
*rtags-variable-rtags-log*
g:rtagsLog

Default: empty
When set to filename, rtags will put its logs in that file.
Default: |tempname|
File to log vim-rtags output.

*g:rtagsRdmLog*
*rtags-variable-rtags-rdm-log*
g:rtagsRdmLog

Default: |tempname|
If |g:rtagsAutoLaunchRdm| is enabled, then the RTags rdm daemon will log
its output to this file.

*rtags-mappings*
4. Mappings
Expand Down Expand Up @@ -192,6 +227,26 @@ g:rtagsLog
*rtags-FindSubClasses*
<Leader>rc Find the subclasses of the class under the cursor.

*rtags-leader-rd*
*rtags-Diagnostics*
<Leader>rd Show diagnostics for the current buffer in the location list,
along with diagnostic signs in the current window's
gutter.

*rtags-leader-rD*
*rtags-DiagnosticsAll*
<Leader>rD Show diagnostics for the whole project in the location or
quickfix list (depending on the value of
|g:rtagsUseLocationList|). That is, all the errors and
warnings from rdm's clang build of the current project.

*rtags-leader-rx*
*rtags-FixIts*
<Leader>rx Apply diagnostic clang fixits to the current buffer. Fixits
are identified with "Fx" in the sign column, and are
suffixed with "[FIXIT]" in the diagnostics lists.


*rtags-commands*
5. Commands

Expand All @@ -203,6 +258,14 @@ g:rtagsLog
- RtagsIFindRefsByName
- RtagsLoadCompilationDb

*RtagsResetCaches*

RtagsResetCaches

Reset the buffer and RTags project cache. This may be needed if you create
or modify the RTags project during a vim session.


*rtags-integrations*
6. Integrations with other plugins

Expand Down
Empty file added plugin/__init__.py
Empty file.
Loading