-
Notifications
You must be signed in to change notification settings - Fork 27
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
fix: enable auto-complete for methods overriding #245
Conversation
Hello @m8524769 Can you explain how this change helps support "auto-complete for methods overriding"? |
Hi @bd82 Thanks for your reviewing. And the current version doesn't support it, hope this helps :) |
This GIF was very helpful, now I understand. By add Now the only questions remaining is in regards to UI5 semantics.
@codeworrior @petermuessig : Thoughts? Feedback? |
I think most of the public methods in UI5 classes are allow you to override them, although it is dangerous to do so, and for some important methods, they will be marked as In the other hand, this behavior is quite similar with ES6 class using BTW, I think documentation is more important and useful than auto-complete. Anyway, this is just a small suggestion :) |
@bd82 there's no simple answer to your questions. In custom control development, it is common that subclasses override some method from their base class. Very heavy controls might have methods that they don't want to be overridden (e.g. the template method in a template/hook pattern), but that's not the 100% case. But in application development (when subclassing Unfortunately, neither JavaScript nor TypeScript provide a simple mean to technically prevent this (there's no That being said, I would love to prevent code completion for non-hooks. But a) there's no easy way to make this separation available in a generic way and b) the analogy to ES6 classes is so appealing that I have to surrender :-) @petermuessig or @akudev: do you want to be the last man standing? |
okay I will merge this next week if there are no objections. |
Btw, to me this sounds like the "right tool" for the job here may be custom ESLint validations |
Not sure if eslint rules really work out in that context. To my understanding, one basic design rule for eslint rules is that they operate locally (on a single file) only. The checks we discuss here require knowledge about the inheritance tree, which might be spread across multiple sources / projects. At least not a "perfect fit" for eslint rules, IMO. |
The eslint typescript plugin has support for more context, So perhaps it is possible in an advanced ESLint plugin. |
@codeworrior : as a last man standing comment I can confirm, that I do not see an issue with exposing those functions in the code completion. |
This was released in: Now it is up for UI5 team (@codeworrior @petermuessig ) to update the version used in the UI5 build process. |
No description provided.