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:
@@ -759,6 +759,17 @@ impl TypeChecker {
|
||||
self.env.bindings.get(name)
|
||||
}
|
||||
|
||||
/// Get the inferred type of a binding as a display string (for LSP inlay hints)
|
||||
pub fn get_inferred_type(&self, name: &str) -> Option<String> {
|
||||
let scheme = self.env.bindings.get(name)?;
|
||||
let type_str = scheme.typ.to_string();
|
||||
// Skip unhelpful types
|
||||
if type_str == "<error>" || type_str.contains('?') {
|
||||
return None;
|
||||
}
|
||||
Some(type_str)
|
||||
}
|
||||
|
||||
/// Get auto-generated migrations from type checking
|
||||
/// Returns: type_name -> from_version -> migration_body
|
||||
pub fn get_auto_migrations(&self) -> &HashMap<String, HashMap<u32, Expr>> {
|
||||
|
||||
Reference in New Issue
Block a user