-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
Preview Handler for developer files #15138
Conversation
@Aaron-Junker Sory for not commenting in code. GitHub app can't load the file list. It's to big. 😅 |
I didn't knew foreach existed in C#. I thought this was a PHP only thing😅. Will adress this for the next release. |
You can do something like |
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.
I took another look, but basically I already did a review while integrating monaco into powertoys. I found few minor issues. Would be nice to solve right now, but non-blocking imho
EDIT : Please don't merge, wait for at least one more approve
{ | ||
try | ||
{ | ||
JsonDocument a = JsonDocument.Parse(File.ReadAllText(Settings.AssemblyDirectory + "\\languages.json")); |
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.
nit: a
not a very descriptive var name..
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.
Forgot this placeholder 😅
/// This event cancels every navigation inside the webview | ||
/// </summary> | ||
[STAThread] | ||
private void NavigationStarted(object sender, CoreWebView2NavigationStartingEventArgs e) |
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.
this is never called?
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.
Technically it shpuld be registered as eventhandler. But I'm not 100% sure
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.
Left some comments.
After building and installing, I can't seem to open settings;
Description: A .NET Core application failed.
Application: PowerToys.Settings.exe
Path: C:\Program Files\PowerToys\Settings\PowerToys.Settings.exe
Message: Error:
An assembly specified in the application dependencies manifest (PowerToys.Settings.deps.json) was not found:
package: 'Microsoft.Web.WebView2.Core', version: '255.255.255.255'
path: 'Microsoft.Web.WebView2.Core.winmd'
I'm assuming this was caused by #15707
@@ -7,7 +7,7 @@ Param( | |||
) | |||
|
|||
$DirPath = $targetDir; #this file is in pipeline, we need root. | |||
$items = Get-ChildItem -Path $DirPath -File -Include *.exe,*.dll -Recurse -Force -ErrorAction SilentlyContinue | |||
$items = Get-ChildItem -Path $DirPath -File -Include *.exe,*.dll,*.ttf -Recurse -Force -ErrorAction SilentlyContinue |
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.
Do ttf files need to be signed?
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.
@crutkas said yes. He will look into it in a future PR
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.
Should they be OTF instead?
@@ -127,7 +128,7 @@ | |||
<Custom Action="TelemetryLogUninstallSuccess" After="InstallFinalize"> | |||
Installed and (NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL") | |||
</Custom> | |||
<Custom Action="UnApplyModulesRegistryChangeSets" Before="InstallFinalize"> | |||
<Custom Action="UnApplyModulesRegistryChangeSets" Before="RemoveFiles"> |
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.
Why did this change?
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.
I think because we need some of the files we then remove in the next step.
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.
@htcfreek is correct, to unapply the monaco handler registry changes from CA installer, we need to read languages.json file to get a list of extensions the handler is used for.
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.
I've been mostly focused on installer/registry-related changes, and they look good to me.
@jaimecbernardo that is saying settings is requesting WebView2 which shouldn't be needed for settings app |
I think it's related to what @niels9001 did with bumping versions.. I'll revert those.. We can deal with it later |
Maybe it's this change in v2.8: microsoft/microsoft-ui-xaml#5929 |
once @jaimecbernardo / @stefansjfw approve, the merge can be all yours. Great job |
@jaimecbernardo I pushed revert commits, can you give it another tests to doublecheck it? After that , if everything is ok, It's good to go IMHO |
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.
LGTM now!
Great work here!
Thanks a lot for this!
Feel free to squash merge @Aaron-Junker .
🚀🚀🚀🔥🔥🔥🔥🚀🚀🚀🚀🚀🚀🔥🔥🔥🔥🔥 🚢🚢🚢🚢🚢 |
Niiiiceee! 🎉🎉 |
Coooool. It's ready to use now. 🚀👏 |
Just trying this with v0.55.0. Really fantastic work to achieve this. It has been missing in Windows for so long. |
Currently there's not an easy way to add costum types.
Thank you! |
Thanks for adding the request!
or
Filetypes of PerceivedType=text always show in the Preview pane so It was often recommended to add PerceivedType=text to a filetype as a hacky workaround to make it visible in the Preview pane. With Preview Handler for developer files .sql shows with syntax highlighting as a named filetype in your code but .text and many others of PerceivedType=text still show as the default Windows white preview pane. |
You could manually copy the registry key of a file type that uses the new design to another one. |
Summary of the Pull Request
What is this about:
Adds the preview handler for developer files. I open this PR, as integration is planned for january release (0.55). Here can things regarding the integration be discussed.
What needs to be done:
Clint's list
Add unit tests for developer preview #15749)
Aaron's list:
settings.cs
):Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA.