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

langium common attributes require a custom valueconverter #6454

Closed
dandaviesbrackett opened this issue Apr 3, 2025 · 1 comment
Closed
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect

Comments

@dandaviesbrackett
Copy link

Description

While developing a new chart type, I came across some awkwardness in common.langium. As currently specified, the common attributes title, accTitle, and accDescr are terminals whose regex captures the initial literal. This causes two problems:

  1. it requires a custom ValueConverter to capture only the "actual" values, which is unnecessary complexity and also introduces repeated regular expressions between common.langium and the valueconverter
  2. It is confusing when using Langium's online playground as the values for title, accTitle, and accDescr in the playground AST don't match the ones that Mermaid will result in.

Steps to reproduce

  1. paste any diagram type's .langium into the Langium playground
  2. replace the import of common.langium with the content of common.langium
  3. write a diagram in the middle pane that includes a title, accessible title, and accessible description
  4. BUG: note that the values for title, accTitle, and accDescr begin with the words "title", "accTitle", and "accDescr" respectively

Screenshots

No response

Code Sample


Setup

  • Mermaid version: main, as of 3 april 2025

Suggested Solutions

rejig the grammar in common.langium to avoid needing the value converter

Additional Context

I'll post a PR that closes this soon :)

@dandaviesbrackett dandaviesbrackett added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Apr 3, 2025
@dandaviesbrackett
Copy link
Author

I was overly ambitious with this - I had 85% of a solution, but it doesn't actually work. The existing grammar functions, this is a superfluous issue.

@dandaviesbrackett dandaviesbrackett closed this as not planned Won't fix, can't repro, duplicate, stale Apr 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

1 participant