Skip to content

Commit

Permalink
update:support yap test codelens
Browse files Browse the repository at this point in the history
  • Loading branch information
luoliwoshang committed Apr 9, 2024
1 parent 9dee575 commit db25e94
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/goDocumentSymbols.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export class GoplsDocumentSymbolProvider implements vscode.DocumentSymbolProvide
const start = text.indexOf(packageDecl);
pkgDeclRng = new vscode.Range(document.positionAt(start), document.positionAt(start + packageDecl.length));
pkgName = packageDecl[1];
} else if (document.fileName.endsWith('_test.gop')) {
} else if (document.fileName.endsWith('_test.gop') || document.fileName.endsWith('_ytest.gox')) {
pkgName = 'main'; // goxls: default test pkg
}
const packageSymbol = new vscode.DocumentSymbol(
Expand Down
7 changes: 6 additions & 1 deletion src/goRunTestCodelens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,12 @@ export class GoRunTestCodeLensProvider extends GoBaseCodeLensProvider {
const config = getGoConfig(document.uri);
const codeLensConfig = config.get<{ [key: string]: any }>('enableCodeLens');
const codelensEnabled = codeLensConfig ? codeLensConfig['runtest'] : false;
if (!codelensEnabled || (!document.fileName.endsWith('_test.go') && !document.fileName.endsWith('_test.gop'))) {
if (
!codelensEnabled ||
(!document.fileName.endsWith('_test.go') &&
!document.fileName.endsWith('_test.gop') &&
!document.fileName.endsWith('_ytest.gox'))
) {
return [];
}

Expand Down

0 comments on commit db25e94

Please sign in to comment.