langium icon indicating copy to clipboard operation
langium copied to clipboard

make document symbol provider able to handle empty names

Open cdietrich opened this issue 1 year ago • 1 comments

cdietrich avatar Jun 28 '24 08:06 cdietrich

@msujew this is a corner case is our grammar where empty names are possible with string literals wdyt? alternative would be to move

name: name ?? nameNode.text,

or

{
            return [{
                kind: this.nodeKindProvider.getSymbolKind(astNode),
                kind: this.nodeKindProvider.getSymbolKind(astNode),
                name: name ?? nameNode.text,
                name: name === undefined || name.length === 0 ? nameNode.text : name,
                range: node.range,
                range: node.range,
                selectionRange: nameNode.range,
                selectionRange: nameNode.range,
                children: this.getChildSymbols(document, astNode)
                children: this.getChildSymbols(document, astNode)
            }

to a helper

cdietrich avatar Jun 28 '24 08:06 cdietrich