@@ -24,6 +24,7 @@ interface IConfig {
2424}
2525
2626const EVAL_PATH = "/doc/eval.txt" ;
27+ const BUILTIN_PATH = "/doc/builtin.txt" ;
2728const OPTIONS_PATH = "/doc/options.txt" ;
2829const INDEX_PATH = "/doc/index.txt" ;
2930// const API_PATH = "/doc/api.txt";
@@ -65,6 +66,7 @@ class Server {
6566 if ( vimruntime ) {
6667 const paths = [
6768 EVAL_PATH ,
69+ BUILTIN_PATH ,
6870 OPTIONS_PATH ,
6971 INDEX_PATH ,
7072 // API_PATH,
@@ -229,12 +231,12 @@ class Server {
229231
230232 // get vim builtin function from document eval.txt
231233 private resolveBuiltinFunctions ( ) {
232- const evalText = this . text [ EVAL_PATH ] || [ ] ;
234+ const builtinText = this . text [ BUILTIN_PATH ] || [ ] ;
233235 let isMatchLine = false ;
234236 let completionItem : CompletionItem ;
235- for ( const line of evalText ) {
237+ for ( const line of builtinText ) {
236238 if ( ! isMatchLine ) {
237- if ( / \* f u n c t i o n s \* / . test ( line ) ) {
239+ if ( / \* b u i l t i n - f u n c t i o n - l i s t \* / . test ( line ) ) {
238240 isMatchLine = true ;
239241 }
240242 continue ;
@@ -276,15 +278,13 @@ class Server {
276278 }
277279
278280 private resolveBuiltinFunctionsDocument ( ) {
279- const evalText = this . text [ EVAL_PATH ] || [ ] ;
281+ const builtinText = this . text [ BUILTIN_PATH ] || [ ] ;
280282 let isMatchLine = false ;
281283 let label : string = "" ;
282- for ( let idx = 0 ; idx < evalText . length ; idx ++ ) {
283- const line = evalText [ idx ] ;
284+ for ( const line of builtinText ) {
284285 if ( ! isMatchLine ) {
285- if ( / \* a b s \( \) \* / . test ( line ) ) {
286+ if ( / \* b u i l t i n - f u n c t i o n - d e t a i l s \* / . test ( line ) ) {
286287 isMatchLine = true ;
287- idx -= 1 ;
288288 }
289289 continue ;
290290 } else {
@@ -297,7 +297,7 @@ class Server {
297297 if ( ! this . vimBuiltFunctionDocuments [ label ] ) {
298298 this . vimBuiltFunctionDocuments [ label ] = [ ] ;
299299 }
300- } else if ( / ^ [ \t ] * \* s t r i n g - m a t c h \* [ \t ] * $ / . test ( line ) ) {
300+ } else if ( / ^ [ \t ] * \* f e a t u r e - l i s t \* [ \t ] * $ / . test ( line ) ) {
301301 if ( label ) {
302302 this . vimBuiltFunctionDocuments [ label ] . pop ( ) ;
303303 }
0 commit comments