Add infrastructure for keyword documentation #2581
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
This PR adds the basic infrastructure for #2227, so that we can slowly document keywords and even receive help from the community in doing so.
Implementation
The idea is to show a short sentence on hover/completion with a link to longer form documentation.
The way I went about this is to add a separate directory with all of the static documentation in Markdown files. Those files are never read by the LSP, we just link to them from the hover markdown. Clicking on the link will open the documentation on the user's editor.
After this infrastructure is merged, the work to document more keywords is simply:
ALLOWED_TARGETS
:on_next_node_enter
)static_docs.rb
andstatic_docs/some_keyword.md
, respectivelyAutomated Tests
Added tests.
Manual Tests
yield.md
file