CSharpOutline2015
CSharpOutline2015 copied to clipboard
Interop with Viasfora
Hi there,
I'm the author of https://github.com/tomasr/viasfora, and one common issue users report is that it causes your C# Outline extension to stop working correctly.
I looked into this a while ago, and while I couldn't figure out exactly what was going on, I think the problem is this:
Basically, it seems when you are looking at the tags returned by the tag aggregator, you're not looking at the classification type of the tag returned (so you're looking at all content). In this case, what happens is that you're picking up the tags returned by Viasfora for the braces, and not realizing they contain the tag.
The issue appears to be that C# Outline seems to be checking if the last character in the TagSpan is the brace, rather than if it is contained (or starts with it). Hence, it breaks with Viasfora's tags, because the TagSpan I return starts at the brace.
Would you be open to collaborating on making this work? There's really not much I can do on my end to fix it....
+1 these are both excellent extensions and I would love to run both instead of one or the other. Thank you!
Hi @tomasr, Sorry for the late reply, I did not receive e-mail notification from GitHub for some reason,
Thank you for this info, I'll try to fix it. If can't manage to do it, I'm always open to pull-requests ;)
I'm going to merge C# outline with JSEnhancements from the next version, here is the repo: https://github.com/MadBender/VsOutlining The new extension should be compatible with Visual Studio starting with 2012 version, so I likely to abandon this repo and move an actual code (including the fix for TagSpan) to the new consolidated repo,
UPD: turns out, that VS 2017 has built-in statement collapsing capability. So I likely to fix this issue in this repo.
Hi @tomasr I'm trying to figure out what do you mean by this paragraph:
Basically, it seems when you are looking at the tags returned by the tag aggregator, you're not looking at the classification type of the tag returned (so you're looking at all content). In this case, what happens is that you're picking up the tags returned by Viasfora for the braces, and not realizing they contain the tag.
It seems that Viasfora introduces a new type of a span classification type?
The actual check for the start of outlining region is here: https://github.com/Skybladev2/CSharpOutline2015/blob/master/CSharpOutline/Outlining/CS/CSOutliner.cs#L38-L41
and for the end is here: https://github.com/Skybladev2/CSharpOutline2015/blob/master/CSharpOutline/Outlining/CS/CSOutliner.cs#L67
From my point of view this is a correct code, but I may miss something.