[SourceKit] Report cursor info information for literals

Adds literals support for the CursorInfo request.
Previously CursorInfo just returned error for literals.
Implements issue #57725
This commit is contained in:
Simon Barinka
2023-07-30 14:22:08 +02:00
parent d2c8ede38d
commit fcd084f9dd
9 changed files with 223 additions and 24 deletions

View File

@@ -333,6 +333,13 @@ UIdent SwiftLangSupport::getUIDForDecl(const Decl *D, bool IsRef) {
return UIdentVisitor(IsRef).visit(const_cast<Decl*>(D));
}
UIdent SwiftLangSupport::getUIDForLiteral(const Expr *Lit) {
if (dyn_cast<ObjectLiteralExpr>(Lit)) {
return KindExprObjectLiteral;
}
return KindExprLiteral;
}
UIdent SwiftLangSupport::getUIDForExtensionOfDecl(const Decl *D) {
switch (D->getKind()) {
case swift::DeclKind::Struct: