-
Notifications
You must be signed in to change notification settings - Fork 77
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
Under VS2022, in a styles file, ctrl-f opens a search window, and not the file's search box at the top right corner #231
Comments
Have found this too and it affects avalonia XAML files - quite irritating! |
@grokys I think I came up with a solution for this one. Seems to work well in VS2022 and did not break VS2019, but still It's rather ugly. Basically it is a hack on top of your previous hack. I'm not sure why, but (using dnSpy too) I saw that Visual Studio 2022 did not want to cast IVsFindTarget3 vsFindTarget = QuickFindUtilities.GetCurrentFindTarget() as IVsFindTarget3;
if (vsFindTarget == null || !QuickFindUtilities.IsAdornmentSupported(vsFindTarget))
{
QuickFindUtilities.LaunchFindInFiles(nCmdID == 230U);
return 0;
} So, in order to have this code go beyond and open the quick search box, I modified namespace Microsoft.VisualStudio.Editor.Internal
{
[ComImport]
[TypeIdentifier]
[Guid("A2F0D62B-D0DD-4C59-AAB8-79CD20785451")]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface IVsFindTarget3
... Changing the namespace and adding the
Anyway, the bottom line is I have a fix for this and will soon provide a PR. However, It's fragile.
|
Thanks for investigating. Did you figure out why it is only happening in XAML Styles files, but not in XAML resource or UserControl files?88 |
This is a surprise to me: in my case, the issue arises consistently whatever the kind of axaml file. I double-checked this by creating one instance of each item proposed by the Avalonia extension, that is: resource dictionary, styles, templated control, user control and window. Note that I only use the axaml extension. I didn't test the paml or xaml extensions. |
So, perhaps I was wrong, it was sometimes happening also with the resource files. |
They are all opened by Avalonia XAML Editor |
Basically I reset some key bindings and now everything works differently and I cannot event reset them to the original state (reset does not do anything). |
Oh, seems you've messed your VS key bindings... In case you wanted them back to the defaults, here are mine which I never changed: vs2022-keyboard.txt Rename it to I hope that once I have time to submit the PR and when/if it is merged and a new version of the extension is published, you won't have to resort to this hack anymore. |
Thanks, I'll wait for your change to change back the keyboard settings. |
Fix #231 - Ctrl-F not opening the quick search box in VS2022
The issue is still there even after I re-installed the Avalonia extension. When will the new extension be ready? Thanks Nick |
That's because, although my PR was merged, a new version of the extension was not released yet. If you want to try it, you can download the source code, build the extension and install it though. |
Hey @Takoooooo, when do you think a new extension will be published? |
ctrl-f should open a search box at the top right for the file not the search dialog for the whole solution.
Seems like ctrl-f works fine in a XAML resource files, only Styles files have problems.
This problem is unique to VS2022 - everything works fine under VS2019.
The text was updated successfully, but these errors were encountered: