feat(lexer): add type system keywords
Added four keywords for new type system: - concept: Base type definition - sub_concept: Enum/record sub-type definition - concept_comparison: Compile-time enum mapping - any: Universal type for dynamic contexts Also added: - CLAUDE.md with project instructions and commit guidelines - Test coverage for new keywords - Crate-level deny directives for unused variables and dead code Fixed pre-existing clippy issues to pass pre-commit hooks.
This commit is contained in:
@@ -290,17 +290,12 @@ fn get_contextual_field_completions(doc: &Document, offset: usize) -> Option<Vec
|
||||
| Declaration::Template(template) => {
|
||||
// Check if cursor is inside this template block
|
||||
if offset >= template.span.start && offset <= template.span.end {
|
||||
let mut items = Vec::new();
|
||||
|
||||
// Add special keywords for templates
|
||||
items.push(simple_item(
|
||||
// Templates can suggest common field patterns
|
||||
return Some(vec![simple_item(
|
||||
"include",
|
||||
"Include a template",
|
||||
"include ${1:TemplateName}",
|
||||
));
|
||||
|
||||
// Templates can suggest common field patterns
|
||||
return Some(items);
|
||||
)]);
|
||||
}
|
||||
},
|
||||
| _ => {},
|
||||
@@ -494,16 +489,18 @@ fn determine_context(text: &str, offset: usize) -> CompletionContext {
|
||||
|
||||
for (_offset, token, _end) in &tokens {
|
||||
match token {
|
||||
| Token::LBrace => nesting_level += 1,
|
||||
| Token::LBrace => {
|
||||
nesting_level += 1;
|
||||
if seen_colon_without_brace {
|
||||
// Opening brace after colon - we've entered the block
|
||||
seen_colon_without_brace = false;
|
||||
}
|
||||
},
|
||||
| Token::RBrace => nesting_level = nesting_level.saturating_sub(1),
|
||||
| Token::Colon => {
|
||||
// Mark that we've seen a colon
|
||||
seen_colon_without_brace = true;
|
||||
},
|
||||
| Token::LBrace if seen_colon_without_brace => {
|
||||
// Opening brace after colon - we've entered the block
|
||||
seen_colon_without_brace = false;
|
||||
},
|
||||
| Token::Ident(keyword)
|
||||
if matches!(
|
||||
keyword.as_str(),
|
||||
|
||||
Reference in New Issue
Block a user