Well contextual keywords exist in other languages, its a method to add more keywords without forcing all existing code having to change existing names immediately because in the context where the keyword does not clash with existing names there is no issues eg C++ has contextual keywords (the second table). The C++11 and C++20 keywords are in filetypes.cpp and yeah, it is legal for those names to be used as variable names outside the context but they will be styled wrong. That is not just Geany, other non-LSP editors have the same issue, but LSPs should be ok?

After the new keywords are standardised by a language new code created by users will mostly not use those names as variables to avoid confusion, and overtime existing code that has those as names will slowly be changed, again to avoid confusion. So for most users having the contextual keywords styled is best as over time the world will move to only using the word as a keyword.

var var = 0;  // well "var" as the variable is pretty meaningless anyway, would be better to be a useful name
var some_meaningful_var = 0;  // thats better ;-)

To summarise, I would advise to include keywords that are defined by the language in the filetype file (any language).


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <geany/geany/pull/4014/c2439765133@github.com>