Skip to content

Commit 922ca32

Browse files
committed
Add DocumentSymbolProvider integration test
1 parent 1b1d9d0 commit 922ca32

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -592,7 +592,7 @@
592592
"syntax": "js-yaml ./syntaxes/systemverilog.tmLanguage.yaml >./syntaxes/systemverilog.tmLanguage.json",
593593
"makeBsv": "antlr4ts -visitor syntaxes/bsv.g4 -o src/bsvjs",
594594
"pretest": "npm run compile-tests && npm run compile && npm run lint",
595-
"test": "node ./out/src/test/bsv.js"
595+
"test": "node ./out/src/test/runTest.js"
596596
},
597597
"dependencies": {
598598
"antlr4": "^4.13.1-patch-1",

src/test/runTest.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ async function main() {
77
try {
88
// The folder containing the Extension Manifest package.json
99
// Passed to `--extensionDevelopmentPath`
10-
const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10+
const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
1111

1212
// The path to test runner
1313
// Passed to --extensionTestsPath

src/test/suite/documentSymbol.test.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as assert from 'assert';
2+
import * as vscode from 'vscode';
3+
import * as path from 'path';
4+
5+
suite('VerilogDocumentSymbolProvider', () => {
6+
test('returns symbols for simple verilog file', async () => {
7+
const filePath = path.resolve(__dirname, '../../../language_examples/verilog_building_block/rtl/ram_sp.v');
8+
const document = await vscode.workspace.openTextDocument(filePath);
9+
await vscode.window.showTextDocument(document);
10+
11+
await vscode.workspace.getConfiguration('verilog').update('ctags.path', 'ctags', vscode.ConfigurationTarget.Global);
12+
13+
const symbols = await vscode.commands.executeCommand<vscode.DocumentSymbol[]>(
14+
'vscode.executeDocumentSymbolProvider',
15+
document.uri
16+
);
17+
18+
assert.ok(symbols && symbols.length > 0, 'Expected at least one document symbol');
19+
});
20+
});

0 commit comments

Comments
 (0)