From 0a0b7ff36e0bddf526a8b62db286fc13a2564589 Mon Sep 17 00:00:00 2001 From: IdanArye Date: Wed, 5 Dec 2012 01:17:31 +0200 Subject: [PATCH] Added some filtering to the dscanner results. --- editors/vim/autoload/dcomplete.vim | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/editors/vim/autoload/dcomplete.vim b/editors/vim/autoload/dcomplete.vim index 3d99797..82a29f3 100644 --- a/editors/vim/autoload/dcomplete.vim +++ b/editors/vim/autoload/dcomplete.vim @@ -34,19 +34,22 @@ function! dcomplete#Complete(findstart,base) return resultLines[-1] end - "Identify the type of result received - let b:dscanner_resultType=resultLines[0] - "Parse the result accoring to their type - if b:dscanner_resultType=='dotComplete' - return s:parsePairs(a:base,resultLines,'','') - elseif b:dscanner_resultType=='completions' - return s:parsePairs(a:base,resultLines,'',')') - elseif b:dscanner_resultType=='calltips' - return s:parseCalltips(a:base,resultLines) - endif + "Find the begining of the results. + while len(resultLines) + "Identify the type of result received + let b:dscanner_resultType=resultLines[0] + "Parse the result accoring to their type + if b:dscanner_resultType=='dotComplete' + return s:parsePairs(a:base,resultLines,'','') + elseif b:dscanner_resultType=='completions' + return s:parsePairs(a:base,resultLines,'',')') + elseif b:dscanner_resultType=='calltips' + return s:parseCalltips(a:base,resultLines) + endif + let resultLines=resultLines[1:] + endwhile endif endfunction -echo "hi" "Run dscanner function! s:runDScanner(scanCommand) if exists('g:dscanner_path') @@ -85,7 +88,7 @@ endfunction function! s:parseCalltips(base,resultLines) let result=[a:base] for resultLine in a:resultLines[1:] - if len(resultLine) + if 0<=match(resultLine,".*(.*)") let funcArgs=[] for funcArg in split(resultLine[match(resultLine,'(')+1:-2],',\\n\\t') let argParts=split(funcArg)