-
-
Notifications
You must be signed in to change notification settings - Fork 146
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
autocomplete for attributes #243
Comments
I just noticed that there is already autocompletion for available files for Is it possible to use this to generate the autocomplete for attribute which are defined in the same file? To be more specific for this feature: Imagine you have a file like this
and as you can see, in the example, it would be great to get with opening the |
I 100% support this idea. Keep in mind, you may want to include the built-in (aka predefined) attributes to this list. |
To add to that point, this feature gets us one step closer to an "IDE for writers". |
@mojavelinux Where would I find a list of all predefined attributes? @rdmueller would it be ok if I would present attributes that are defined in any of the files in the project? Assuming that people work with includes in larger projects, this might make sense?! |
If you've parsed a blank document, these attribute names are available via Document#getAttributes(). Otherwise, they are listed here: https://asciidoctor.org/docs/user-manual/#attribute-catalog |
@ahus1 : Inthought it would be easier to only display the attributes of the current document to get started. Also, if the value is displayed (which is quite important in my example) this could betricky with the attributes of any document. But if this is easier, go ahead! |
@rdmueller - most of what is needed for a first implementation to auto-complete the variable names from the current and other files is in 071a295 (this includes one or two refactorings that won't be necessary here any more) and 6bdb22c (a little addendum in ). From there the course can continue to add current values and variable descriptions - but that's a second step. |
I created a pull request with lexer and highlighting for attributes #260. No auto-complete or "link" for now (there should be 2 auto-complete , one for the reference and one for the declaration (:toc: for example) ). |
@bbrenne - thank you for this PR, I just merged it. It provided documentation for all built-in attributes and autocomplete. |
@bbrenne - I'm on a train and gave it a try, will commit it soon. |
Thank you to @bbrenne for contributing this change! Autocomplete for attributes works now for built-in-attributes when defining them (inside ":"). Autocomplete for attributes that are defined within the projects works (inside "{}") Built-In attributes have documentation (Alt-Q on Windows). Renaming of variables and find-usages works as well. This is part of pre-release 0.28.4. It is available from GitHub releases and the IntelliJ AsciiDoc EAP repository. Please give it a try for corner cases and usability. Comment in this ticket with regarding what you experience vs what you expect. |
Wow. this is all so cool and more than I had imagined! But I still have to figure out how the documentation Feature (Alt-Q) works. doesn't work for me yet... |
found it (Help -> find action): my shortcut on windows for Quick Documentation is Ctrl-Q. |
So, I opened up this issue and I am more than happy with the results. |
@rdmueller - it was always Ctrl-Q, my mistake. Happy to hear you like it. Kudos to @bbrenne! |
would be great if the editor pane would support auto-complete for defined attributes
The text was updated successfully, but these errors were encountered: