Repository navigation
Add annotater editor - #2658
Open
Earthcomputer wants to merge 5 commits into
Open
Add annotater editor#2658Earthcomputer wants to merge 5 commits into
Earthcomputer wants to merge 5 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Adds an editor for annotater, Fabric's new Javadocs thing, allowing users to edit them and contribute from within the IDE.
Javadocs from the annotater appear as inlay hints in the Minecraft code, allowing the Javadoc to be changed while editing, while not physically changing the source code (which would break a lot of things). They appear as code with basic highlighting (not full highlighting) due to the complexity of running full highlighting. They are also not rendered like docs normally are in reader view, as that would require either some very hacky code or lots of code duplication.
When editing a Javadoc, the corresponding inlay hint is replaced with a mini editor. The text in this editor is a copy of the main Java file with Javadocs added, with all the code before and after the doc comment that is being edited folded out, so it appears that the editor only contains the doc comment. This enables the full Javadoc editing features of the IDE within this mini editor.
This feature has two modes: managed mode and custom mode. In custom mode, you point the mcdev to your own annotater clone, mcdev makes the edits but you handle the git operations required to contribute yourself. In managed mode, mcdev handles all the git stuff for you, including the clone and pull requests, packaging changelists into "contributions" (branches). This is to lower the barrier to contribution, increasing the likelihood that someone will fix an issue or document something on the fly as they are working on their own mod, without getting too sidetracked making an annotater clone.
I'll make a video demo shortly.
AI disclosure: this code was written using an AI agent, with multiple rounds of review and some manual edits.