-
Notifications
You must be signed in to change notification settings - Fork 591
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Erlang] Variables, modules, record names and fields are indistinguishable #2372
Comments
Ping @deathaxe |
With regards to https://www.sublimetext.com/docs/3/scope_naming.html, what top-level scope would you choose for I know Erlang has the concept of The Some legacy syntaxes use That said, the main goal is to define semantically acceptable/correct consistent general purpose scope names, which can be used by color schemes to provide a consistent UX for as many syntaxes as possible with minimal effort. We do not want to hack scope names to match certain color schemes as it fails with most of them anyway. I'd be fine to modify scopes which fulfill that requirement. Otherwise Here's my look with a slightly modified Brackets Dark Just added
... next to some other tweaks to properly highlight operators and punctuations. |
If the For example, I think using The downside with the current scope naming conventions is that they have an object oriented heritage. That can be seen in the The problem with Erlang is that ideally the following would be coloured distinctly:
|
With regards to functions:
The original scope names come from TextMate. When studying its naming guidelines and comparing different syntaxes, I found many missing details and different solutions for compareable statements. Maybe because things moving forward? It looks like
You mean instead of What's more general? ST's scope naming guidelines suggest this scope for namespaces, modules, packages, etc. which all do nothing else than create certain lookup areas to avoid duplicated or insanely named functions. OK, the name itself is a bit C-style and may be a compromise for syntaxes which group functions/variables via modules or packages, but is there such a big difference semantically? I'd keep the
Reasonable.
I'll change the field scopes. Some general notes about records: In a record definition clause ( I am not quite sure about the real meaning of |
I agree about stickting to conventions. 👍 Could a possibility for module name scopes be
Records are like named structs. So Question is what scope to use for record. You don't want the |
Actually, looking through the suggestions for various |
The guidelines can't provide details for any kind of syntax as each of them comes with unique features and concepts. It therefore can just be a base to start with. The RFC issues have been created to discuss possible extensions, but following them quickly reveals all the different apsects and oppinions about certain points of syntaxes. Therefore it's hard to find common conclusions. The basic rules I try to stick to are:
Records Your description sounds very much like an instantiation of a class in C++/Java. Hence Note: C++/Java use Modules
The scope naming guileline proposes If a further distinction is wanted, we could propably define ...
Java would need that as it distinguishes between packages and modules for instance. |
I like your suggestions a lot. I think using the same scopes as class instantiations for Java makes sense, perhaps also coupled with the same scopes for class definitions when records are defined ( It makes sense to add the language scope at the end, of course. In my observation almost no color schemes actually makes use of these, except for very common languages, so therefore I wanted to make the top level scopes more expressive if possible. If what you propose under |
That's the main reason to place the language scope to the end. A color scheme shouldn't need to be forced to use syntax specific rules. In a perfect world it would only need at most 3 levels of subscopes to address all required tokens.
I guess many syntaxes could profit from the latest ST4 branching features and therefore would need some attention anyway. With regards to In a more general manner it may result in a bit more work. But I guess the entity vs. variable scheme can't be applied to all syntaxes in all situations anyway. In python for instance, the static lexer can't know about which variable is the declaration (first usage) or which ones are references only. It more or less suggests to use those when possible or appropriate to help driving the Goto Definition vs. Goto Reference features in a consistent way. |
Everything is prefixed with
variable.
which makes color schemes highlight everything in the same color. In Erlang records, record fields and modules are not "variables".(Monokai color scheme on meck_proc.erl)
The text was updated successfully, but these errors were encountered: