Skip to content

Add annotater editor - #2658

Open
Earthcomputer wants to merge 5 commits into
devfrom
annotater
Open

Earthcomputer wants to merge 5 commits into
devfrom
annotater

Conversation

@Earthcomputer

Copy link
Copy Markdown
Member

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.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant