Enhanced-Syntax-Highlighting
Enhanced-Syntax-Highlighting copied to clipboard
extension stops working after VS2019 16.5 update
First, I love this extension. With my custom colors I can see immediately whether I'm dealing with a property or field.
Yesterday I was still running VS2019 16.4.6 and ESH was working fine. After the update ESH is not working at all anymore. The code highlighting has defaulted back to Visual Studio plain style. In the Font and Colors settings of VS my custom colors are still present but just not applied in the editor.
Further info: I'm using Resharper but with most features turned off. It worked before as well so can't imagine this being the issue.
Same here.
Im pretty sure other have same error log but since no one posted ill leave it there. https://pastebin.com/Fw5JHETm This is ActivityLog.xml after exception being thrown. Look at record 1510, this is probably a change from MS library.
A try/catch block made the extension work (at least looks like it for now, did not have time to investigate further what was going on), but it was really annoying to work without colors. If anyone interested in this band-aid fix.... don't judge me lol
@flaengel is there any way for your to publish this hacky fix? I've done VS extension development yet to build my own modified version.
Never did as well... Not sure if it is correct, but here it goes. Enhanced Syntax Highlighting.zip
- also pushed to the fork I did, you can clone and also build.
legend @flaengel. It worked. I should start looking into extension development. Carry so much potential for productivity.
The fix here is to not call DeclarationModifiers.From
if symbol
is a INamespaceSymbol
. Instead, use DeclarationModifiers.None
for this case since namespaces cannot have modifiers.
Thanks for the information @sharwell, update here :)
It appears that ILocalSymbol also don't have modifiers.
fixed in #22, Thanks
I've noticed that only single file was still throwing exception, then i proceed to comment out things till i found the problem. Code below would crash extension, as soon as i comment it out, coloring start working again.
public List<string> FindByInput(string path)
{
return (from ret in Keys
where ret == path
select ret).ToList();
}
I've noticed that only single file was still throwing exception, then i proceed to comment out things till i found the problem. Code below would crash extension, as soon as i comment it out, coloring start working again.
public List<string> FindByInput(string path) { return (from ret in Keys where ret == path select ret).ToList(); }
Can confirm. I have code very similar to this and the extension is crashing on this one file.
trying to debug but since I'm not using linq queries like that much can you provide the other missing variables? what are the types of ret
and Keys
. Sounds like a dictionary...
Yes Keys
are just Dictionary.Keys
, and it looks like any linq query will reproduce this bug, something like will do it
List<string> myStrings = new List<string>();
var a = from str in myStrings select str;
Reopened this issue, maybe someone wants to create a pull request. I will try to release these fixes as early as possible.
Regards
Could be me but has this stopped working again in a new VS2019 update? Im on Version 16.11.15
I initially see the highlighting as expected when files load but then it stops and reverts. I see the same if I do a big scroll and then stop. Theres no error or exception.
Are there any logs I can examine?