@@ -3,18 +3,25 @@ import * as Path from 'path'
3
3
import * as LSP from 'vscode-languageserver/node'
4
4
import { CodeAction } from 'vscode-languageserver/node'
5
5
6
- import FIXTURE_DOCUMENT , { FIXTURE_FOLDER , FIXTURE_URI } from '../../../testing/fixtures'
6
+ import {
7
+ FIXTURE_DOCUMENT ,
8
+ FIXTURE_FOLDER ,
9
+ FIXTURE_URI ,
10
+ REPO_ROOT_FOLDER ,
11
+ } from '../../../testing/fixtures'
7
12
import { getMockConnection } from '../../../testing/mocks'
8
13
import LspServer from '../server'
9
14
import { CompletionItemDataType } from '../types'
10
15
11
- async function initializeServer ( ) {
16
+ async function initializeServer (
17
+ { rootPath } : { rootPath ?: string } = { rootPath : FIXTURE_FOLDER } ,
18
+ ) {
12
19
const diagnostics : Array < LSP . PublishDiagnosticsParams | undefined > = [ ]
13
20
14
21
const connection = getMockConnection ( )
15
22
16
23
const server = await LspServer . initialize ( connection , {
17
- rootPath : FIXTURE_FOLDER ,
24
+ rootPath,
18
25
rootUri : null ,
19
26
processId : 42 ,
20
27
capabilities : { } as any ,
@@ -484,7 +491,7 @@ describe('server', () => {
484
491
"name": "BLUE",
485
492
"type": 3,
486
493
},
487
- "documentation": "### Variable: **BLUE** - *defined in ../ extension.inc*",
494
+ "documentation": "### Variable: **BLUE** - *defined in extension.inc*",
488
495
"kind": 6,
489
496
"label": "BLUE",
490
497
},
@@ -513,7 +520,7 @@ describe('server', () => {
513
520
"name": "add_a_user",
514
521
"type": 3,
515
522
},
516
- "documentation": "### Function: **add_a_user** - *defined in ../ issue101.sh*
523
+ "documentation": "### Function: **add_a_user** - *defined in issue101.sh*
517
524
518
525
\`\`\`txt
519
526
Helper function to add a user
@@ -561,7 +568,7 @@ describe('server', () => {
561
568
} )
562
569
563
570
it ( 'responds to onCompletion with all variables when starting to expand parameters' , async ( ) => {
564
- const { connection } = await initializeServer ( )
571
+ const { connection } = await initializeServer ( { rootPath : REPO_ROOT_FOLDER } )
565
572
566
573
const onCompletion = connection . onCompletion . mock . calls [ 0 ] [ 0 ]
567
574
@@ -600,7 +607,7 @@ describe('server', () => {
600
607
"name": "RED",
601
608
"type": 3,
602
609
},
603
- "documentation": "### Variable: **RED** - *defined in ../ extension.inc*",
610
+ "documentation": "### Variable: **RED** - *defined in extension.inc*",
604
611
"kind": 6,
605
612
"label": "RED",
606
613
},
@@ -609,7 +616,7 @@ describe('server', () => {
609
616
"name": "GREEN",
610
617
"type": 3,
611
618
},
612
- "documentation": "### Variable: **GREEN** - *defined in ../ extension.inc*",
619
+ "documentation": "### Variable: **GREEN** - *defined in extension.inc*",
613
620
"kind": 6,
614
621
"label": "GREEN",
615
622
},
@@ -618,7 +625,7 @@ describe('server', () => {
618
625
"name": "BLUE",
619
626
"type": 3,
620
627
},
621
- "documentation": "### Variable: **BLUE** - *defined in ../ extension.inc*",
628
+ "documentation": "### Variable: **BLUE** - *defined in extension.inc*",
622
629
"kind": 6,
623
630
"label": "BLUE",
624
631
},
@@ -627,7 +634,7 @@ describe('server', () => {
627
634
"name": "RESET",
628
635
"type": 3,
629
636
},
630
- "documentation": "### Variable: **RESET** - *defined in ../ extension.inc*",
637
+ "documentation": "### Variable: **RESET** - *defined in extension.inc*",
631
638
"kind": 6,
632
639
"label": "RESET",
633
640
},
@@ -636,7 +643,7 @@ describe('server', () => {
636
643
"name": "USER",
637
644
"type": 3,
638
645
},
639
- "documentation": "### Variable: **USER** - *defined in ../ issue101.sh*",
646
+ "documentation": "### Variable: **USER** - *defined in issue101.sh*",
640
647
"kind": 6,
641
648
"label": "USER",
642
649
},
@@ -645,7 +652,7 @@ describe('server', () => {
645
652
"name": "PASSWORD",
646
653
"type": 3,
647
654
},
648
- "documentation": "### Variable: **PASSWORD** - *defined in ../ issue101.sh*",
655
+ "documentation": "### Variable: **PASSWORD** - *defined in issue101.sh*",
649
656
"kind": 6,
650
657
"label": "PASSWORD",
651
658
},
@@ -654,14 +661,23 @@ describe('server', () => {
654
661
"name": "COMMENTS",
655
662
"type": 3,
656
663
},
657
- "documentation": "### Variable: **COMMENTS** - *defined in ../ issue101.sh*
664
+ "documentation": "### Variable: **COMMENTS** - *defined in issue101.sh*
658
665
659
666
\`\`\`txt
660
667
Having shifted twice, the rest is now comments ...
661
668
\`\`\`",
662
669
"kind": 6,
663
670
"label": "COMMENTS",
664
671
},
672
+ Object {
673
+ "data": Object {
674
+ "name": "tag",
675
+ "type": 3,
676
+ },
677
+ "documentation": "### Variable: **tag** - *defined in ../../scripts/tag-release.inc*",
678
+ "kind": 6,
679
+ "label": "tag",
680
+ },
665
681
]
666
682
` )
667
683
} )
0 commit comments