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

[Enhancement] Add Power Query / M syntax highlighting to VS Code Markdown #205

Open
UWE-BIDEV opened this issue Aug 24, 2023 · 3 comments
Open
Assignees
Labels
good first issue Good for newcomers

Comments

@UWE-BIDEV
Copy link

UWE-BIDEV commented Aug 24, 2023

Would it be possible to support syntax highlighting in markdown files, please?
I've tried various keywords (i.e PowerQuery, powerquery, pq, mscript) and none of them seem to work in code blocks.

Many thanks

@UWE-BIDEV UWE-BIDEV added the enhancement New feature or request label Aug 24, 2023
@noah-severyn
Copy link

@UWE-BIDEV at least on Github, you can tag the code as fs. PQ is very similar to the F# language (source).

@mattmasson mattmasson added good first issue Good for newcomers and removed enhancement New feature or request labels Mar 19, 2024
@mattmasson
Copy link
Member

Changed the title of the issue.
This isn't really related to the vscode-powerquery extension, but I'll keep the issue here for tracking.
I've looked into enabling M syntax highlighting for common markdown rendering engines in the past. Each one does it a bit differently. I believe github still uses linguist. We had originally created a separate github repo for efforts around language definition files (https://github.com/microsoft/powerquery-language/), but we haven't been keeping it up to date. Ideally we'd have a centralized place to validate, test, and generate grammars used for this to make updates more sustainable.

We'd be happy to help out any community members that want to drive this effort, but I don't think we'll have much bandwidth to take it on ourselves in near future.

@mattmasson mattmasson changed the title [Enhancement] Markdown Support [Enhancement] Add Power Query / M syntax highlighting to github markdown Mar 19, 2024
@UWE-BIDEV UWE-BIDEV changed the title [Enhancement] Add Power Query / M syntax highlighting to github markdown [Enhancement] Add Power Query / M syntax highlighting to VS Code Markdown Mar 25, 2024
@UWE-BIDEV
Copy link
Author

Hi @mattmasson, thanks for your reply! This relates to VS Code, not GitHub, so I updated the title. :)

It would be good if syntax highlighting for Power Query code blocks worked by default when reading markdown files in VS Code.

I found a workaround (albeit a clunky one) using the Markdown Preview VS Code Highlighting extension (Link to visual studio marketplace here)

The version of shiki.js used in the extension didn't support Power Query / M yet, so I had to download the language file from GitHub and add it to the relevant folder.
C:\Users\Username.vscode\extensions\bierner.markdown-shiki-0.1.1\node_modules\shiki-languages\data\grammars
Then I had to add the keyword powerquery / pq into all the extension files as appropriate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

4 participants