-
Notifications
You must be signed in to change notification settings - Fork 23
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
[Feature-Request] add completion for hook methods #7
Comments
Detecting dynamic methods is tricky. I might be able to make it work in limited cases, but there will always be exceptions. The only 100% reliable solution is to execute the code, which Solargraph intentionally avoids doing. One alternative is to use YARD directives. Example using the @!method directive:
Note: suggestions from YARD directives will only be available if the file is included in the generated .yardoc directory. By default, YARD only reads the workspace's lib and app directories. That setting can be changed with a .yardopts file. A future version of the Solargraph gem might be able to parse directives locally. I'm open to other suggestions for improving detection of dynamic methods. It's a hard problem. |
As of gem version 0.15.0, there are two additions that can help with this feature:
|
Very Nice!! I'll try it as soon as possible |
it is a common practice for ruby programmers to add methods dynamically when some modules are extended, prepended or included. For example:
the same functionality would be great for the other ruby hook methods and for
klass.instance_eval
methodThe text was updated successfully, but these errors were encountered: