Skip to content

fix: Supporting syntax highlighting for TOML-formatted values when viewing KV in the Consul GUI#23131

Closed
majiayu000 wants to merge 3 commits intohashicorp:mainfrom
majiayu000:fix-12668-supporting-syntax-highlighting-1228-2234
Closed

fix: Supporting syntax highlighting for TOML-formatted values when viewing KV in the Consul GUI#23131
majiayu000 wants to merge 3 commits intohashicorp:mainfrom
majiayu000:fix-12668-supporting-syntax-highlighting-1228-2234

Conversation

@majiayu000
Copy link
Copy Markdown

Summary

This PR fixes #12668

Changes

  • ui/packages/consul-ui/app/components/consul/kv/form/index.hbs
  • ui/packages/consul-ui/app/components/consul/kv/form/index.js
  • ui/packages/consul-ui/app/helpers/toml-extension.js

This adds TOML syntax highlighting as an option for viewing and editing
Key/Value entries in the Consul GUI.

Changes:
- Add Format dropdown selector (JSON, YAML, HCL, TOML) when Code mode is enabled
- Create toml-extension helper using @codemirror/legacy-modes/mode/toml
  for CodeMirror 6 TOML syntax highlighting via @CustomExtensions
- For CodeBlock (readonly view), TOML falls back to HCL highlighting
  since HDS CodeBlock doesn't natively support TOML

Closes hashicorp#12668

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Signed-off-by: majiayu000 <1835304752@qq.com>
@majiayu000 majiayu000 requested review from a team as code owners December 28, 2025 14:51
@github-actions github-actions Bot added the theme/ui Anything related to the UI label Dec 28, 2025
@hashicorp-cla-app
Copy link
Copy Markdown

hashicorp-cla-app Bot commented Dec 28, 2025

CLA assistant check
All committers have signed the CLA.

@hashicorp-cla-app
Copy link
Copy Markdown

CLA assistant check

Thank you for your submission! We require that all contributors sign our Contributor License Agreement ("CLA") before we can accept the contribution. Read and sign the agreement

Learn more about why HashiCorp requires a CLA and what the CLA includes

Have you signed the CLA already but the status is still pending? Recheck it.

@repairman29
Copy link
Copy Markdown

Hi! I'm interested in contributing to this. Let me know if you'd like to discuss the implementation approach.

(Connected through Echeo)

@github-actions
Copy link
Copy Markdown

This pull request has been automatically flagged for inactivity because it has not been acted upon in the last 60 days. It will be closed if no new activity occurs in the next 30 days. Please feel free to re-open to resurrect the change if you feel this has happened by mistake. Thank you for your contributions.

@github-actions github-actions Bot added the meta/stale Automatically flagged for inactivity by stalebot label Mar 11, 2026
@majiayu000 majiayu000 closed this Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

meta/stale Automatically flagged for inactivity by stalebot theme/ui Anything related to the UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Supporting syntax highlighting for TOML-formatted values when viewing KV in the Consul GUI

2 participants