Skip to content

DocCommentOwner and symbols #186

Closed
Closed
@kjeremy

Description

@kjeremy

I'm sketching out some sort of hover support and as a first step was just going to display any documentation associated with a FileSymbol symbol. I was thinking of making an Option<string> on FileSymbol for documentation. FnDef is already a DocCommentOwner and I believe at least Module should be. Does it make sense to implement DocCommentOwner for the ones below too?

fn to_symbol(node: SyntaxNodeRef) -> Option<FileSymbol> {
    // ...
    visitor()
        .visit(decl::<ast::FnDef>)
        .visit(decl::<ast::StructDef>)
        .visit(decl::<ast::EnumDef>)
        .visit(decl::<ast::TraitDef>)
        .visit(decl::<ast::Module>)
        .visit(decl::<ast::TypeDef>)
        .visit(decl::<ast::ConstDef>)
        .visit(decl::<ast::StaticDef>)
        .accept(node)?
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions