You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If SetLexerByName(value) fails, then lexerName is not yet set, and so not reported (or the previous version is reported) in the exception message.
set
{
if (string.IsNullOrWhiteSpace(value))
{
lexerName = value;
return;
}
#if SCINTILLA5
if (!SetLexerByName(value))
{
throw new InvalidOperationException(@$"Lexer with the name of '{lexerName}' was not found.");
}
#elif SCINTILLA4
if (NativeMethods.NameConstantMap.ContainsValue(value))
{
Lexer = (ScintillaNET.Lexer) NativeMethods.NameConstantMap.First(f => f.Value == value)
.Key;
}
#endif
lexerName = value;
}
The text was updated successfully, but these errors were encountered:
Hi,
Could you provide steps to reproduce this. The SetLexerByName method is private so it is not part of the public "API".
So what I need to do to reproduce the issue.
An exception is thrown correctly if the lexer name is not found. E.g. not supported by the Scintilla native.
I mean, if you set the public LexerName property to an invalid value, the exception is correctly thrown, but the exception message is incorrect - it uses the private field lexerName.
But lexerName has not yet been set to the new (and invalid) value value, so the wrong name is reported. The message should report value as the invalid name.
In my case, lexerName was null, and so the invalid name was reported as an empty pair of quotes.
If
SetLexerByName(value)
fails, then lexerName is not yet set, and so not reported (or the previous version is reported) in the exception message.The text was updated successfully, but these errors were encountered: