feat: enhance LSP with inlay hints, parameter hints, and improved hover

Add inlay type hints for let bindings, parameter name hints at call sites,
behavioral property documentation in hover, and long signature wrapping.

- Inlay hints: show inferred types for let bindings without annotations
- Parameter hints: show param names at call sites for multi-arg functions
- Hover: wrap long signatures, show behavioral property docs (pure, total, etc.)
- Rich docs: detailed hover for keywords like pure, total, idempotent, run, with
- TypeChecker: expose get_inferred_type() for LSP consumption
- Symbol table: include behavioral properties in function type signatures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 08:06:36 -05:00
parent 1fa599f856
commit d26fd975d1
3 changed files with 395 additions and 9 deletions

View File

@@ -263,7 +263,21 @@ impl SymbolTable {
.collect::<Vec<_>>()
.join(", "))
};
let type_sig = format!("fn {}({}): {}{}", f.name.name, param_types.join(", "), return_type, effects);
let properties = if f.properties.is_empty() {
String::new()
} else {
format!(" is {}", f.properties.iter()
.map(|p| match p {
crate::ast::BehavioralProperty::Pure => "pure",
crate::ast::BehavioralProperty::Total => "total",
crate::ast::BehavioralProperty::Idempotent => "idempotent",
crate::ast::BehavioralProperty::Deterministic => "deterministic",
crate::ast::BehavioralProperty::Commutative => "commutative",
})
.collect::<Vec<_>>()
.join(", "))
};
let type_sig = format!("fn {}({}): {}{}{}", f.name.name, param_types.join(", "), return_type, properties, effects);
let symbol = self.new_symbol(
f.name.name.clone(),