Dreamescaper / IntelliSenseExtender

GNU General Public License v3.0
88 stars 17 forks source link

Add support for Razor cshtml pages #53

Closed avestura closed 5 years ago

Dreamescaper commented 5 years ago

Thanks for reporting!

Actually, I'm even surprised that it works at all in cshtml files - that was never intended. Problem is that from Roslyn perspective cshtml file looks like huge unreadable auto-generated C# code, so I wont be able to add valid Razor 'using' directive (using Roslyn, at least).

So I think I'm going to disable extention completely for cshtml files.

avestura commented 5 years ago

Isn't it possible to use System.Web.Razor.Parser.SyntaxTree and in general the Parser namespace utils to add @using directives in top of razor documents?

daberni commented 5 years ago

I had a look into this already too but wasn't successful on finding a solution either. The current roslyn parser is simply not compatible with Razor pages, it would require a complete standalone solution for them. Guess completely disabling it for Razor pages would be the best approach for the moment.

Dreamescaper commented 5 years ago

Completion are disabled for Razor files (thanks @daberni for PR!). I'll reopen the issue, but as suggestion for improvement. Maybe I'll be able to implement it later (not in the nearest future though)

Dreamescaper commented 5 years ago

Added corresponding bug to Roslyn: https://github.com/dotnet/roslyn/issues/35172