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

Raw SQL strings should be specified as an embedded language in package.json #623

Open
a-stewart opened this issue Jan 20, 2023 · 3 comments

Comments

@a-stewart
Copy link
Contributor

We have some nested syntax highlighting, eg SQL which colours as expected, however, bracket matching does not work, and it just shows the outer brackets of the string.

image

I think if we specify that SQL is an embedded language in package.json, we should get bracket matching according to https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#embedded-languages. It seems to work as expected in Markdown which does specify that.

https://github.com/microsoft/vscode/blob/main/extensions/markdown-basics/package.json#L38

I had a quick play and tried just setting it up but it didn't work - I think potentially this is due to the fact that in markdown, the scope the embedded language points to is just the embedded SQL, whereas with C++, the scope also includes R"sql( and )sql either side.

I didn't get enough time to look into this into much detail though.

@jeff-hykin
Copy link
Owner

jeff-hykin commented Jan 20, 2023

As far as I can tell, SQL (left side) and SQL inside of C++ (right side) are highlighted the same.

Screen Shot 2023-01-20 at 11 46 05 AM

Maybe I'm misunderstanding, or maybe the issue is something with the SQL syntax rather than the C++ syntax?

@jeff-hykin
Copy link
Owner

I'm going to go ahead and close this, but I'll reopen it if you think its still a problem

@a-stewart
Copy link
Contributor Author

a-stewart commented Feb 3, 2023

Sorry, I missed that you had replied.

Syntax highlighting is working fine, what is missing is bracket matching.

I think to get bracket matching to work, you have to specify that sql is an embedded language in package.json

@jeff-hykin jeff-hykin reopened this Feb 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants