Skip to content

Commit d026ecd

Browse files
authored
Merge pull request #104 from j-zeppenfeld/jz/devel/hover
Implement language server textDocument/hover
2 parents 6f285aa + 4ff0bb0 commit d026ecd

File tree

10 files changed

+2382
-40
lines changed

10 files changed

+2382
-40
lines changed

vhdl_lang/src/analysis/root.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,12 @@ impl DesignRoot {
317317
ItemAtCursor::search(self, source, cursor)
318318
}
319319

320+
/// Search for the declaration at decl_pos and format it
321+
pub fn format_declaration(&self, decl_pos: &SrcPos) -> Option<String> {
322+
FormatDeclaration::search(self, decl_pos)
323+
}
324+
325+
/// Search for all references to the declaration at decl_pos
320326
pub fn find_all_references(&self, decl_pos: &SrcPos) -> Vec<SrcPos> {
321327
FindAllReferences::search(self, decl_pos)
322328
}

vhdl_lang/src/ast.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,13 @@ pub enum ObjectClass {
515515
SharedVariable,
516516
}
517517

518+
#[derive(PartialEq, Debug, Clone, Copy)]
519+
pub enum InterfaceListType {
520+
Port,
521+
Generic,
522+
Parameter,
523+
}
524+
518525
#[derive(PartialEq, Debug, Clone)]
519526
pub struct ObjectDeclaration {
520527
pub class: ObjectClass,
@@ -583,6 +590,7 @@ pub struct InterfaceFileDeclaration {
583590
/// LRM 6.5.2 Interface object declarations
584591
#[derive(PartialEq, Debug, Clone)]
585592
pub struct InterfaceObjectDeclaration {
593+
pub list_type: InterfaceListType,
586594
pub class: ObjectClass,
587595
pub ident: Ident,
588596
pub mode: Mode,
@@ -1105,6 +1113,7 @@ pub struct EntityDeclaration {
11051113
pub decl: Vec<Declaration>,
11061114
pub statements: Vec<LabeledConcurrentStatement>,
11071115
}
1116+
11081117
/// LRM 3.3 Architecture bodies
11091118
#[derive(PartialEq, Debug, Clone)]
11101119
pub struct ArchitectureBody {

0 commit comments

Comments
 (0)