Repository navigation
|
I created a custom editor margin. It all works fine except for one issue. It also appears in the expression editor of watch and quick watch window. Ho do I ensure my margin is visible inside full text editor only? |
Answered by
reduckted
Jan 17, 2022
Replies: 1 comment 1 reply
|
It sounds like you're missing some attributes on your If you add the [Export(typeof(IWpfTextViewMarginProvider))]
[Name(MyMargin.Name)]
[ContentType("text")]
[TextViewRole(PredefinedTextViewRoles.Document)]
public class MyMargin : IWpfTextViewMarginProvider {
// ...
}There are different types of roles that you can use. You can see the pre-defined roles here: https://docs.microsoft.com/dotnet/api/microsoft.visualstudio.text.editor.predefinedtextviewroles |
1 reply
Answer selected by
nvmkpk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It sounds like you're missing some attributes on your
IWpfTextViewMarginProvider.If you add the
ContentTypeattribute and theTextViewRoleattribute, then you should be able to get your margin to only appear on editors.There are different types of roles that you can use. You can see the pre-defined roles here: https://docs.microsoft.com/dotnet/api/microsoft.visualstudio.text.editor.predefinedtextviewroles