Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
isSdsAttribute,
isSdsClass,
isSdsEnumVariant,
isSdsExpression,
isSdsFunction,
isSdsPipeline,
isSdsSegment,
Expand Down Expand Up @@ -52,6 +53,18 @@ export class SafeDsDocumentSymbolProvider extends DefaultDocumentSymbolProvider
} else {
return undefined;
}
} else if (isSdsPipeline(node)) {
if (node.body) {
return super.getChildSymbols(document, node.body);
} else {
return undefined;
}
} else if (isSdsSegment(node)) {
if (node.body) {
return super.getChildSymbols(document, node.body);
} else {
return undefined;
}
} else {
return super.getChildSymbols(document, node);
}
Expand All @@ -62,9 +75,8 @@ export class SafeDsDocumentSymbolProvider extends DefaultDocumentSymbolProvider
isSdsAnnotation(node) ||
isSdsAttribute(node) ||
isSdsEnumVariant(node) ||
isSdsFunction(node) ||
isSdsPipeline(node) ||
isSdsSegment(node)
isSdsExpression(node) ||
isSdsFunction(node)
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ describe('SafeDsSemanticTokenProvider', async () => {
val a = 1;

(q: Int) {
val b = 1;
yield r = 1;
};
}
Expand All @@ -145,6 +146,12 @@ describe('SafeDsSemanticTokenProvider', async () => {
{
name: 'p',
kind: SymbolKind.Function,
children: [
{
name: 'a',
kind: SymbolKind.Variable,
},
],
},
],
},
Expand All @@ -155,6 +162,7 @@ describe('SafeDsSemanticTokenProvider', async () => {
val a = 1;

(p: Int) {
val b = 1;
yield r = 1;
};
}
Expand All @@ -164,6 +172,12 @@ describe('SafeDsSemanticTokenProvider', async () => {
name: 's',
kind: SymbolKind.Function,
detail: '(p: Int) -> (r: Int)',
children: [
{
name: 'a',
kind: SymbolKind.Variable,
},
],
},
],
},
Expand Down