File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
integration/vscode/ada/src Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export class AdaCodeLensProvider implements CodeLensProvider {
2727 document : TextDocument ,
2828 token ?: CancellationToken ,
2929 ) : ProviderResult < CodeLens [ ] > {
30- const symbols = commands . executeCommand < DocumentSymbol [ ] > (
30+ const symbols = commands . executeCommand < DocumentSymbol [ ] | undefined > (
3131 'vscode.executeDocumentSymbolProvider' ,
3232 document . uri ,
3333 ) ;
@@ -47,6 +47,10 @@ export class AdaCodeLensProvider implements CodeLensProvider {
4747 ) {
4848 // It's a main file, so let's offer Run and Debug actions on the main subprogram
4949 return symbols . then ( ( symbols ) => {
50+ if ( ! symbols ) {
51+ return [ ] ;
52+ }
53+
5054 const functions = symbols . filter ( ( s ) => s . kind == SymbolKind . Function ) ;
5155 if ( functions . length > 0 ) {
5256 /**
@@ -103,6 +107,10 @@ export class AdaCodeLensProvider implements CodeLensProvider {
103107 * This is tentative deactivated code in preparation of SPARK support.
104108 */
105109 res2 = symbols . then < CodeLens [ ] > ( ( symbols ) => {
110+ if ( ! symbols ) {
111+ return [ ] ;
112+ }
113+
106114 const symbolKinds = [ SymbolKind . Function ] ;
107115 const recurseInto = [ SymbolKind . Module , SymbolKind . Package , SymbolKind . Function ] ;
108116
You can’t perform that action at this time.
0 commit comments