-
Notifications
You must be signed in to change notification settings - Fork 223
Razor editor crash when typing @namespace directive line #1268
Comments
d15prerel 26421.06 had our earlier fix for the parsing of |
Stack trace:
|
LOL I was about to post the same. Here's mine:
|
The fix is here: https://github.com/aspnet/Razor/blob/dev/src/Microsoft.AspNetCore.Mvc.Razor.Extensions/NamespaceDirective.cs#L88 we need to be tolerant of invalid/incomplete parses. |
- This involved not using the `First()` method when reading the directives tokens. - Added two tests to validate an empty directive token and a missed directive token for the `@namespace` directive. #1268
- This involved not using the `First()` method when reading the directives tokens. - Added two tests to validate an empty directive token and a missed directive token for the `@namespace` directive. #1268
I don't see this fix in 2.0.0-preview1, only in |
Our stabilization branch for 15.3P1 is https://github.com/aspnet/Razor/tree/preview-1/stabilization We're not mixing in any general 2.0.0-preview1 changes with VS work unless there's a good reason. We could merge this to preview1 if we want just for safety, but I'm not aware of any runtime impact |
Ok thanks, whatever you guys think is the right thing, just enumerating all the loose ends 😄 |
I'm getting a different error with the same repro:
It occurs when typing
VS: 15.3.0 Preview 1.0 [26526.1.d15rel] |
Investigating |
Using VS 2017 15.3 d15prerel 26427.6
Was adding
@namespace RazorPagesSample.Pages.Blah
to an existing page by typing it in manually in the editor, resulted in a crash. Pasting the complete line in worked OK.The text was updated successfully, but these errors were encountered: