public void CheckComment( ICSharpCommentNode commentNode, IHighlightingConsumer highlightingConsumer, CommentSettings settings) { // Ignore it unless it's something we're re-evalutating if (!_daemonProcess.IsRangeInvalidated(commentNode.GetDocumentRange())) { return; } // Only look for ones that are not doc comments if (commentNode.CommentType != CommentType.END_OF_LINE_COMMENT && commentNode.CommentType != CommentType.MULTILINE_COMMENT) { return; } ISpellChecker spellChecker = SpellCheckManager.GetSpellChecker(_settingsStore, _solution, settings.DictionaryNames); SpellCheck( commentNode.GetDocumentRange().Document, commentNode, spellChecker, _solution, highlightingConsumer, _settingsStore, settings); }
public static void CheckString(IInterpolatedStringExpression literalExpression, DefaultHighlightingConsumer consumer, StringSettings settings, ISolution _solution, IContextBoundSettingsStore _settingsStore, IDaemonProcess _daemonProcess = null) { //ConstantValue val = literalExpression.ConstantValue; // Ignore it unless it's something we're re-evalutating if (_daemonProcess != null && !_daemonProcess.IsRangeInvalidated(literalExpression.GetDocumentRange())) { return; } foreach (var tokenNode in literalExpression.StringLiterals) { if (tokenNode == null) { continue; } var tokenType = tokenNode.GetTokenType(); if (tokenType == CSharpTokenType.INTERPOLATED_STRING_VERBATIM || tokenType == CSharpTokenType.INTERPOLATED_STRING_VERBATIM_START || tokenType == CSharpTokenType.INTERPOLATED_STRING_VERBATIM_MIDDLE || tokenType == CSharpTokenType.INTERPOLATED_STRING_VERBATIM_END ) { if (settings.IgnoreVerbatimStrings) { return; } } else if (tokenType != CSharpTokenType.INTERPOLATED_STRING_REGULAR_START && tokenType != CSharpTokenType.INTERPOLATED_STRING_REGULAR_MIDDLE && tokenType != CSharpTokenType.INTERPOLATED_STRING_REGULAR_END && tokenType != CSharpTokenType.INTERPOLATED_STRING_REGULAR) { continue; } ISpellChecker spellChecker = SpellCheckManager.GetSpellChecker(_settingsStore, _solution, settings.DictionaryNames); StringSpellChecker.SpellCheck( literalExpression.GetDocumentRange() .Document, tokenNode, spellChecker, _solution, consumer, _settingsStore, settings); } }
public static void CheckString(ICSharpLiteralExpression literalExpression, DefaultHighlightingConsumer consumer, StringSettings settings, ISolution _solution, IContextBoundSettingsStore _settingsStore, IDaemonProcess _daemonProcess = null) { //ConstantValue val = literalExpression.ConstantValue; // Ignore it unless it's something we're re-evalutating if (_daemonProcess != null && !_daemonProcess.IsRangeInvalidated(literalExpression.GetDocumentRange())) { return; } ITokenNode tokenNode = literalExpression.Literal; if (tokenNode == null) { return; } if (tokenNode.GetTokenType() == CSharpTokenType.STRING_LITERAL_VERBATIM) { if (settings.IgnoreVerbatimStrings) { return; } } else if (tokenNode.GetTokenType() != CSharpTokenType.STRING_LITERAL_REGULAR) { return; } ISpellChecker spellChecker = SpellCheckManager.GetSpellChecker(_settingsStore, _solution, settings.DictionaryNames); StringSpellChecker.SpellCheck( literalExpression.GetDocumentRange() .Document, tokenNode, spellChecker, _solution, consumer, _settingsStore, settings); }