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

Syntax highlighting could use improvement #1950

Closed
minestarks opened this issue Oct 4, 2024 · 1 comment
Closed

Syntax highlighting could use improvement #1950

minestarks opened this issue Oct 4, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@minestarks
Copy link
Member

The TextMate grammar used for Q# syntax highlighting in VS Code is missing some patterns that would help the syntax highlighting look nicer.

Compare:

image

The Q# looks pretty boring in comparison to other languages with good support.

I think we can start by defining patterns for function calls and numeric literals, which are seen in these screenshots. There may be others that are interesting as well.

@minestarks minestarks added enhancement New feature or request good first issue Good for newcomers needs triage labels Oct 4, 2024
@Morcifer
Copy link
Contributor

Morcifer commented Jan 2, 2025

Hi @minestarks, @sezna, can I pick this one up?

I have function definitions, function calls, numbers and variables all working.

However, function calls and variables also end up applied to attributes and to imports. Is it better that I make designated rules for them as part of this issue, or would it be better to make a followup?

Image

(this comment was edited several times as I kept working on the issue, sorry about that).

github-merge-queue bot pushed a commit that referenced this issue Jan 7, 2025
Supports syntax highlighting for:

- function definitions
- function calls
- numbers
- variables

See issue #1950.

The change for function calls also applies to operation definitions and
to attributes (see bigger example below).
The change for variables also applies to attributes and to imports.

I might be nice to make attributes and imports get their own designated
rules. I can do them as part of this PR, but I think it might be best to
do as a followup issue - because I believe this PR is actually already
an improvement for them.

Simple example for the change (from the original issue description):


![image](https://github.com/user-attachments/assets/cab2630b-0e28-4d48-a98e-7e5bc83e5c7c)

And a bigger example:


![image](https://github.com/user-attachments/assets/7d0c059a-8481-4159-ba64-d8539f1540c0)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants