forked from qt-creator/qt-creator
		
	CppHighlighter: highlight all functions/methods.
- Highlight all function/methods (not just virtual methods). - Highlight as a function even if number of arguments does not match. In that case, add a diagnostic message to indicate there are too many/too few arguments. - Fix highlighting of parameters in function declarations. These used to be handled indiferently, and they could be mistaken for type or field references. - Properly highlight template method calls. Change-Id: I6e61c9ee47763db95c62314f9cc1c4d398df38b3 Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
		
				
					committed by
					
						 Leandro Melo
						Leandro Melo
					
				
			
			
				
	
			
			
			
						parent
						
							16bca8b06c
						
					
				
				
					commit
					809611f346
				
			| @@ -1154,13 +1154,19 @@ void CppModelManager::updateEditor(Document::Ptr doc) | ||||
|  | ||||
|                     QTextCursor c(ed->document()->findBlockByNumber(m.line() - 1)); | ||||
|                     const QString text = c.block().text(); | ||||
|                     for (int i = 0; i < text.size(); ++i) { | ||||
|                         if (! text.at(i).isSpace()) { | ||||
|                             c.setPosition(c.position() + i); | ||||
|                             break; | ||||
|                     if (m.length() > 0 && m.column() + m.length() < (unsigned)text.size()) { | ||||
|                         int column = m.column() > 0 ? m.column() - 1 : 0; | ||||
|                         c.setPosition(c.position() + column); | ||||
|                         c.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor, m.length()); | ||||
|                     } else { | ||||
|                         for (int i = 0; i < text.size(); ++i) { | ||||
|                             if (! text.at(i).isSpace()) { | ||||
|                                 c.setPosition(c.position() + i); | ||||
|                                 break; | ||||
|                             } | ||||
|                         } | ||||
|                         c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); | ||||
|                     } | ||||
|                     c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor); | ||||
|                     sel.cursor = c; | ||||
|                     sel.format.setToolTip(m.text()); | ||||
|                     e.selections.append(sel); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user