You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Color sight console input the way the VS Code editor colors the same code - #450
sight console colored the same Stata code differently from the editor. Strings were green there and orange/red in the editor, macros magenta instead of light blue, comments gray instead of green, and quietly/if blue instead of purple. Nothing was broken, but switching between the editor and the console meant reading two different color schemes.
The console still uses only the terminal's 16 base colors, so it keeps following the user's terminal theme. Each kind of token now gets the base color closest to the hue that VS Code's default Dark+/Light+ themes give its grammar scope:
Token
Before
After
Editor scope
command
bold blue
bold blue
keyword (blue)
prefixes, if, else, foreach, while, …
blue / bold blue
magenta
keyword.control (purple)
in
blue
blue
keyword (blue)
string
green
yellow
string (orange / dark red)
number
cyan
green
constant.numeric (pale / teal green)
macro
magenta
cyan
variable (light blue / navy)
comment
dim
dim green
comment (green)
Strings get yellow because ANSI has no orange and red is already used for error output.
Proof: a new test pins the exact escape codes and fails on the old table. Control-flow tests cover if x {, quietly if x {, foreach, } else { and } else if x {. I also rendered before/after samples with VS Code's default terminal palette next to the editor's Dark+/Light+ token colors. Typecheck, lint and bun test ./tests pass.
Reviewed with sol-loop: 3 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code); reviewed by gpt-6.2-sol.
Summary by CodeRabbit
New Features
Updated console syntax highlighting to better match VS Code’s default themes: strings are yellow, numbers green, macros cyan, and comments dim green. Prefixes and control-flow keywords are magenta; other commands remain bold blue, and in is blue.
Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).
Limit details: You’ve used the included review currently available. Your 77 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Team
Run ID: 1544d420-85d0-4104-8c4a-191ef739d5be
Commits
Reviewing files that changed from the base of the PR and between bd0c7d8 and e94d530.
Files selected for processing: 1
tests/integration/console/console-pty.test.ts
No actionable comments were generated in the recent review.
Walkthrough
The console highlighter changes colors for strings, numbers, macros, comments, prefixes, and control-flow keywords. It also updates command-position handling after a closing brace. Unit tests and console documentation reflect the updated color mapping.
Changes: Console syntax highlighting
Layer / File(s)
Summary
Color mapping and command scope src/console/highlighter.ts, tests/unit/console/text-processing.test.ts, docs/console.md
The highlighter assigns updated colors to token types and command keywords. It leaves command-position state unchanged after RBRACE. Tests check the updated colors and command scope. The console documentation lists the syntax colors.
jbearak/sight#367: Changes lexer tokenization for // and ///, which can affect which token type the highlighter colors.
Merge Risk: Minimal · previous review bd0c7
This change recolors console syntax highlighting to match the VS Code editor. It has no functional or data impact and is easy to revert, so merge risk is minimal.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the main change: the sight console input colors are changed to match how the VS Code editor colors the same Stata code. The raw summary shows the changes to highlighter.ts, its tests, …
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the main change: the sight console input colors are changed to match how the VS Code editor colors the same Stata code. The raw summary shows the changes to highlighter.ts, its tests, and docs/console.md that implement this color mapping. The title is concise and specific, and it matches the PR objectives.
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
Source mode: Auto
Repository: Unavailable
Branch: Unavailable
File: No configuration file from this repository applied
Commit: Unavailable
Layers: Organization UI
Review profile: CHILL
Plan: Team
Run ID: a9f7f971-001f-49d6-bf8d-6846eecb199d
Commits
Reviewing files that changed from the base of the PR and between c23d188 and bd0c7d8.
Files selected for processing: 3
docs/console.md
src/console/highlighter.ts
tests/unit/console/text-processing.test.ts
Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 1 review per hour.
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
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.
sight consolecolored the same Stata code differently from the editor. Strings were green there and orange/red in the editor, macros magenta instead of light blue, comments gray instead of green, andquietly/ifblue instead of purple. Nothing was broken, but switching between the editor and the console meant reading two different color schemes.The console still uses only the terminal's 16 base colors, so it keeps following the user's terminal theme. Each kind of token now gets the base color closest to the hue that VS Code's default Dark+/Light+ themes give its grammar scope:
if,else,foreach,while, …inStrings get yellow because ANSI has no orange and red is already used for error output.
Proof: a new test pins the exact escape codes and fails on the old table. Control-flow tests cover
if x {,quietly if x {,foreach,} else {and} else if x {. I also rendered before/after samples with VS Code's default terminal palette next to the editor's Dark+/Light+ token colors. Typecheck, lint andbun test ./testspass.Reviewed with sol-loop: 3 rounds with gpt-6.2-sol. Sol verdict: approved
Created with Claude Opus 5.5 in Claude Code (T3 Code); reviewed by gpt-6.2-sol.
Summary by CodeRabbit
inis blue.