feat(glua_doc_cli): add --gmod-annotations flag for parity with glua_check - #87
Merged
Merged
Conversation
AmyJeanes
added a commit
to AmyJeanes/gmod-addon-tools
that referenced
this pull request
Aug 19, 2026
…ck and glua_doc_cli Bumps glua_ls/glua_check to 1.2.0 and the annotations scrape to aae7341, and moves the GMod stubs off workspace.library onto gmod.annotationsPath fleet-wide. The stubs now reach both glua_check and glua_doc_cli through --gmod-annotations rather than as a library entry, which double-loaded them (the LSP reads gmod.annotationsPath too) and ordered them against a repo's own .luatypes overrides. - New Get-GmodAnnotationsArgs helper reads gmod.annotationsPath and resolves it; used by Invoke-GluaCheck, Test-GmodTyping, Invoke-WikiGen and Test-GmodAnnotation's Measure-GluaCheck (which previously measured glua_check without the stubs loaded). - Test-GmodLibraryPaths now enforces the new convention (glua-api off workspace.library, gmod.annotationsPath set) instead of the old ordering check. - glua_doc_cli gains the --gmod-annotations flag, so it resolves stub-inherited returns the same way glua_check does; sourced temporarily from our fork build until the flag ships upstream (Pollux12/gmod-glua-ls#87). - Refresh the library-overlap noise filter for glua_check 1.2.0's reworded warning. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CzM9mxWHmgA5b5d926jBH
…check glua_doc_cli could previously only load the GMod annotations by listing them on workspace.library. That double-loads them (the LSP reads gmod.annotationsPath too) and orders them against a project's own .luatypes overrides. glua_check already sidesteps this with a --gmod-annotations flag that registers the directory as a library workspace directly, bypassing config. Mirror that flag here. Without it, a return inherited from a GMod global (e.g. a method returning Vector) resolves to `unknown` in the generated type model. The flag calls the same add_library_workspace + WorkspaceFolder(is_library=true) path the existing library loop uses, so output is identical for callers that still list the annotations as a library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CzM9mxWHmgA5b5d926jBH
…ns_library Address review: guard with is_dir() (rejecting a file path) and use the same prioritize_gmod_annotations_library helper glua_check uses, instead of registering the directory as a separate library workspace. That inserts the annotations at the front of workspace.library so the existing library loop picks them up, matching glua_check's mechanism exactly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018CzM9mxWHmgA5b5d926jBH
AmyJeanes
force-pushed
the
feat/doc-cli-gmod-annotations
branch
from
August 23, 2026 21:37
12e746b to
4d4ccf2
Compare
Owner
|
Thanks for the PR! |
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.
Motivation
glua_checkalready accepts--gmod-annotations <dir>to load the GMod annotation set as a library workspace, independent ofworkspace.library.glua_doc_clihad no equivalent, so the only way to feed it the annotations was to list them onworkspace.library— which double-loads them (the LSP readsgmod.annotationsPathtoo) and orders them against a project's own.luatypesoverrides.Without the annotations loaded this way, a return inherited from a GMod global (e.g. a method returning
Vector) resolves tounknownin the generated type model.Change
Add
--gmod-annotations <path>toglua_doc_cli, mirroringglua_check:gmod_annotations: Option<PathBuf>field onCmdArgs.load_workspacegains the same parameter and the same load block —add_library_workspace(path)+WorkspaceFolder::new(path, true)— registering the directory as a library workspace exactly asglua_checkdoes. The block is copied verbatim fromglua_check'sinit.rs.run_doc_clithreadscmd_args.gmod_annotationsthrough.When the flag is absent it is a complete no-op, so existing callers are unaffected.
Testing
Verified against a real GMod addon workspace: with the flag,
glua_doc_cli's JSON type model resolves the same returnsglua_checkdoes (previouslyunknown), and the output is byte-identical to loading the annotations viaworkspace.library.cargo fmt/clippy -p glua_doc_cliclean.🤖 Generated with Claude Code
Greptile Summary
The PR adds a
--gmod-annotationsoption and prioritizes the selected directory through the shared Emmy configuration helper.Confidence Score: 4/5
The PR should not merge until equivalent annotation-directory paths preserve the existing library configuration and its ignore rules.
The new prioritization path can insert an unrestricted duplicate ahead of a configured annotation library when the same directory has different textual path spellings, causing ignored files to enter the generated documentation model.
Files Needing Attention: crates/glua_doc_cli/src/init.rs
Important Files Changed
--gmod-annotationsargument.Reviews (2): Last reviewed commit: "refactor(glua_doc_cli): mirror glua_chec..." | Re-trigger Greptile