summaryrefslogtreecommitdiff
path: root/src/plugins/cpptools/cppchecksymbols.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge CppTools into CppEditorChristian Kandeler2021-09-011-1501/+0
| | | | | | | | | | | | | | | | There was no proper separation of responsibilities between these plugins. In particular, CppTools had lots of editor-related functionality, so it's not clear why it was separated out in the first place. In fact, for a lot of code, it seemed quite arbitrary where it was put (just one example: switchHeaderSource() was in CppTools, wheras switchDeclarationDefinition() was in CppEditor). Merging the plugins will enable us to get rid of various convoluted pseudo-abstractions that were only introduced to keep up the artificial separation. Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: SimplifyNikolai Kosjar2019-11-011-14/+9
| | | | | Change-Id: Id10cbcf541d8105265c531e63a64e2fd34e27379 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* Standardize on int for line and column valueshjk2019-07-261-12/+12
| | | | | | | | | | | | | | | Recently tons of warnings show up for presumably "problematic" singned <-> unsigned and size conversions. The Qt side uses 'int', and that's the biggest 'integration surface' for us, so instead of establishing some internal boundary between signed and unsigned areas, push that boundary out of creator core code, and use 'int' everywhere. Because it reduces friction further, also do it in libcplusplus. Change-Id: I84f3b79852c8029713e7ea6f133ffb9ef7030a70 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: modernizeAlessandro Portale2019-01-211-24/+23
| | | | | | Change-Id: Iaf02e4d026f1ac8b216833d83cd7a735e21ff60a Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
* Prefer using 'override' instead of 'virtual'Alessandro Portale2018-07-111-22/+22
| | | | | | | | warning: prefer using 'override' or (rarely) 'final' instead of 'virtual' [modernize-use-override] Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc Reviewed-by: Marco Benelli <marco.benelli@qt.io>
* C++: Fix handling of Objective-C/C++Francois Ferrand2016-12-051-0/+58
| | | | | | | | | | | - Objective C/C++ was not enabled in highlighter. - QMake project part for Objective C/C++ did not have ObjectiveC extension enabled. - As languageFeatures.objCEnabled is a bitfield, it was actually always set to 0. - Highlight ObjC class & protocol declarations. - Highlight ObjC message passing. Change-Id: I64d12c9509058d05f7adce94598cb7ce91727ac8 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* CppTools: Fix crash on document closeNikolai Kosjar2016-11-151-2/+2
| | | | | | | | Emit the signal only if we are not canceled. Task-number: QTCREATORBUG-17249 Change-Id: I5082a5fe7554eecdc7ec5d148150c1b169002f6d Reviewed-by: Christian Stenger <christian.stenger@qt.io>
* CppTools: Separate highlighting for function declarations and callsOrgad Shaneh2016-06-201-24/+36
| | | | | | Task-number: QTCREATORBUG-15564 Change-Id: Iab1b60e19448202432f98295c89769cd376aa03f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Update License according to agreement with Free Qt FoundationTobias Hunger2016-01-191-17/+12
| | | | | | | * Update files in src/plugins Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
* C++: Revert lookup to 3.4.2Nikolai Kosjar2015-11-191-13/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...which was least buggy. The bugs fixed by the changes we revert here (highlighting/completion for code involving templates) were minor compared to ones we currently have. Those bugs will be addressed by the clang code model anyway. Relevant commits were collected via: $ cd ${QTC}/src/libs/cplusplus $ git log \ --no-merges \ --format=oneline \ v3.4.2..HEAD \ -- LookupContext.* ResolveExpression.* TypeResolver.* TypeOfExpression.* \ ../../plugins/cpptools/cppcompletion_test.cpp From this list the following were skipped due to irrelevance: 88c5b47e535d91f3db99882d5b50b263b46f223c # CppTools: Minor cleanup in completion tests e5255a1f5cac284c4f0d4a85203878c84da86e85 # CppTools: Add a test for ObjC not replacing dot with arrow 5b12c8d63a30e281274cdc267efabead2c736bd8 # CppTools: Support ObjC in member access operator tests 9fef4fb9ca4e65e20ff13b98bcf15e3c6232fdfb # CPlusPlus: Fix warnings about overriding visit(...) methods There were only minor conflicts while reverting those. This changes touches so many files because there were quite some cleanups and renames after the 3.4.2 release. Task-number: QTCREATORBUG-14889 Task-number: QTCREATORBUG-15211 Task-number: QTCREATORBUG-15213 Task-number: QTCREATORBUG-15257 Task-number: QTCREATORBUG-15264 Task-number: QTCREATORBUG-15291 Task-number: QTCREATORBUG-15329 Change-Id: I01f759f8f35ecb4228928a4f22086e279c1a5435 Reviewed-by: Marco Bubke <marco.bubke@theqtcompany.com>
* CppTools: Do not highlight instantiation as callAdam Strzelecki2015-11-161-1/+1
| | | | | | | | | | | | | | | | | Underlying C++ model sometimes marks C++ object instantiation using initializer as a (forward) function declaration. This leads to incorrect highlighting of object variables as if they were function calls. C++ model however marks in this case (and not any other case) such symbols as ambiguous function types, see CPlusPlus::Bind::visit. This change skips such ambiguous functions for highlighting as function call. Also add test case for related bug report. Task-number: QTCREATORBUG-15212 Change-Id: Ifde8db407f2fa8275a3f991bfa3d3b73eca8c14e Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Fix highlighting and follow for template using argumentOrgad Shaneh2015-06-091-6/+2
| | | | | | | | | | Use-case: template<class T> using Foo = Bar<T>; // T not highlighted Task-number: QTCREATORBUG-9944 Change-Id: I04cb62ea6a21f158f7fb4fb7ac79ccd6eb1bbfbb Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Fix decltype resolving for template functionOrgad Shaneh2015-06-011-6/+2
| | | | | | | | | | | | | | | | | | | | | The last nail for std::unique_ptr (GCC variant, MSVC still doesn't work). Use-case: template<typename T> static T f(); struct Foo { int bar; }; void fun() { decltype(f<Foo>()) s; s.bar; // bar not highlighted } Task-number: QTCREATORBUG-14483 Task-number: QTCREATORBUG-8937 Change-Id: I5bab757400b070cf9dbb688a44fd8eafe95ddc61 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* CppTools: Highlight type for templated usingOrgad Shaneh2015-05-271-2/+3
| | | | | | Task-number: QTCREATORBUG-9944 Change-Id: I614571e05039f24b7d56abdddc15f912581f68f1 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* C++: Rename ClassOrNamespace -> LookupScopeOrgad Shaneh2015-04-201-11/+11
| | | | | Change-Id: Ide74482b133dd1fec40a725d9aa81bd749385f37 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Update LicenseEike Ziller2015-01-161-6/+6
| | | | | Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* CppTools: restore C++ diagnostics messages.Francois Ferrand2014-10-231-7/+13
| | | | | | | The messages were computed, but not added to the document. Change-Id: Ibeea802cf9f291ad14b2fe2e9d2a285c927a4449 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@theqtcompany.com>
* Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-10-141-7/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/libs/utils/ipaddresslineedit.cpp src/libs/utils/logging.h src/plugins/analyzerbase/AnalyzerBase.pluginspec.in src/plugins/android/Android.pluginspec.in src/plugins/android/androiddeploystep.cpp src/plugins/android/androiddeploystep.h src/plugins/android/androiddeploystepfactory.cpp src/plugins/android/androiddeploystepwidget.cpp src/plugins/android/androidpackagecreationfactory.cpp src/plugins/android/androidpackagecreationstep.cpp src/plugins/android/androidpackagecreationstep.h src/plugins/android/androidpackagecreationwidget.cpp src/plugins/android/androidpackagecreationwidget.h src/plugins/android/javafilewizard.cpp src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/baremetal/BareMetal.pluginspec.in src/plugins/bazaar/Bazaar.pluginspec.in src/plugins/beautifier/Beautifier.pluginspec.in src/plugins/bineditor/BinEditor.pluginspec.in src/plugins/bookmarks/Bookmarks.pluginspec.in src/plugins/clangcodemodel/ClangCodeModel.pluginspec.in src/plugins/clangcodemodel/clanghighlightingsupport.cpp src/plugins/clangcodemodel/clangsymbolsearcher.cpp src/plugins/classview/ClassView.pluginspec.in src/plugins/clearcase/ClearCase.pluginspec.in src/plugins/cmakeprojectmanager/CMakeProjectManager.pluginspec.in src/plugins/cmakeprojectmanager/cmakeeditorfactory.cpp src/plugins/cmakeprojectmanager/cmakehighlighter.cpp src/plugins/coreplugin/Core.pluginspec.in src/plugins/cpaster/CodePaster.pluginspec.in src/plugins/cppeditor/CppEditor.pluginspec.in src/plugins/cppeditor/cppfilewizard.cpp src/plugins/cpptools/CppTools.pluginspec.in src/plugins/cpptools/cpphighlightingsupportinternal.cpp src/plugins/cpptools/cppmodelmanagerinterface.cpp src/plugins/cpptools/cppmodelmanagerinterface.h src/plugins/cvs/CVS.pluginspec.in src/plugins/debugger/Debugger.pluginspec.in src/plugins/designer/Designer.pluginspec.in src/plugins/diffeditor/DiffEditor.pluginspec.in src/plugins/emacskeys/EmacsKeys.pluginspec.in src/plugins/fakevim/FakeVim.pluginspec.in src/plugins/genericprojectmanager/GenericProjectManager.pluginspec.in src/plugins/git/Git.pluginspec.in src/plugins/git/gitorious/gitorious.cpp src/plugins/git/gitorious/gitorious.h src/plugins/git/gitorious/gitoriousclonewizard.cpp src/plugins/git/gitorious/gitorioushostwidget.cpp src/plugins/git/gitorious/gitorioushostwidget.h src/plugins/git/gitorious/gitorioushostwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwidget.cpp src/plugins/git/gitorious/gitoriousprojectwidget.h src/plugins/git/gitorious/gitoriousprojectwizardpage.cpp src/plugins/git/gitorious/gitoriousprojectwizardpage.h src/plugins/git/gitorious/gitoriousrepositorywizardpage.cpp src/plugins/git/gitorious/gitoriousrepositorywizardpage.h src/plugins/glsleditor/GLSLEditor.pluginspec.in src/plugins/glsleditor/glsleditorfactory.cpp src/plugins/glsleditor/glslfilewizard.cpp src/plugins/helloworld/HelloWorld.pluginspec.in src/plugins/help/Help.pluginspec.in src/plugins/imageviewer/ImageViewer.pluginspec.in src/plugins/ios/Ios.pluginspec.in src/plugins/macros/Macros.pluginspec.in src/plugins/mercurial/Mercurial.pluginspec.in src/plugins/perforce/Perforce.pluginspec.in src/plugins/projectexplorer/ProjectExplorer.pluginspec.in src/plugins/pythoneditor/PythonEditor.pluginspec.in src/plugins/pythoneditor/pythoneditorwidget.cpp src/plugins/pythoneditor/wizard/pythonfilewizard.cpp src/plugins/qbsprojectmanager/QbsProjectManager.pluginspec.in src/plugins/qbsprojectmanager/defaultpropertyprovider.cpp src/plugins/qmakeprojectmanager/QmakeProjectManager.pluginspec.in src/plugins/qmakeprojectmanager/profileeditorfactory.cpp src/plugins/qmldesigner/QmlDesigner.pluginspec.in src/plugins/qmljseditor/QmlJSEditor.pluginspec.in src/plugins/qmljseditor/qmljseditorfactory.cpp src/plugins/qmljstools/QmlJSTools.pluginspec.in src/plugins/qmlprofiler/QmlProfiler.pluginspec.in src/plugins/qmlprojectmanager/QmlProjectManager.pluginspec.in src/plugins/qnx/Qnx.pluginspec.in src/plugins/qtsupport/QtSupport.pluginspec.in src/plugins/remotelinux/RemoteLinux.pluginspec.in src/plugins/resourceeditor/ResourceEditor.pluginspec.in src/plugins/resourceeditor/resourcewizard.h src/plugins/subversion/Subversion.pluginspec.in src/plugins/tasklist/TaskList.pluginspec.in src/plugins/texteditor/TextEditor.pluginspec.in src/plugins/texteditor/basetexteditor_p.h src/plugins/texteditor/basetextmark.cpp src/plugins/texteditor/codeassist/basicproposalitemlistmodel.h src/plugins/texteditor/codeassist/defaultassistinterface.h src/plugins/texteditor/codeassist/iassistproposalitem.cpp src/plugins/texteditor/itexteditor.cpp src/plugins/texteditor/itexteditor.h src/plugins/texteditor/itextmark.cpp src/plugins/texteditor/plaintexteditor.cpp src/plugins/texteditor/plaintexteditor.h src/plugins/texteditor/texteditoractionhandler.cpp src/plugins/todo/Todo.pluginspec.in src/plugins/updateinfo/UpdateInfo.pluginspec.in src/plugins/valgrind/Valgrind.pluginspec.in src/plugins/vcsbase/VcsBase.pluginspec.in src/plugins/welcome/Welcome.pluginspec.in src/plugins/winrt/WinRt.pluginspec.in tests/auto/debugger/temporarydir.h Change-Id: I254af8be8119fe9855287909e17d4b8ca9d2fc2f
| * License updateEike Ziller2014-10-091-7/+8
| | | | | | | | | | Change-Id: I3c22ef2685d7aa589f5d0ab74d693653a4c32082 Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
* | Merge remote-tracking branch 'origin/3.2'Eike Ziller2014-09-031-2/+6
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: qtcreator.pri qtcreator.qbs src/plugins/coreplugin/editormanager/editormanager.cpp src/plugins/cppeditor/cppeditor.cpp src/plugins/remotelinux/remotelinuxdebugsupport.cpp src/plugins/texteditor/basetexteditor.cpp Change-Id: I0da7c1cf2506b12d0563795aa8177fc45e97050f
| * CppTools: Remove concurrent write access to diagnostic messagesNikolai Kosjar2014-08-211-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...in CheckSymbols (highlighting backend). CheckSymbols might run concurrently several times with the same CPlusPlus::Document and modify the diagnostic messages in an unsave manner. See stack straces below. While the generated diagnostic messages ("Only virtual functions can be marked 'final'", "Too few arguments", ...) are useful, they weren't propagated to the editor widget since several minor versions. ================================================================= ==23724==ERROR: AddressSanitizer: attempting double-free on 0x60c0072fcd00 in thread T528 (Thread (pooled)): #0 0x4787c1 in __interceptor_free (/home/nik/dev/creator/creator-ut_clang-qt5/bin/qtcreator+0x4787c1) #1 0x7fa15e5da4ac in QTypedArrayData<unsigned short>::deallocate(QArrayData*) /home/nik/usr/qt-5.3.1/include/QtCore/qarraydata.h:234 #2 0x7fa15e5d87db in QString::~QString() /home/nik/usr/qt-5.3.1/include/QtCore/qstring.h:995 #3 0x7fa15e5f4f6a in CPlusPlus::Document::DiagnosticMessage::~DiagnosticMessage() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:140 #4 0x7fa15e5f4de2 in QList<CPlusPlus::Document::DiagnosticMessage>::node_destruct(QList<CPlusPlus::Document::DiagnosticMessage>::Node*, QList<CPlusPlus::Document::DiagnosticMessage>::Node*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:432 #5 0x7fa15e5f4ae9 in QList<CPlusPlus::Document::DiagnosticMessage>::dealloc(QListData::Data*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:784 #6 0x7fa15e5f47ed in QList<CPlusPlus::Document::DiagnosticMessage>::~QList() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:760 #7 0x7fa15e7533c2 in QList<CPlusPlus::Document::DiagnosticMessage>::clear() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:793 #8 0x7fa15e6f2ed2 in CPlusPlus::Document::clearDiagnosticMessages() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:205 #9 0x7fa15e6c5f5b in CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:337 #10 0x7fa15e6c83c2 in non-virtual thunk to CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:348 #11 0x7fa17f0ccab1 (/home/nik/usr/qt-5.3.1/lib/libQt5Core.so.5+0x98ab1) #12 0x7fa17f0cfa5e (/home/nik/usr/qt-5.3.1/lib/libQt5Core.so.5+0x9ba5e) #13 0x7fa17eaeb181 in start_thread (/lib/x86_64-linux-gnu/libpthread.so.0+0x8181) #14 0x7fa17dbec38c (/lib/x86_64-linux-gnu/libc.so.6+0xfb38c) 0x60c0072fcd00 is located 0 bytes inside of 128-byte region [0x60c0072fcd00,0x60c0072fcd80) freed by thread T539 (Thread (pooled)) here: #0 0x4787c1 in __interceptor_free (/home/nik/dev/creator/creator-ut_clang-qt5/bin/qtcreator+0x4787c1) #1 0x7fa15e5da4ac in QTypedArrayData<unsigned short>::deallocate(QArrayData*) /home/nik/usr/qt-5.3.1/include/QtCore/qarraydata.h:234 #2 0x7fa15e5d87db in QString::~QString() /home/nik/usr/qt-5.3.1/include/QtCore/qstring.h:995 #3 0x7fa15e5f4f6a in CPlusPlus::Document::DiagnosticMessage::~DiagnosticMessage() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:140 #4 0x7fa15e5f4de2 in QList<CPlusPlus::Document::DiagnosticMessage>::node_destruct(QList<CPlusPlus::Document::DiagnosticMessage>::Node*, QList<CPlusPlus::Document::DiagnosticMessage>::Node*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:432 #5 0x7fa15e5f4ae9 in QList<CPlusPlus::Document::DiagnosticMessage>::dealloc(QListData::Data*) /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:784 #6 0x7fa15e5f47ed in QList<CPlusPlus::Document::DiagnosticMessage>::~QList() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:760 #7 0x7fa15e7533c2 in QList<CPlusPlus::Document::DiagnosticMessage>::clear() /home/nik/usr/qt-5.3.1/include/QtCore/qlist.h:793 #8 0x7fa15e6f2ed2 in CPlusPlus::Document::clearDiagnosticMessages() /home/nik/dev/creator/creator-ut/src/libs/cplusplus/CppDocument.h:205 #9 0x7fa15e6c5f5b in CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:337 #10 0x7fa15e6c83c2 in non-virtual thunk to CppTools::CheckSymbols::run() /home/nik/dev/creator/creator-ut/src/plugins/cpptools/cppchecksymbols.cpp:348 Change-Id: Ifab2842ea43aeb26099835966b02d8afc4b85df4 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | C++: Base parsing on editor document instead of widgetNikolai Kosjar2014-08-251-29/+31
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This mainly takes CppEditorSupport apart. * Parsing is now invoked by CPPEditorDocument itself by listening to QTextDocument::contentsChanged(). * Upon construction and destruction CPPEditorDocument creates and deletes an EditorDocumentHandle for (un)registration in the model manager. This handle provides everything to generate the working copy and to access the editor document processor. * A CPPEditorDocument owns a BaseEditorDocumentProcessor instance that controls parsing, semantic info recalculation and the semantic highlighting for the document. This is more or less what is left from CppEditorSupport and can be considered as the backend of a CPPEditorDocument. CPPEditorDocument itself is quite small. * BuiltinEditorDocumentProcessor and ClangEditorDocumentProcessor derive from BaseEditorDocumentProcessor and implement the gaps. * Since the semantic info calculation was bound to the widget, it also calculated the local uses, which depend on the cursor position. This calculation got moved into the extracted class UseSeletionsUpdater in the cppeditor plugin, which is run once the cursor position changes or the semantic info document is updated. * Some more logic got extracted: - SemanticInfoUpdater (logic was in CppEditorSupport) - SemanticHighlighter (logic was in CppEditorSupport) * The *Parser and *Processor classes can be easily accessed by the static function get(). * CppHighlightingSupport is gone since it turned out to be useless. * The editor dependency in CompletionAssistProviders is gone since we actually only need the file path now. Change-Id: I49d3a7bd138c5ed9620123e34480772535156508 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Split designator ASTOrgad Shaneh2014-06-241-3/+2
| | | | | | Change-Id: I9bfed2023624c818c0f35f24476693cffeaf2bbc Reviewed-by: Wang Hoi <wanghoi@126.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Reinvent deprecated qSort as Utils::sortNikita Baryshnikov2014-06-191-2/+3
| | | | | | | Change-Id: I4f6011cc2b6127037249aabc2426a88ad7108ebf Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Daniel Teske <daniel.teske@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* C: Parser: Support parsing of c99 designated initializersWang Hoi2014-06-171-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | In case: int a[6] = { [4] = 29, [2] = 15 }; struct point { int x, y; }; struct point p = { .y = 3, .x = 2 }; Grammar change when c99 language feature is enabled: old grammar: braced-init-list :: '{' initializer-list '}' new grammar: braced-init-list :: '{' designated-initializer-list '}' designated-initializer-list :: designated-initializer (',' designated-initializer )* designated-initializer :: designator* initializer-clause designator :: '.' identifier | '[' constant-expression ']' Task-number: QTCREATORBUG-1902 Change-Id: Ib99d6f553f8d0f50ba3eff86f3a2e86d73372426 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Get rid of {Name,Type}::isEqualTo()Nikolai Kosjar2014-05-231-2/+2
| | | | | | | | | ...since it's superseded by the class Matcher. For consistency, rename FullySpecifiedType::isEqualTo() to match(). Change-Id: I07640f9218d814e0350265de45f05929e5d595a9 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Use Token::utf16chars{Begin,End} where appropriateNikolai Kosjar2014-05-231-9/+9
| | | | | | | | ...especially in CppTools/CppEditor where the offsets are used with a QString/QTextDocument. Change-Id: Ic6d18fbc01fb9cc899a9bd2d7424cd2edae487f1 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: Clarify units of a TokenNikolai Kosjar2014-05-151-11/+15
| | | | | | | | | | | | | This will avoid confusion when later more length and indices methods are added. In Token: length() --> bytes() begin() --> bytesBegin() end() --> bytesEnd() Change-Id: I244c69b022e239ee762b4114559e707f93ff344f Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Incremented year in copyright infoRobert Loehning2014-01-081-1/+1
| | | | | | Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com> Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* Rename "[Mm]ethod(s)" to "[Ff]unction(s)"Nikolai Kosjar2013-10-101-2/+2
| | | | | | | | | | | Only methods as programming functions are affected. Besides renaming some actions like "Switch Between Function Declaration/Definition" this mostly touches (api) code comments. This is a follow-up patch to commit 872bfb7. Change-Id: Icb65e8d73b59a022f8885b14df497169543a3b92 Reviewed-by: hjk <hjk121@nokiamail.com>
* CppTools: CppPreprocessor: Track also unresolved includesNikolai Kosjar2013-08-221-1/+1
| | | | | Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix matching type with using from other namespacePrzemyslaw Gorszkowski2013-08-201-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | example code: struct S { int s; }; namespace std { template <typename T> struct shared_ptr { T* operator->(); }; } namespace NS { using std::shared_ptr; } int main() { NS::shared_ptr<S> p;// for this shared_ptr return 0; } Fixes: * find usages * follow symbol * highlighting * marking Task-number: QTCREATORBUG-7978 Change-Id: I28994c960b87ddd400e1d7b860fca6c6683bbb5a Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* CppTools: Fix "! condition" coding styleNikolai Kosjar2013-07-251-33/+33
| | | | | | Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
* Fix coding style for else statementsOrgad Shaneh2013-07-171-4/+3
| | | | | Change-Id: I1309db70e98d678e150388c76ce665e988fdf081 Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: Record also unresolved paths for includesNikolai Kosjar2013-06-111-1/+1
| | | | | Change-Id: Id107b6c1f34f594c5a01502c156963c964235ed7 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: fix used template function parametersPrzemyslaw Gorszkowski2013-05-241-1/+14
| | | | | | | | | | | It was missing colorizing and follow symbol template function parameters in case of: * returning value * use it as qualified name Task-number: QTCREATORBUG-6861 Change-Id: I4226199e1f296cfe5a373783ebbc633e32fc9bcd Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* C++: highlighter clean-upsErik Verbruggen2013-04-181-48/+48
| | | | | | | | | - Moved TextEditor::SemanticHighlighter::Result to TextEditor::HighlightingResult - Moved SemanticInfo::UseKind to CppHighlightingSupport::Kind Change-Id: I14faab1891ca691a0691cfd9243edf19fcd3d3df Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: fix highlighting for template parameters for function calls.Erik Verbruggen2013-04-161-0/+4
| | | | | Change-Id: Ie0133893d8b8d35ea2aa599cb8f7d5c2cc55271e Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Merge remote-tracking branch 'origin/2.7'Eike Ziller2013-04-111-0/+14
|\ | | | | | | | | | | | | | | Conflicts: src/plugins/cpptools/cppchecksymbols.h src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
| * C++: name of function of class problemPrzemyslaw Gorszkowski2013-04-101-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It fixes: * highlighing * find usage * follow symbol when function of class has the same name as: * local variable * template parameter * other struct/union/class/enum * function argument in function scope. Task-number: QTCREATORBUG-8902 Change-Id: Iddc0f764af689babb40d39460d174bac7b919b31 Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | Clean headers in CppTools.Friedemann Kleint2013-04-101-12/+0
| | | | | | | | | | | | | | | | Ran script to remove inludes on a trial-and-error basis and manually corrected it. Change-Id: Ic8464ea084ca1ab401e9f4a7d0183b92b4038902 Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* | fix include style relating to cplusplus librariesOswald Buddenhagen2013-04-031-11/+10
|/ | | | | | | | | | | ... and adjust INCLUDEPATH accordingly. while i'm at messing with include statements, also re-order the include blocks according to policy and sort them within bigger blocks. Change-Id: I7762abfd7c4ecf59432b99db2f424e4fa25733a5 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Eike Ziller <eike.ziller@digia.com>
* C++: Fix semantic highlighter and tests.Erik Verbruggen2013-03-041-2/+5
| | | | | | | | Fixed the chunk size calculation, made the sorting more stable, and fixed the tests. Change-Id: I81fcffbf2ce9b63dd81f1a0e251200a31220db88 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* C++: Fix/tune semantic highlighter result chunk size.Erik Verbruggen2013-02-261-5/+12
| | | | | | | | | | | | The fix: when finished with a FunctionDefinition, only flush when the number of usages reaches the chunk size. This should prevent a lot of chunks with a low number of usages for files with short methods. The tuning: for files larger than 10000 lines, use a larger chunk size to prevent the UI thread from having to re-layout/re-paint too often. Change-Id: I419174d306b8380c6fa8402825767e26c73f62ec Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* Editor: Add further Use::isInvalid() guardsNikolai Kosjar2013-02-191-1/+1
| | | | | | | | Task-number: QTCREATORBUG-8738 Change-Id: I297731f15bd9001f7edc83c956a15ef660929dc7 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
* Fixed quotesRobert Loehning2013-02-111-2/+2
| | | | | Change-Id: Ia35af9397fe64f4bcf48717830a1a25f4d8c6c36 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
* Merge remote-tracking branch 'origin/2.6'Oswald Buddenhagen2013-01-311-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/autotoolsprojectmanager/AutotoolsProjectManager.pluginspec.in src/plugins/debugger/qtmessageloghandler.cpp src/plugins/debugger/qtmessagelogwindow.cpp src/plugins/madde/maemodeployconfigurationwidget.cpp src/plugins/qmldesigner/components/integration/designdocumentcontroller.cpp src/plugins/qmldesigner/designercore/include/widgetqueryview.h src/plugins/qmldesigner/designercore/metainfo/metainfoparser.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.cpp src/plugins/qmldesigner/designercore/model/modelnodecontextmenu.h src/plugins/qmlprojectmanager/qmlprojectapplicationwizard.cpp src/plugins/qnx/bardescriptormagicmatcher.h src/plugins/qt4projectmanager/profilekeywords.cpp src/plugins/remotelinux/deployablefilesperprofile.cpp src/plugins/remotelinux/deployablefilesperprofile.h src/plugins/remotelinux/deploymentinfo.cpp src/plugins/remotelinux/deploymentsettingsassistant.cpp src/plugins/remotelinux/profilesupdatedialog.cpp tests/auto/icheckbuild/ichecklib.cpp tests/auto/icheckbuild/parsemanager.cpp tests/auto/icheckbuild/parsemanager.h Change-Id: Ie465a578446a089e1c502d1cb1096e84ca058104
| * Incremented year in copyright infov2.6.2Robert Loehning2013-01-291-1/+1
| | | | | | | | | | Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205 Reviewed-by: Kai Koehne <kai.koehne@digia.com>
* | C++: Fix possible null-pointer access.Erik Verbruggen2013-01-301-1/+1
| | | | | | | | | | Change-Id: Id42bb1cbf109cac8ab868ab7381a54d6be9a7697 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
* | C++ editor: Highlight member variablePrzemyslaw Gorszkowski2013-01-291-1/+5
| | | | | | | | | | | | | | | | | | | | Highlight member variable when there is also enum value with the same name Task-number: QTCREATORBUG-7525 Change-Id: I0990844a20fdf9e87a807fde10708344b9c3497b Reviewed-by: Orgad Shaneh <orgads@gmail.com> Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>