-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Symbols create a tooling gap #13056
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
Comments
Added Area-Tools label. |
This comment was originally written by @seaneagan mailing list discussion: https://groups.google.com/a/dartlang.org/d/msg/misc/a0Fk1XSn6Fc/1DJvkLIkjc4J Refining some ideas from there:
symbolLiteral: librarySymbolLiteral: ‘#’ identifier (‘.’ identifier)* classSymbolLiteral: ‘#’ qualified classMemberSymbolLiteral: ‘#’ operator | (identifier '='?) libraryMemberSymbolLiteral: ‘#’ identifier '='? Examples: #MyClass Dot-less library identifiers could still conflict with class or member identifiers, but at least class identifiers have different naming conventions (UpperCamelCase).
class Symbol { Examples: const Symbol.fromType(MyClass) which could be improved a tiny bit with first class libraries. |
This comment was originally written by [email protected] I just caught by doing a refactor rename of a field, and forgot to update the name of a symbol in my code. I understand, that it usually will not be possible to rename these automatically as the symbol could refer to any number of methods/getters in the code. But perhaps the editor could provide a warning if there are symbols with a matching name which may need to be updated. |
Removed Area-Tools label. |
This comment was originally written by @zoechi I guess https://code.google.com/p/dart/issues/detail?id=15793 could be solved with this one too if Symbol would expose a name property to get the string back from the symbol. |
Set owner to @scheglov. |
Removed this from the 1.6 milestone. |
Added NotPlanned label. |
This comment was originally written by @Andersmholmgren Oh no :-(. How come? |
Removed Area-Editor, Oldschool-Milestone-1.6 labels. |
Did you mean to set Oldschool-Milestone-7 ? Removed Oldschool-Milestone-1.7 label. |
It was "Oldschool-Milestone-1.6", so I just moved it to the next version when we possibly could do it. |
I somehow lost this Oldschool-Milestone-1.7 label. Added Oldschool-Milestone-1.7 label. |
:) Oldschool was just a housekeeping thing. We're want to avoid pushing issues from milestone to milestone, so best to leave milestone off for now. Thanks for reopening and recategorizing! Removed Oldschool-Milestone-1.7 label. |
Added NotPlanned label. |
Symbols are often used to refer to fields or classes. Currently, the tools aren't able to give good feedback or assistance when symbols are used. e.g. if a symbol that is meant to refer to a field name, the tools have no way to detect if the symbol was misspelled, and no way to help refactor-rename.
We now have symbols, which are often used to represent names in Dart code, I'm concerned we're losing some tooling ability.
e.g. this is common in Polymer.dart code:
bindProperty(this, const Symbol('timestamp'),
() => notifyProperty(this, const Symbol('second')));
The first symbol is the name of a field, the second symbol is the name of a getter. If I rename my field, the symbol is left untouched. And if I misspell the symbol name...
This lies at the intersection of tooling, API design, and maybe language. Do you think we can do better here? Should the API be changed or should the tools help here?
The text was updated successfully, but these errors were encountered: