ReSharper - Razor syntax treated as errors and Razor intellisense does not work
Completed
Hi,
The project is an ASP.NET Core 1.0.0 MVC application.
As the title says - it seems ReSharper does not recognize and support Razor syntax in cshtml files at all, for me. I get no intellisense for Razor. Here is the sreenshot of Razor syntax in red and treated as errors:
I have googled for hours and this is the list of things I've found and tried (none have fixed the problem):
- post on Stack Overflow - Manually return the intellisense power to VS throught the menu: ReSharper >> Enviroment >> IntelliSense >> General
- post on Stack Overflow - which led me to: ReSharper intermittently showing red errors for valid Razor code : RSRP-455788. Incidentally my ReSharper version was exactly 10.0.2, hence I was very optimistic, this was the culprit. I updated to the latest 2016.1.2. Did not help.
- post on Stack Overflow - Tried to clear the caches by deleting the files manually from your AppData directory: AppData\Local\JetBrains\Transient\ReSharperPlatformVs14\v05\SolutionCaches
- post on Stack Overflow - Deleting the contents of this directory allows the IDE to recover: AppData\Local\Microsoft\VisualStudio\14.0\ComponentModelCache
- post on Stack Overflow - even tried this, which kinda looks silly.
None of these helped.
I DO NOT want to try completely resetting the user data with: devenv.exe /resetuserdata. Unless it is for sure the only way to fix this. This would be way too much trouble to my liking :(
My system in short (if you need any additional info, let me know)
- win 8.1 x64
- Visual Studio 2015
- ReSharper Ultimate
- many other extensions
Thanks in advance for any help.
Please sign in to leave a comment.
Please install R# 2016.2 EAP build https://confluence.jetbrains.com/display/ReSharper/ReSharper+2016.2+EAP since only R# 2016.2 version has ASP.NET Core 1.0.0 support.
Thanks!
Thanks,
Installed 2016.2 EAP 8 and it worked. Although I lost the "ability" or snippets/templates (no idea where that came from in the first place) to quickly code in html. I mean, before it was: "div"+TAB and it's done. Now "div"+TAB does nothing.
What should "div" template insert? As I see, live templates has never been added to IntelliSense https://youtrack.jetbrains.com/issue/RSRP-403141 for html-like files.
Like I mentioned before, it probably was not from ReSharper's Live Templates - I have no idea where that functionality was coming from. But it was extremely handy for coding html.
1. The behavior that I described was as follows: I type in the html tag name - any tag name (only name, no < or >) and press TAB, eg: I type in "div" (no quotes) and press TAB - that auto expands to <div></div>. Now it does not work.
2. HTML ZenCoding from Web Essentials does not work (TAB just does nothing) either. Which is even worse.
All I did, was install the ReSharper 2016.2 EAP 8. That's it. And all the TAB invoked code expansions stopped working...
So, to be honest, except, that resharper now does not give me errors where there are none, and solution-wide analysis is green as it should be, as it was quite annoying to have it red for no reason :) I'm not sure if it wasn't more convenient to have a working zencoding than to have razor intellisense now :)
Thanks for any help with solving this.
Please try selecting Visual Studio here ReSharper | Options | Environment | IntelliSense | General. Then Visual Studio IntelliSense will be used so if any Visual Studio plugins have added any items to IntelliSense - it will appear there.
Thanks!
Ok, so here is the example of how TAB does not work:
As you can see I try 3 expansions. When I press TAB, instead of code expansion, the editor selects the outer div. The last (div#menu>span.item) is actually from the video of ZenCoding in Web Essentials 1.7 - YouTube, just to make sure :)
I tried both of these settings, and both DID NOT bring back the proper TAB behavior:
I very much miss the code expansion in html. Like I said, all I did was install resharper's 2016.2 EAP 8 version. I am seriously considering of going back to the last stable. The question is, would that fix things?
In EAP builds we added Structural Navigation using Tab key, so it might be the issue - please try disabling it here ReSharper | Options | Environment | Editor | Editor Behavior | Structural navigation. It might help.
Finally, the solution - it works! :)
Thank you, Alex, very much for your help.