Skip to content

Allow percentages without percent signs - #59

Merged
ViTeXFTW merged 2 commits into
devfrom
t3code/allow-bare-percentages
Jul 18, 2026
Merged

Allow percentages without percent signs#59
ViTeXFTW merged 2 commits into
devfrom
t3code/allow-bare-percentages

Conversation

@ViTeXFTW

Copy link
Copy Markdown
Owner

What changed

  • add the opt-in analysis.allowPercentagesWithoutSign analyzer/server setting
  • accept bare numeric percentage values when enabled while still rejecting malformed values
  • add a VS Code quick fix that enables the user setting from a bad-percent diagnostic
  • document the setting and cover both validation modes

Why

The game parser accepts percentage values without a trailing %, while ZeroSyntax intentionally required the sign. This keeps the strict behavior by default but lets users opt into engine-compatible syntax.

Validation

  • cargo test
  • cargo test -p zerosyntax-analysis --test spec
  • npm run compile
  • npm run compile:test

The Electron smoke runner did not reach extension tests because VS Code 1.129 rejected the runner's launch flags.

@greptile-apps

greptile-apps Bot commented Jul 18, 2026

Copy link
Copy Markdown

Greptile Summary

This PR adds an opt-in setting for accepting percentage values without %. The main changes are:

  • Adds analyzer support for bare numeric percentages behind analysis.allowPercentagesWithoutSign.
  • Wires the setting through language-server initialization and the VS Code extension.
  • Adds a VS Code quick fix to enable the setting from bad-percent diagnostics.
  • Documents the new setting and extends smoke coverage.

Confidence Score: 4/5

Safe to merge after addressing the non-blocking quick-fix targeting issue.

Core analyzer and server behavior are straightforward and covered by tests; the remaining issue is limited to quick-fix availability for malformed percentage values.

editors/vscode/src/extension.ts

T-Rex T-Rex Logs

What T-Rex did

  • Ran the Rust workspace tests for allow_percentages and confirmed all test suites passed with EXIT_CODE 0, including the diagnostics::tests::bare_percentages_are_opt_in.
  • Validated the analyzer specification against the allow_percentages scenario and confirmed EXIT_CODE 0 with test specs_hold passing.
  • Verified the VS Code proofs, including TypeScript compile and bundle success and the subsequent typecheck, for allow_percentages.

View all artifacts

T-Rex Ran code and verified through T-Rex

Important Files Changed

Filename Overview
crates/analysis/src/diagnostics.rs Updates percent validation to accept bare numeric percentages only when enabled and adds tests for strict and opt-in modes.
crates/server/src/backend.rs Reads the initialization option and applies it to the analyzer before serving diagnostics.
editors/vscode/src/extension.ts Passes the setting to the server and adds a quick fix, but the action is also offered for malformed percentage values it cannot fix.
editors/vscode/src/test/suite/smoke.test.ts Extends the smoke test to verify the bad-percent diagnostic and quick-fix availability.

Reviews (2): Last reviewed commit: "Merge dev into allow-bare-percentages" | Re-trigger Greptile

@ViTeXFTW
ViTeXFTW marked this pull request as ready for review July 18, 2026 14:32
@ViTeXFTW
ViTeXFTW merged commit ce89b45 into dev Jul 18, 2026
5 checks passed
ViTeXFTW added a commit that referenced this pull request Jul 19, 2026
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