Commit Graph

50 Commits

Author SHA1 Message Date
Robert Loehning
746c5d8863 Incremented year in copyright info
Change-Id: Ib5423fdd064e4546f848c0b640b0ed0514c26d3a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2014-01-08 08:29:47 +01:00
Nikolai Kosjar
b8dbac0b9c Rename "[Mm]ethod(s)" to "[Ff]unction(s)"
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>
2013-10-10 15:56:12 +02:00
Nikolai Kosjar
fd9293dd0a CppTools: CppPreprocessor: Track also unresolved includes
Change-Id: Ia36e7e7142dbc030a428369ed04e76e70e8eef0b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-08-22 11:57:27 +02:00
Przemyslaw Gorszkowski
3256b7b2ef C++: fix matching type with using from other namespace
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>
2013-08-20 14:13:19 +02:00
Nikolai Kosjar
e2ce17ef00 CppTools: Fix "! condition" coding style
Change-Id: Ic7e634e4249fb64edbc2daceb65ec8e9b5f0f8b9
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Aurindam Jana <aurindam.jana@digia.com>
2013-07-25 13:11:34 +02:00
Orgad Shaneh
ad9e7ccab6 Fix coding style for else statements
Change-Id: I1309db70e98d678e150388c76ce665e988fdf081
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-17 11:11:25 +02:00
Nikolai Kosjar
e3bc84c414 C++: Record also unresolved paths for includes
Change-Id: Id107b6c1f34f594c5a01502c156963c964235ed7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-11 15:54:52 +02:00
Przemyslaw Gorszkowski
f93758b8e1 C++: fix used template function parameters
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>
2013-05-24 14:23:14 +02:00
Erik Verbruggen
4b0f70f4c9 C++: highlighter clean-ups
- Moved TextEditor::SemanticHighlighter::Result to
  TextEditor::HighlightingResult
- Moved SemanticInfo::UseKind to CppHighlightingSupport::Kind

Change-Id: I14faab1891ca691a0691cfd9243edf19fcd3d3df
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-18 12:25:24 +02:00
Erik Verbruggen
3173f6fb3e C++: fix highlighting for template parameters for function calls.
Change-Id: Ie0133893d8b8d35ea2aa599cb8f7d5c2cc55271e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-16 12:05:06 +02:00
Eike Ziller
9ff8979da3 Merge remote-tracking branch 'origin/2.7'
Conflicts:
	src/plugins/cpptools/cppchecksymbols.h
	src/plugins/qmldesigner/components/formeditor/resizecontroller.cpp

Change-Id: I887ba071fa637ad44e39bcae581738fa078a6612
2013-04-11 18:27:52 +02:00
Przemyslaw Gorszkowski
bde6667240 C++: name of function of class problem
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>
2013-04-10 14:58:48 +02:00
Friedemann Kleint
4b0bafd615 Clean headers in CppTools.
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>
2013-04-10 10:55:14 +02:00
Oswald Buddenhagen
7923032022 fix include style relating to cplusplus libraries
... 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>
2013-04-03 13:40:39 +02:00
Erik Verbruggen
4cf1ccd161 C++: Fix semantic highlighter and tests.
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>
2013-03-04 13:16:50 +01:00
Erik Verbruggen
2d3d53a011 C++: Fix/tune semantic highlighter result chunk size.
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>
2013-02-26 14:54:47 +01:00
Nikolai Kosjar
35b4420f7a Editor: Add further Use::isInvalid() guards
Task-number: QTCREATORBUG-8738

Change-Id: I297731f15bd9001f7edc83c956a15ef660929dc7
Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-02-19 10:18:34 +01:00
Robert Loehning
234b4bd928 Fixed quotes
Change-Id: Ia35af9397fe64f4bcf48717830a1a25f4d8c6c36
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@digia.com>
2013-02-11 15:52:53 +01:00
Oswald Buddenhagen
1fda2111d4 Merge remote-tracking branch 'origin/2.6'
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
2013-01-31 16:25:33 +01:00
Erik Verbruggen
5721847a57 C++: Fix possible null-pointer access.
Change-Id: Id42bb1cbf109cac8ab868ab7381a54d6be9a7697
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-30 09:08:20 +01:00
Przemyslaw Gorszkowski
7db3b660b6 C++ editor: Highlight member variable
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>
2013-01-29 17:33:42 +01:00
Robert Loehning
298531e370 Incremented year in copyright info
Change-Id: Ic6a9ff0359625021ebc061d22db6811814534205
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-29 16:27:03 +01:00
Przemyslaw Gorszkowski
7fcc52bf47 C++ editor: Highlighting static variables
Fix highlighting, find usages, marking for static variables.

Task-number: QTCREATORBUG-6822
Change-Id: I0c97c93c6c1024550907eec3820496df22a94e85
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-29 14:01:11 +01:00
Przemyslaw Gorszkowski
23844410fd C++ editor: support nested class of enclosing template
Fixing:
* highlighting
* tooltips
* find usage
* selecting

