Skip to content

Commit 2cd82d9

Browse files
authored
Merge pull request #21 from phux/echodoc-compatibility
Added compatibility with echodoc.vim
2 parents 3c99c2a + 22a43ee commit 2cd82d9

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,28 @@ command! StopPadawan call deoplete#sources#padawan#StopServer()
110110
command! RestartPadawan call deoplete#sources#padawan#RestartServer()
111111
```
112112

113+
## Compatibility with other plugins
114+
115+
### echodoc.vim
116+
117+
This plugin is compatible with [echodoc.vim](https://github.com/Shougo/echodoc.vim).
118+
119+
**Note**: If you change `g:deoplete#sources#padawan#add_parentheses` from default `0` to `1`, you have to add `$` to deoplete's `skip_chars`.
120+
Otherwise the popup menu which is triggered after you type `$` will disable echodoc's functionality.
121+
122+
Examples of working setups:
123+
124+
```vim
125+
let g:deoplete#sources#padawan#add_parentheses = 0
126+
```
127+
128+
or
129+
130+
```vim
131+
let g:deoplete#sources#padawan#add_parentheses = 1
132+
let g:deoplete#skip_chars = ['$']
133+
```
134+
113135
## Todo
114136
- [x] Update configuration section
115137
- [x] Provide actions to start and stop padawan.php server

rplugin/python3/deoplete/sources/deoplete_padawan.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,18 @@ def gather_candidates(self, context):
113113
candidate = {'word': self.get_candidate_word(item),
114114
'abbr': self.get_candidate_abbr(item),
115115
'kind': self.get_candidate_signature(item),
116-
'info': item['description'],
116+
'info': self.get_candidate_info(item),
117117
'dup': 1}
118118
candidates.append(candidate)
119119

120120
return candidates
121121

122+
def get_candidate_info(self, item):
123+
abbr = self.get_candidate_abbr(item)
124+
signature = self.get_candidate_signature(item)
125+
126+
return abbr + signature
127+
122128
def get_candidate_abbr(self, item):
123129
if 'menu' in item and item['menu']:
124130
abbr = item['menu']

0 commit comments

Comments
 (0)