jonnyboyC / kos-language-server

A language server for the Kerboscript (kOS) a language for Kerbal Space Program
MIT License
25 stars 6 forks source link

[BUG] Language server warns about indexing lexicons within lexicons #82

Closed jefferyharrell closed 5 years ago

jefferyharrell commented 5 years ago
@LAZYGLOBAL OFF.

DECLARE LOCAL foo IS LEXICON().

SET foo["bar"] TO LEXICON().

SET foo["bar"]["baz"] TO "hello".

PRINT(foo["bar"]["baz"]).

...is valid and works, but the language server puts a warning under the second open bracket in the expression foo["bar"]["baz"], saying

Can only index a list, lexicon or string

In this case, foo["bar"] is itself a lexicon, so the syntax foo["bar"]["baz"] is totally valid. I think the language server isn't noticing that foo["bar"] has been declared and initialized as an empty lexicon.

I can imagine that this one might be a real challenge to resolve. Let me note that it's not a serious problem since the warnings are only visible if I mouse-over them. On the other hand, spurious warnings make it a little harder to spot legit ones, so I thought I'd report it just in case.

jonnyboyC commented 5 years ago

Fixed with version 0.10.0