Remove highlighting on various non-top-level builtins #53
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So I figure, as long as we're already considering a 2.0 release due to #37, why not remove highlighting on some things that shouldn't be highlighted?
Since before I started working on this,
call
and other address members have been highlighted as top-level builtins. They're not. The justification for this highlighting is that, in Solidity versions prior to 0.5.0, if you used one of these as a name for a function, it could cause problems for you, so they were highlighted as if they were top-level builtins to point this out.Well, Solidity 0.4.x isn't used that much anymore (let alone any Solidity prior to that). Also, highlightjs isn't even really suited to being used in the sort of situations where that sort of highlighting would be relevant; as best I can tell, it really is for highlighting source files that are already complete, not ones that are in the process of being written. E.g., it doesn't provide a way to highlight illegal syntax; its
illegal
mechanism is for saying "nope that can't be this language", not for saying "you should highlight this as forbidden". That's why highlightjs-solidity doesn't for instance bother including Solidity's long list of reserved-but-unused keywords in its highlighting.So, I think we can remove these by this point. They're already highlighted as builtins in their appropriate context by other mechanisms; there's no need for them to be highlighted in all contexts.
I'd remove the highlighting on
self
as well, but, well, that's a separate issue and I expect a more contentious one, so I figure let's just leave that alone for now...(Also, I just noticed that there wasn't a space between
log4
andsend
, meaning that rather than highlighting the [rarely used and now removed]log4
builtin and the [not a real builtin as per above]send
builtin, we were instead highlighting the identifierlog4send
, if anyone ever happened to use such a thing! Uh, if we don't merge this, then we should instead merge a fix for that.)