Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8422467
compiler: `validate_interface_member_implementation` doesn't generate…
0x6e Jul 29, 2026
d0f44c2
compiler: add `property_declaration_node` to find inherited declarations
0x6e Jul 29, 2026
4a7a66e
compiler: validate_interface_member_implementation now adds notes on …
0x6e Jul 29, 2026
d9cae48
compiler: add interfaces::validate_interface_implementation
0x6e Jul 29, 2026
6ba7c0c
compiler: interface::apply_child_implement_statements adds notes for …
0x6e Jul 29, 2026
7c2a33c
compiler: emit notes when a declaration conflicts with a child-implem…
0x6e Jul 29, 2026
291e631
compiler: apply_child_implement_statements emits more specific notes
0x6e Aug 3, 2026
36ad0ba
compiler: refactor syntax_for_declaration from syntax for
0x6e Aug 3, 2026
473357d
compiler: interfaces::property_matches_interface uses full syntax for…
0x6e Aug 3, 2026
1d74024
compiler: Display for Function doesn't print void return types
0x6e Aug 3, 2026
63461e9
compiler: interfaces::syntax_for re-uses the Display implementation f…
0x6e Aug 3, 2026
c4e3a04
Display for langtype::Function uses named variables inside the format…
0x6e Aug 17, 2026
00cc250
compiler: remove static keyword list from interfaces.rs
0x6e Aug 17, 2026
6d7e7cf
compiler: remove `check_property_declaration_conflicts` from `validat…
0x6e Aug 18, 2026
9f4663d
interfaces: add syntax tests which conflict with builtin components
0x6e Aug 19, 2026
d58d875
compiler: interfaces use the non-normalised child id in diagnostic me…
0x6e Aug 19, 2026
b2cf74d
compiler: improve interface diagnostic note phrasing
0x6e Aug 19, 2026
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
16 changes: 15 additions & 1 deletion internal/compiler/langtype.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use smol_str::SmolStr;

use crate::expression_tree::{BuiltinFunction, Expression, Unit};
use crate::object_tree::{Component, DEFAULT_SLOT_NAME, PropertyVisibility};
use crate::parser::SyntaxNode;
use crate::typeregister::TypeRegister;

#[derive(Debug, Clone, Default)]
Expand Down Expand Up @@ -530,6 +531,14 @@ impl ElementType {
}
}

/// Return the node declaring `name` in this type or one of its bases, if there is one.
pub fn property_declaration_node(&self, name: &str) -> Option<SyntaxNode> {
match self {
Self::Component(c) => c.root_element.borrow().property_declaration_node(name),
_ => None,
}
}

/// List of sub properties valid for the auto completion
pub fn property_list(&self) -> Vec<(SmolStr, Type)> {
match self {
Expand Down Expand Up @@ -977,7 +986,12 @@ impl Display for Function {
}
write!(formatter, "{arg}")?;
}
write!(formatter, ") -> {}", self.return_type)
let return_type = if self.return_type == Type::Void {
String::new()
} else {
format!(" -> {}", self.return_type)
};
write!(formatter, "){}", return_type)
Comment thread
0x6e marked this conversation as resolved.
Outdated
}
}

Expand Down
8 changes: 8 additions & 0 deletions internal/compiler/object_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2852,6 +2852,14 @@ impl Element {
}
}

/// Return the node declaring `name` in this element or one of its bases, if there is one.
pub fn property_declaration_node(&self, name: &str) -> Option<SyntaxNode> {
self.property_declarations
.get(name)
.and_then(|declaration| declaration.node.clone())
.or_else(|| self.base_type.property_declaration_node(name))
}

fn slot_forwarding_expr_identifier(expression: &SyntaxNode) -> Option<SmolStr> {
if expression.kind() != SyntaxKind::Expression {
return None;
Expand Down
Loading
Loading