feat: add blu-site static site generator and fix language issues

Build a complete static site generator in Lux that faithfully clones
blu.cx (elmstatic). Generates 14 post pages, section indexes, tag pages,
and a home page with snippets grid from markdown content.

Language fixes discovered during development:
- Add \{ and \} escape sequences in string literals (lexer)
- Register String.indexOf and String.lastIndexOf in type checker
- Fix formatter to preserve brace escapes in string literals
- Improve LSP hover to show documentation for let bindings and functions

ISSUES.md documents 15 Lux language limitations found during the project.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-17 15:43:05 -05:00
parent db82ca1a1c
commit bac63bab2a
99 changed files with 5335 additions and 99 deletions

View File

@@ -228,13 +228,14 @@ impl SymbolTable {
Declaration::Let(let_decl) => {
let is_public = matches!(let_decl.visibility, Visibility::Public);
let type_sig = let_decl.typ.as_ref().map(|t| self.type_expr_to_string(t));
let symbol = self.new_symbol(
let mut symbol = self.new_symbol(
let_decl.name.name.clone(),
SymbolKind::Variable,
let_decl.span,
type_sig,
is_public,
);
symbol.documentation = let_decl.doc.clone();
let id = self.add_symbol(scope_idx, symbol);
self.add_reference(id, let_decl.name.span, true, true);
@@ -279,13 +280,14 @@ impl SymbolTable {
};
let type_sig = format!("fn {}({}): {}{}{}", f.name.name, param_types.join(", "), return_type, properties, effects);
let symbol = self.new_symbol(
let mut symbol = self.new_symbol(
f.name.name.clone(),
SymbolKind::Function,
f.name.span,
Some(type_sig),
is_public,
);
symbol.documentation = f.doc.clone();
let fn_id = self.add_symbol(scope_idx, symbol);
self.add_reference(fn_id, f.name.span, true, false);
@@ -326,13 +328,14 @@ impl SymbolTable {
let is_public = matches!(t.visibility, Visibility::Public);
let type_sig = format!("type {}", t.name.name);
let symbol = self.new_symbol(
let mut symbol = self.new_symbol(
t.name.name.clone(),
SymbolKind::Type,
t.name.span,
Some(type_sig),
is_public,
);
symbol.documentation = t.doc.clone();
let type_id = self.add_symbol(scope_idx, symbol);
self.add_reference(type_id, t.name.span, true, false);
@@ -372,13 +375,14 @@ impl SymbolTable {
let is_public = true; // Effects are typically public
let type_sig = format!("effect {}", e.name.name);
let symbol = self.new_symbol(
let mut symbol = self.new_symbol(
e.name.name.clone(),
SymbolKind::Effect,
e.name.span,
Some(type_sig),
is_public,
);
symbol.documentation = e.doc.clone();
let effect_id = self.add_symbol(scope_idx, symbol);
// Add operations
@@ -409,13 +413,14 @@ impl SymbolTable {
let is_public = matches!(t.visibility, Visibility::Public);
let type_sig = format!("trait {}", t.name.name);
let symbol = self.new_symbol(
let mut symbol = self.new_symbol(
t.name.name.clone(),
SymbolKind::Type, // Traits are like types
t.name.span,
Some(type_sig),
is_public,
);
symbol.documentation = t.doc.clone();
self.add_symbol(scope_idx, symbol);
}