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 {
27
27
document : TextDocument ,
28
28
token ?: CancellationToken ,
29
29
) : ProviderResult < CodeLens [ ] > {
30
- const symbols = commands . executeCommand < DocumentSymbol [ ] > (
30
+ const symbols = commands . executeCommand < DocumentSymbol [ ] | undefined > (
31
31
'vscode.executeDocumentSymbolProvider' ,
32
32
document . uri ,
33
33
) ;
@@ -47,6 +47,10 @@ export class AdaCodeLensProvider implements CodeLensProvider {
47
47
) {
48
48
// It's a main file, so let's offer Run and Debug actions on the main subprogram
49
49
return symbols . then ( ( symbols ) => {
50
+ if ( ! symbols ) {
51
+ return [ ] ;
52
+ }
53
+
50
54
const functions = symbols . filter ( ( s ) => s . kind == SymbolKind . Function ) ;
51
55
if ( functions . length > 0 ) {
52
56
/**
@@ -103,6 +107,10 @@ export class AdaCodeLensProvider implements CodeLensProvider {
103
107
* This is tentative deactivated code in preparation of SPARK support.
104
108
*/
105
109
res2 = symbols . then < CodeLens [ ] > ( ( symbols ) => {
110
+ if ( ! symbols ) {
111
+ return [ ] ;
112
+ }
113
+
106
114
const symbolKinds = [ SymbolKind . Function ] ;
107
115
const recurseInto = [ SymbolKind . Module , SymbolKind . Package , SymbolKind . Function ] ;
108
116
You can’t perform that action at this time.
0 commit comments