Task-number: QTCREATORBUG-8245
Change-Id: I6e900799e43126706125b7e424567fca2b2c223e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-22 11:35:25 +01:00
Orgad Shaneh
29a93998df Remove braces for single lines of conditions
#!/usr/bin/env ruby

Dir.glob('**/*.cpp') { |file|
  # skip ast (excluding paste, astpath, and canv'ast'imer)
  next if file =~ /ast[^eip]|keywords\.|qualifiers|preprocessor|names.cpp/i
  s = File.read(file)
  next if s.include?('qlalr')
  orig = s.dup
  s.gsub!(/\n *if [^\n]*{\n[^\n]*\n\s+}(\s+else if [^\n]* {\n[^\n]*\n\s+})*(\s+else {\n[^\n]*\n\s+})?\n/m) { |m|
    res = $&
    if res =~ /^\s*(\/\/|[A-Z_]{3,})/ # C++ comment or macro (Q_UNUSED, SDEBUG), do not touch braces
      res
    else
      res.gsub!('} else', 'else')
      res.gsub!(/\n +} *\n/m, "\n")
      res.gsub(/ *{$/, '')
    end
  }
  s.gsub!(/ *$/, '')
  File.open(file, 'wb').write(s) if s != orig
}

Change-Id: I3b30ee60df0986f66c02132c65fc38a3fbb6bbdc
Reviewed-by: hjk <qthjk@ovi.com>
2013-01-08 10:48:18 +01:00
Eike Ziller
ba1d5f2cdf Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/share.qbs
	src/plugins/cpptools/cppchecksymbols.cpp
	src/plugins/texteditor/behaviorsettingswidget.cpp

Change-Id: Ia34060984f9c036b2f28a6411d796d41f55a3e37
2012-11-27 11:50:56 +01:00
Joerg Bornemann
8bdc9e975f fix QCoreApplication::translate usage in cppchecksymbols.cpp
Change-Id: I4fdae811af1efde50705d857f222866af188885c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: hjk <qthjk@ovi.com>
2012-11-26 10:44:55 +01:00
hjk
86afe889b0 Copile fix after f8645bb6
Change-Id: I3218ee94b414a4188c574bc63c9fa6c6d0d0a490
Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
2012-11-26 10:16:05 +01:00
Orgad Shaneh
f8645bb6c7 Translate some strings
Change-Id: I5eab1edbca591cc36813cd862d6ad93875b51a3c
Reviewed-by: hjk <qthjk@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-11-26 09:47:14 +01:00
Orgad Shaneh
be443b8edb CppTools: Compile with QT_NO_CAST_FROM_ASCII
Change-Id: I31a6117c2b4be3f8603c16a9f98b6937a0b9aeb2
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
2012-11-22 09:40:14 +01:00
Eike Ziller
6fd252b0a5 Merge remote-tracking branch 'origin/2.6'
Conflicts:
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.cpp
	share/qtcreator/qml/qmlpuppet/commands/endpuppetcommand.h
	src/plugins/debugger/qtmessageloghandler.cpp
	src/plugins/debugger/qtmessageloghandler.h
	src/plugins/debugger/qtmessagelogwindow.cpp
	src/plugins/madde/maemodeployconfigurationwidget.cpp
	src/plugins/madde/maemodeployconfigurationwidget.h
	src/plugins/remotelinux/deployablefilesperprofile.cpp
	src/plugins/remotelinux/deployablefilesperprofile.h
	src/plugins/remotelinux/deploymentinfo.cpp
	src/plugins/remotelinux/deploymentinfo.h
	src/plugins/remotelinux/deploymentsettingsassistant.cpp
	src/plugins/remotelinux/profilesupdatedialog.cpp
	src/plugins/remotelinux/remotelinuxdeploymentdatamodel.h
	tests/auto/icheckbuild/ichecklib.cpp
	tests/auto/icheckbuild/ichecklib_global.h
	tests/auto/icheckbuild/parsemanager.cpp
	tests/auto/icheckbuild/parsemanager.h
	tests/manual/ssh/tunnel/tunnel.h

Change-Id: I04d7761df6bd936ad00e0547974284c967d39580
2012-10-05 21:20:50 +02:00
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Christian Kamm
aa645254a2 C++11: More (expression-list) or brace-init-list.
This time in the 'new' expression. Changed it to make
new C(1, abc...) and new C{1, abc}
work.

Change-Id: I7232798fd083b653ee04ef9ede386d6536133e16
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-19 12:23:18 +02:00
Christian Kamm
b9f6f1bcf7 C++11: Allow uniform initialization in ctor init lists.
So
class C { C() : _x{12}, _y({12}) {} };
now parses correctly.

Change-Id: I4281dcb0541a86b550e74630cad6ae0a59fef1b4
Reviewed-by: hjk <qthjk@ovi.com>
2012-09-19 11:47:49 +02:00
David Schulz
33f8a42503 Editor: rename "Static" in Font & Colors settings
to more clearer "Enumeration"

