
Hi,
Example picture what I'm expecting:
https://snipboard.io/m2G0Fz.jpg
Current situation:
https://snipboard.io/Urhd4w.jpg
Hi,
Example picture what I'm expecting:
https://snipboard.io/m2G0Fz.jpg
Current situation:
https://snipboard.io/Urhd4w.jpg
Hello,
Do you mean that when you have the caret over a start or end tag, you would like it and the matching paired tag to be highlighted as well?
Hello,
Yes, I'm actually so used to that because most editors have it:
Notepad++
Visual studio code
etc.
Example from visual studio code:
https://snipboard.io/7a5lmV.jpg
Hello,
We don't have that feature built-in at the moment but I can log it as a suggestion. To do it yourself for now, you might be able to create a custom IStructureMatcher implementation for XML. Register that with the syntax language, then also register a DelimiterHighlightTagger service.
Here is code similar to our Getting Started #14 sample:
language.RegisterStructureMatcher(new XmlStructureMatcher());
language.RegisterService(new TextViewTaggerProvider<DelimiterHighlightTagger>(typeof(DelimiterHighlightTagger)));
Your XmlStructureMatcher class would probably just want to implement IStructureMatcher directly and not inherit a base class since it would be using completely custom logic. Its Match method would have to look at the document's parse data and find a matching tag. The TextSnapshotOffset can get you to the snapshot, document, parse data, etc. like this:
if (snapshotOffset.Snapshot.Document is ICodeDocument document) {
var parseData = document.ParseData;
// ...
}
I hope that helps give you some starter pointers if you want to try writing one yourself.
Please log in to a validated account to post comments.