Skip to content

hls: report the same diagnostics as the CLI for a file - #1318

Merged
BrettMayson merged 1 commit into
mainfrom
hls-cli-dedupe
Aug 31, 2026
Merged

hls: report the same diagnostics as the CLI for a file#1318
BrettMayson merged 1 commit into
mainfrom
hls-cli-dedupe

Conversation

@LinkIsGrim

Copy link
Copy Markdown
Collaborator

Both sides preprocess, parse and analyze a file the same way, then each collected the resulting codes separately.

Preprocessor warnings reached hemtt check and never the editor: pw1_redefine, pw2_invalid_config_case, pw3_padded_arg, pw4_include_case, pw5_undef_not_defined. So did every config note and help, because the editor took only warnings() and errors() from the report while the CLI also pushed notes_and_helps().

hemtt_sqf::check and hemtt_config::check now own that middle. They fold processed.warnings() in with the lint codes, apply the CBA settings skip, and hand back the codes plus whatever the caller still needs. The ends stay where they were: the CLI compiles, rapifies and pushes to the addon, the language server renders LSP diagnostics and maintains its caches.

Diagnostic::to_lsp, emitted one diagnostic per label using the parent code's message and severity. A secondary label therefore became a second diagnostic repeating the parent's message somewhere it did not apply: PW1 marked the previous definition "redefining macro" as though it were the redefinition, and discarded the label's own "previous definition here". It now emits one diagnostic per primary label, falling back to all of them if a code has no primary. That applies to every multi-label diagnostic, not only PW1.

Verified against a project built to trigger each case. PW1, PW5 and help[L-C12] were reported by hemtt check and never published by the editor; they now appear in both, at the same locations.

@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.2%. Comparing base (3cc53f9) to head (571a662).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
libs/sqf/src/check.rs 90.4% 7 Missing ⚠️
libs/config/src/check.rs 89.0% 6 Missing ⚠️
bin/src/modules/rapifier.rs 71.4% 2 Missing ⚠️
bin/src/modules/sqf.rs 93.7% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
libs/config/src/lib.rs 78.7% <ø> (-9.1%) ⬇️
libs/sqf/src/lib.rs 74.7% <ø> (ø)
libs/workspace/src/reporting/diagnostic/mod.rs 86.3% <100.0%> (+19.3%) ⬆️
bin/src/modules/sqf.rs 62.8% <93.7%> (+4.4%) ⬆️
bin/src/modules/rapifier.rs 81.3% <71.4%> (+4.7%) ⬆️
libs/config/src/check.rs 89.0% <89.0%> (ø)
libs/sqf/src/check.rs 90.4% <90.4%> (ø)

... and 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Both sides preprocess, parse and analyze a file the same way, then each
collected the resulting codes separately - and the two collections had
drifted apart.

Preprocessor warnings reached `hemtt check` and never the editor:
`pw1_redefine`, `pw2_invalid_config_case`, `pw3_padded_arg`,
`pw4_include_case`, `pw5_undef_not_defined`. So did every config note and
help, because the editor took only `warnings()` and `errors()` from the
report while the CLI also pushed `notes_and_helps()`.

`hemtt_sqf::check` and `hemtt_config::check` now own that middle. They fold
`processed.warnings()` in with the lint codes, apply the CBA settings skip,
and hand back the codes plus whatever the caller still needs. The ends stay
where they were: the CLI compiles, rapifies and pushes to the addon, the
language server renders LSP diagnostics and maintains its caches.

This also fixes `Diagnostic::to_lsp`, which emitted one diagnostic per
label using the parent code's message and severity. A secondary label
therefore became a second diagnostic repeating the parent's message
somewhere it did not apply: `PW1` marked the previous definition
"redefining macro" as though it were the redefinition, and discarded the
label's own "previous definition here". It now emits one diagnostic per
primary label, falling back to all of them if a code has no primary. That
applies to every multi-label diagnostic, not only `PW1`.

Verified against a project built to trigger each case. `PW1`, `PW5` and
`help[L-C12]` were reported by `hemtt check` and never published by the
editor; they now appear in both, at the same locations.
@BrettMayson
BrettMayson merged commit 80ad89d into main Aug 31, 2026
36 checks passed
@BrettMayson
BrettMayson deleted the hls-cli-dedupe branch August 31, 2026 02:23
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.

2 participants