diff options
| author | DanielGavin <danielgavin5@hotmail.com> | 2024-03-18 16:28:05 +0100 |
|---|---|---|
| committer | DanielGavin <danielgavin5@hotmail.com> | 2024-03-18 16:28:05 +0100 |
| commit | 6ffb4ef43c4ab2550e2e6deab2b9d45dcad298e7 (patch) | |
| tree | 0a87bb2d96ad1cc245819373a56eba21cc1d3430 /src | |
| parent | ff6d5c9bdd1646ea950f1d6571263797a8650c2e (diff) | |
Fix issues with empty parameter names treated as "_" by `core:odin/parser`
Diffstat (limited to 'src')
| -rw-r--r-- | src/server/semantic_tokens.odin | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/server/semantic_tokens.odin b/src/server/semantic_tokens.odin index a6872c7..3e2c6f6 100644 --- a/src/server/semantic_tokens.odin +++ b/src/server/semantic_tokens.odin @@ -7,7 +7,6 @@ import "core:odin/tokenizer" import "src:common" - /* Right now I might be setting the wrong types, since there is no documentation as to what should be what, and looking at other LSP there is no consistancy. */ @@ -138,6 +137,11 @@ write_semantic_node :: proc( type: SemanticTokenTypes, modifier: SemanticTokenModifiers, ) { + //Sometimes odin ast uses "_" for empty params. + if ident, ok := node.derived.(^ast.Ident); ok && ident.name == "_" { + return + } + position := common.get_relative_token_position( node.pos.offset, transmute([]u8)src, @@ -250,17 +254,6 @@ visit_node :: proc( #partial switch n in node.derived { case ^Ellipsis: - /* - Issue with parser pos not being correct. - write_semantic_string( - builder, - node.pos, - "..", - ast_context.file.src, - .Operator, - .None, - ) - */ visit(n.expr, builder, ast_context) case ^Ident: modifier: SemanticTokenModifiers |