Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code editor additional languages #2684

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zamoore
Copy link
Contributor

@zamoore zamoore commented Feb 4, 2025

📌 Summary

If merged, this PR adds syntax highlighting support for JavaScript and Rego to the hds-code-editor modifier.

🛠️ Detailed description

  • Implements custom Rego StreamParser
  • Uses official JS parser for javascript

📸 Screenshots

🔗 External links

Jira tickets:
HDS-4452
HDS-4469


👀 Component checklist

💬 Please consider using conventional comments when reviewing this PR.

@hashibot-hds hashibot-hds added packages/components docs-website Content updates to the documentation website showcase labels Feb 4, 2025
Copy link

vercel bot commented Feb 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
hds-showcase ✅ Ready (Inspect) Visit Preview Feb 4, 2025 6:31pm
hds-website ✅ Ready (Inspect) Visit Preview Feb 4, 2025 6:31pm

Copy link
Contributor

@shleewhite shleewhite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested it out and looked good to me, just a couple small nits.

Ruby = 'ruby',
Shell = 'shell',
Go = 'go',
Hcl = 'hcl',
Javascript = 'javascript',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should it be JavaScript?

"@hashicorp/design-system-components": minor
---

hds-code-editor: Add language syntax highlighting suport for JavaScript and Rego
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should we include that theres a new dep @codemirror/lang-javascript?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-website Content updates to the documentation website packages/components showcase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants