Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code highlighting breaks because of the language header #138

Closed
tkapustina opened this issue Jun 10, 2021 · 3 comments
Closed

Code highlighting breaks because of the language header #138

tkapustina opened this issue Jun 10, 2021 · 3 comments

Comments

@tkapustina
Copy link

tkapustina commented Jun 10, 2021

STR:

  1. Open a feature file
  2. Add # language: 


ACTUAL:
image
https://youtrack.jetbrains.com/issue/DEXP-592129

Incremental reparse Index and length must refer to a location within the string. Parameter name: length
JetBrains Rider 2021.2 Build RD-212.4047.84 Date 2021-06-10T05:39:18.045+0000

--- EXCEPTION #1/3 [ArgumentOutOfRangeException]
Message = “Index and length must refer to a location within the string.”
ExceptionPath = Root.InnerException.InnerException
ClassName = System.ArgumentOutOfRangeException
HResult = COR_E_ARGUMENTOUTOFRANGE=80131502
Source = mscorlib
ParamName = length

StackTraceString = “
at System.String.Substring(Int32 startIndex, Int32 length)
at ReSharperPlugin.SpecflowRiderPlugin.Psi.GherkinKeywordProvider.GetKeywordsList(String language) in D:\a\SpecFlow.Rider\SpecFlow.Rider\src\dotnet\ReSharperPlugin.SpecflowRiderPlugin\Psi\GherkinKeywordProvider.cs:line 76
at ReSharperPlugin.SpecflowRiderPlugin.Psi.GherkinKeywordProvider.GetAllKeywords(String language) in D:\a\SpecFlow.Rider\SpecFlow.Rider\src\dotnet\ReSharperPlugin.SpecflowRiderPlugin\Psi\GherkinKeywordProvider.cs:line 31
at ReSharperPlugin.SpecflowRiderPlugin.Psi.GherkinLexer.UpdateLanguage(String language) in D:\a\SpecFlow.Rider\SpecFlow.Rider\src\dotnet\ReSharperPlugin.SpecflowRiderPlugin\Psi\GherkinLexer.cs:line 56
at ReSharperPlugin.SpecflowRiderPlugin.Psi.GherkinLexer.Advance() in D:\a\SpecFlow.Rider\SpecFlow.Rider\src\dotnet\ReSharperPlugin.SpecflowRiderPlugin\Psi\GherkinLexer.cs:line 174
at JetBrains.ReSharper.Psi.Parsing.TokenBuffer.ReScanUpToEnd(ILexer lexer)
at JetBrains.ReSharper.Psi.Files.CachedPsiFile.GetIncrementalReparseResult(TokenBuffer oldTokenBuffer, IBuffer newBuffer, ISecondaryRangeTransla
@tkapustina
Copy link
Author

tkapustina commented Jun 10, 2021

One more example
image
Should it be highlighted as an error?

@nemesv
Copy link
Contributor

nemesv commented Jun 16, 2021

Fixed in version 1.8.0.

@tkapustina
Copy link
Author

Verified.
image
I'm not sure that language header should be highlighted too, because it's a proper line.
And it would be cool to suggest a quick fix to change the language.

@nemesv nemesv closed this as completed Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants