Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Inconsistent syntax highlighting #58

Open
flozender opened this issue Mar 24, 2020 · 3 comments
Open

Inconsistent syntax highlighting #58

flozender opened this issue Mar 24, 2020 · 3 comments
Labels

Comments

@flozender
Copy link

flozender commented Mar 24, 2020

Describe the bug
Syntax highlighting is not consistent among type names.

To Reproduce
Steps to reproduce the behavior:

  1. Go to any .cto model, with the VSCode extension enabled.

Expected behavior
All type names should have consistent highlighting.

Screenshots
ss5
PaymentRequest is highlighted, but PayOut isn't.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser N/A
  • Version N/A
@jeromesimeon
Copy link
Member

This looks like a bug to me. My general intuition is that the syntax highlighting should use colors based on the category of tokens in the grammar: one color for all keywords, one color for all type names, etc.

@flozender
Copy link
Author

That sounds right, I will try to see if I can fix it.

@prakharsr
Copy link

prakharsr commented Oct 31, 2020

I am unable to understand the exact solution approach after exploring a bit. What i found was that PaymentRequest is getting captured as a support object either as "support.variable.dom.js" or as "support.class.dom.js" , in the concerto.tmLanguage.json file. (Image - https://imgur.com/a/MWIuYEp).
So, should PaymentRequest -

  1. have the same color highlighting as PayOut and its other capturing group is overriden when used with a class definition before its declaration
  2. remain as it is (not have the same color), but should throw error because it has already been captured and been declared as another type.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants