DanielGavin / ols

Language server for Odin
MIT License
439 stars 67 forks source link

Add `.Nil` member to `SymbolUntypedValue.type` for `nil` #377

Closed thetarnav closed 4 months ago

thetarnav commented 5 months ago

Change symbol for nil from SymbolBasicValue to SymbolUntypedValue

Enable semantic tokens for identifiers with SymbolBasicValue symbol value. Previously I disabled it (in #263) because nil was included there, which made it be highlighted as a type.

.Nil variant is not entirely correct, because nil cannot function as a value with "untyped type". It needs a concrete type. So doing it properly would probably mean getting the type from the context. Not sure.

Maybe instead of adding .Nil variant, nil shouldn't get any symbol? Since any declaration needs an explicit type, the symbol for the identifier will get it's type, from the type, not value. (Did that in #378)