-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
Adding new filetypes for developer file preview #17183
Conversation
@stefansjfw Could you please make the installer stuff:
This would be very nice. |
Sure. Could you please rebase this work on top of latest |
@Aaron-Junker |
…aco-new-languages
@stefansjfw I main master in |
src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandler.csproj
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandler.csproj
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandler.csproj
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/generateLanguagesJson.html
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/generateLanguagesJson.html
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/monaco_languages.json
Outdated
Show resolved
Hide resolved
Regarding reg format: Delete key [-hklm\key-to-delete] Delete value "value-to-delete"=- And let's have the constants in purple to look different in all color modes. Btw. there is a test wep page you can use to validate your colors. |
Tjis should be possible. Thanks for the suggestion.
I can't define the color just the type of a element. |
A note in doc/devdocs/modules/powerpreview/monaco/readme.md about how to add languages which don't have a reasonable mapping for in monaco would be good (likely "add to monaco first", but I haven't found information on that either). |
I agree. Will look what I can provide. What did you want to integrate? |
Whatever I stumble over :-) COBOL (.cob/.cbl) would likely be "totally new"; Side note: if ".in" isn't aliased to .txt altrit should be added, too, similar for .rc (I may have a manual provider as text setup, would need to check); automake (.am) should be aliased to Makefile; .sln + .vcxproj may be aliased to xml if there's no better match; |
I will add these too, |
Looks like I've asked in the wrong post, please add ".log", ".err", ".out" as text to fix #17506. |
@htcfreek I added your suggestions. @stefansjfw This is now ready for review |
I will add the docs later |
@Aaron-Junker return {
tokenPostfix: '.reg',
tokenizer: {
root: [
// Header (case sensitive)
[/Windows Registry Editor Version 5.00/, 'comment'],
[/REGEDIT4/, 'comment'],
// Comments
[/;.*/, "comment"],
// Keys
[/\[\-.*\]/, 'invalid'],
[/\\.*[^\]]/, 'keyword'],
// Values
[/@/, "keyword"],
[/\".*\"=\-/, "invalid"],
[/\".*\"(?=\=)/, "keyword"],
[/\".*\"(?!\=)/, 'string'],
[/((hex\({0,1}[0-9,a,b]*\){0,1})|dword):.*/, "string"],
// Hive names (case in-sensitive)
[/HKEY_CLASSES_ROOT/, 'type'],
[/HKEY_LOCAL_MACHINE/, 'type'],
[/HKEY_USERS/, 'type'],
[/HKEY_CURRENT_USER/, 'type'],
[/HKEY_PERFORMANCE_DATA/, 'type'],
[/HKEY_DYN_DATA/, 'type'],
[/hkey_classes_root/, 'type'],
[/hkey_local_machine/, 'type'],
[/hkey_users/, 'type'],
[/hkey_current_user/, 'type'],
[/hkey_performance_data/, 'type'],
[/hkey_dyn_data/, 'type'],
// Symbols (For better contrast on hc-black)
[/=/, 'delimiter'],
[/\[/, 'delimiter'],
[/]/, 'delimiter'],
]
}
} |
src/modules/previewpane/MonacoPreviewHandler/MonacoPreviewHandler.csproj
Outdated
Show resolved
Hide resolved
src/modules/previewpane/MonacoPreviewHandler/monacoSpecialLanguages.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did you test this?
I tried building installer and installing PT and monaco doesn't work even for old file types..
I added the files and registry keys manually. I will look why this happens. |
Sorry, my bad. You already asked for installer stuff and I somehow though I already did that. Here it is.. |
@Aaron-Junker Can you try the installer now and all new extensions? For me e.g. xslt doesn't seem to work, but wsdl works for some reason.. |
I forgot to generate a new monaco_languages.json file after adding xslt. |
Thanks. |
@Aaron-Junker |
@htcfreek As I stated above
|
Co-authored-by: htcfreek <[email protected]>
…ub.com/microsoft/PowerToys into user/aaron-junker/monaco-new-languages
this is still TBD, right ? |
Forgot about it. Should be ready now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good. nice work
isn't this shipped with 0.58.0? |
Yes why? |
Didn't work for me. .reg is not shown with dev preview. It's shown as plain text with I think default provider. |
Open a new issue. I will look this this weekend what is going on. |
Summary of the Pull Request
What is this about:
What is included in the PR:
A system to add costum file types. Only downside is that you have to copy paste the language definitions into
monacoSpecialLanguages.js
How does someone test / validate:
Install and test with new file types
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.