Skip to content

Crash on Saving Malformed YAML Syntax Config #28

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

Closed
chrisdedman opened this issue Apr 1, 2025 · 2 comments · Fixed by #30
Closed

Crash on Saving Malformed YAML Syntax Config #28

chrisdedman opened this issue Apr 1, 2025 · 2 comments · Fixed by #30
Labels
bug Something isn't working

Comments

@chrisdedman
Copy link
Member

chrisdedman commented Apr 1, 2025

Describe the bug
When editing a YAML syntax config file, the application crashes if the formatting isn't right and you save the file. It could be if you forget to add an escape character, forget to add a required keyword in the YAML file, or forget to close your ending quotation mark.

To Reproduce
Steps to reproduce the behavior:

  1. Go to config/cpp.syntax.yaml
  2. Update one of the regex by removing the ending quotation mark, for example.
  3. Save the file, then open a C++ file
  4. The app should crash

Expected behavior
To prevent the app from crashing, we should have a mechanism that catches the error and displays an error message instead. Maybe even point out where the problem may be coming from.

Desktop:

  • OS: MacOS, Linux

hint: The catching mechanism should be implemented probably here:

void Syntax::loadSyntaxRules(const YAML::Node &config)

@chrisdedman chrisdedman added the bug Something isn't working label Apr 1, 2025
@chrisdedman chrisdedman moved this to Todo in CodeAstra MVP Apr 1, 2025
@Tervicke
Copy link
Contributor

Tervicke commented Apr 7, 2025

One way to fix the "if u forget to add the required keyword " is to try and catch exception and continue working on the next rules for eg take a look at this video .

2025-04-07.23-29-46.mp4

@chrisdedman
Copy link
Member Author

One way to fix the "if u forget to add the required keyword " is to try and catch exception and continue working on the next rules for eg take a look at this video .
2025-04-07.23-29-46.mp4

I love it. I think this is a good way to solve this problem, yes.

chrisdedman added a commit that referenced this issue Apr 8, 2025
Added the fix for #28 and also added a if condition to check validity of the color
@github-project-automation github-project-automation bot moved this from Todo to Done in CodeAstra MVP Apr 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
2 participants