Change-Id: I785edb6d31a4cd6a0875549f80bcf791ad61587a
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-08-29 11:21:58 +02:00
David Schulz
0fcf5515e5 Fix display of default keyword in switch statement as a Label
Task-number: QTCREATORBUG-7172
Change-Id: I08a89cbef183e33300f72ea8cc2c0da9a23c5413
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-08-17 11:13:20 +02:00
Sergey Shambir
95c5ab2746 Added support for override/final and enum classes
Change-Id: I6dfe9dd606781046ff5a1ed61315741d2f332cb8
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2012-07-30 09:42:30 +02:00
Eike Ziller
e0e8cf3ada Contact -> qt-project.org
Change-Id: I7134d7de30bcf9f9dcfad42520dd45ee083a852d
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
2012-07-19 13:23:21 +02:00
Leandro Melo
441c652ce5 C++: Change back highlighting of types
The type highlighting change part of the recent patch
4a2a17af8a didn't seem to
please much from a visual point of view. It's a better
idea to keep the type highlighting as it was for now
and in the future try again the approach with an explicit
option and perhaps a more restrictive context.

The other patch is not reverted entirely because it does
fix a couple of bugs.

Change-Id: I806afa3d8c1c4b241080b8704255d737f61ee12c
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-07-17 16:23:52 +02:00
Leandro Melo
4a2a17af8a C++: Changes in semantic highlighting
- Fix issues with virtual/non-virtual destructors. They were not
  being correctly identified in some cases - in particular on certain
  uses in derived classes.

- Since now we do have a highlighting item for regular functions,
  constructors and destructors are now highlighted as such. This is
  more semantically correct and actually makes navigation and readiblity
  more distinguishable, since it cleary differentiates the type itself
  from its uses in expressions and declarators. (This seems to be what
  other IDEs like Eclipse, Visual Studio, KDevelop are doing.)

  NOTE: There's a switch to disable this item in the case it doesn't
  get good acceptance. Actually, the switch can be made a user
  setting...?

- Change the default color scheme so regular and virtual functions
  have the same color (virtuals continue to be italic). This makes
  sense given the above mentioned changes in constructors/destructors
  highlighting behavior. (In other schemes virtual funcions don't have
  different color, so this shouldn't be necessary in those.)

- Small renaming: "members" are now "fields" - consistent, since
  they apply for data and it's the term used in the UI.

Change-Id: Ib1aa9c0bbf28a31d09f5696460b0095fbe29de80
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-07-17 13:53:19 +02:00
Francois Ferrand
809611f346 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>
2012-06-05 09:30:54 +02:00
Francois Ferrand
85609aff8e CppHighlighter: highlight macro references.
Change-Id: I7c90957aa67e03a109af0a722160d4e1c759d716
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-04-13 02:07:37 +02:00
Erik Verbruggen
210c191216 Revert "CppHighlighter: highlight all functions/methods."
This reverts commit e3e67467cfea5934f16a95385761455b0c495a0d

Reason is that it shows errors for calls to function-like macros. For example, any use of Q_DISABLE_COPY results in invalid errors.

Change-Id: I1fd1473ac5a30da5b9aebf6a3f0f11055bdbe8ad
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-29 15:53:23 +02:00
Francois Ferrand
e639a2381f 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: I6ab463996dda47554839f482da47f561f76663a7
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-29 14:53:48 +02:00
Erik Verbruggen
368d5926ca C++: handle destructor names with template parameters.
Change-Id: I74b4fd5e043db935abc18345b303d294b71e8fc2
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-23 08:39:34 +01:00
Flex Ferrum
da2aa0df72 C++: Add support for C++11 range-based 'for' loops
Change-Id: I7eef048a7952a79f031ae3d0abba68e3c5ffbfb8
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-21 15:27:00 +01:00
Erik Verbruggen
3fa55b7ab9 Removed module names from #include directives.
Getting the #include directives ready for Qt5. This includes the
new-project wizards.

Change-Id: Ia9261f1e8faec06b9285b694d2b7e9a095978d2b
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-15 16:24:46 +01:00
Erik Verbruggen
db25f9a136 C++: Added highlighting for labels.
Change-Id: I559a3112d2aa0a3c09554f8da8b7917f9aa27944
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-09 13:32:46 +01:00
Friedemann Kleint
622cac50f4 Move QtConcurrent library into Utils.
It causes a conflict with the new QtConcurrent library
of Qt 5 and is quite small.

Change-Id: Ib97ab6daf8f67a88300cf03f044ba3593a4cd270
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-09 12:33:10 +01:00
Erik Verbruggen
dbc3332b8e C++: Moved completion/highlighting into the model manager.
This way the editor does not need to know all the details of
instantiating or maintaining classes for highlighting and/or completion,
it can just ask the model manager. The change also enables different
highlighting- or completion-engines without changes to the cppeditor.

Change-Id: I8000d9d9fe446b292defddb2295493cf77d0f14a
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-02-08 14:30:14 +01:00