Skip to content

Commit 9955e26

Browse files
author
gaalcaras
committed
Improve rchunk logging
1 parent ebc349e commit 9955e26

3 files changed

Lines changed: 12 additions & 11 deletions

File tree

autoload/ncm_r.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ function! ncm_r#init()
2929
endfunction
3030

3131
function! ncm_r#on_warmup(ctx)
32-
call g:ncm_r#proc.jobstart()
32+
call g:ncm_r#proc.jobstart()
3333
endfunction
3434

3535
function! ncm_r#on_complete(ctx)
36-
call g:ncm_r#proc.try_notify('on_complete', a:ctx)
36+
call g:ncm_r#proc.try_notify('on_complete', a:ctx)
3737
endfunction

autoload/ncm_rchunk.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ endif
44
let s:loaded = 1
55

66
let g:ncm_rchunk#proc = yarp#py3({
7-
\ 'module': 'ncm_rchunk'
7+
\ 'module': 'ncm_rchunk',
88
\ })
99

1010
let g:ncm_rchunk#source = extend(get(g:, 'ncm_rchunk', {}), {
@@ -13,7 +13,7 @@ let g:ncm_rchunk#source = extend(get(g:, 'ncm_rchunk', {}), {
1313
\ 'mark': 'Rchunk',
1414
\ 'scope': ['rchunk'],
1515
\ 'subscope_enable': 1,
16-
\ 'word_pattern': '[\w_\.]+',
16+
\ 'word_pattern': '[\w_\.]*',
1717
\ 'complete_pattern': [',\s', '=\s"'],
1818
\ 'on_complete': 'ncm_rchunk#on_complete',
1919
\ }, 'keep')
@@ -23,5 +23,5 @@ function! ncm_rchunk#init()
2323
endfunction
2424

2525
function! ncm_rchunk#on_complete(ctx)
26-
call g:ncm_rchunk#proc.try_notify('on_complete', a:ctx)
26+
call g:ncm_rchunk#proc.try_notify('on_complete', a:ctx)
2727
endfunction

pythonx/ncm_rchunk.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ class Source(Rsource): # pylint: disable=too-few-public-methods
9797
def __init__(self, nvim):
9898
super(Source, self).__init__(nvim)
9999

100+
self._info('rchunk :: init')
101+
100102
self._options = list()
101103
options = self.CHUNK_OPTIONS
102104

@@ -115,15 +117,14 @@ def on_complete(self, ctx):
115117
matches = self._options
116118
option = rlang.get_option(ctx['typed'])
117119

118-
self._info('hello :: typed: {}, ccol: {},'
119-
' startccol: {}'.format(ctx['typed'],
120-
ctx['ccol'],
121-
ctx['startccol']))
122-
123120
if option:
124121
matches = filtr.arg(matches, option)
125122

126-
self._info(matches)
123+
self._info('ncm_rchunk :: option: {}, typed: "{}",'
124+
'ccol: {}, scope_len: {}'.format(option, ctx['typed'],
125+
ctx['ccol'],
126+
ctx['scope_len']))
127+
127128
self.complete(ctx, ctx['scope_len'], matches)
128129

129130

0 commit comments

Comments
 (0)