Commit Graph

60 Commits

Author SHA1 Message Date
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
eb30ab6604 C++: fixed code completion for namespace aliases
Task-number: QTCREATORBUG-166

Change-Id: I7a19065a57bfb943e5fc4e2bd9bd81988c1175e3
Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-10 15:04:02 +02:00
Sergey Shambir
a2730a4570 CppTools: added template function params to completions
Change-Id: I67e9685406a0bf9a7cc358ce24f0e862d7938be6
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-10 11:55:06 +02:00
Sergey Shambir
0609333e02 CppTools: moved some logic to ProjectFile
Simplifies code and makes it independent from mimetype names.

Change-Id: Ib56a07654df4986b1916c517e3862e6c3a3dd720
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-04-10 11:07:27 +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
Nikolai Kosjar
947207c802 C++: Fix dangling IDocument* in CppCompletionAssistProcessor
Steps to reproduce the crash:
 1. Open some long file, e.g. botan.cpp
 2. Trigger completion and close editor immediately

The IDocument pointer was only used to reference the file name. Instead
of passing an IDocument* to the IAssistInterface, pass the file name.

Change-Id: Iafce9b818806a77968a10541114bc9b7c8665f11
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-03-19 14:12:11 +01:00
Erik Verbruggen
bdb5142102 C++: use argumentCount in loops in initializer.
argumentCount is a more expensive function, so try to call it only once,
esp. in loops.

Change-Id: I6f0d420352743ec444487ce3f506ef28e5282d1e
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-03-15 15:46:09 +01:00
Friedemann Kleint
cb08f959b9 Fix Krazy warnings about includes/header guards in Cpp-Editor.
Change-Id: I00a68d7f2b509e3934c3248765a78e9b47749127
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-03-12 16:18:59 +01:00
Tobias Hunger
1951c86395 Reduce padding in often-used structs
Reduce the padding in some often-used structs for 64bit machines.
32bit machines should also profit from most changes, but to a
lesser degree.

Change-Id: Ic4c67b94e962731de4f31164c52a372d78944ccc
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
2013-02-21 13:22:21 +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
cede294788 C++: add test-case for member access replacement in completion.
Change-Id: Id5fe00b94a6622178db9bd26f54d29efe88970f7
Reviewed-by: Przemyslaw Gorszkowski <pgorszkowski@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-30 10:29:12 +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
David Schulz
bc137f36a7 Editor: Removed useless local variable.
No need to create local variables for pointers
which are used just once.

Change-Id: If917689019ac1319b9f9d3aee8fa15ec5a34d751
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-01-21 15:37:42 +01:00
Oswald Buddenhagen
65c169c80e Merge remote-tracking branch 'origin/2.6'
Conflicts:
	qtcreator.pri
	qtcreator.qbs
	src/plugins/android/androidrunner.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I653ddaef6e341818fc74aacfe30e89c07f40a8c6
2013-01-16 16:46:03 +01:00
Erik Verbruggen
6ce9a80afa C++: fix invalid common prefix calculation.
This was the indirect cause for "random" freezes when using
code-completion. The direct cause was a while loop counting down to 0,
but starting with a negative value. Both are fixed now.

Task-number: QTCREATORBUG-8472
Task-number: QTCREATORBUG-8532
Change-Id: I782a46be3ac8282d7484d0bf0c6fd30be6b171c8
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
2013-01-14 16:20:53 +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
Erik Verbruggen
cfc1069c78 C++: Remove hard-coded configuration file name.
Change-Id: Ibe4cc69eafd14dab7707862b1068ce1e21b1d8e0
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2012-12-04 08:33:33 +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
Nikolai Kosjar
efc96e402b C++: Fix regression not showing classes in completion.
Change-Id: I06b4289460d623da4b70d324d0cdf53ff7c972e7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-11-20 09:40:02 +01:00
Christian Kamm
19e03b186a C++11: Correct scoping for scoped enums.
Fixes completion, highlighting and find usages.

Change-Id: I1ea12c6a9c7a4f8ba0f9d55e31d6b7986233e7d8
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-31 15:09:06 +01:00
hjk
6fb3328dbe CppEditor: remove operator() overloads from OverView
Feels less obfuscated.

Change-Id: Ide0ec1f38762038ddbb1eddb4f70f7d6acdf1ff7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-10-17 11:20:10 +02:00
Christian Kamm
9c872643ae C++: Introduce an ordering of completion items.
For example locals and function argument names appear early whereas
macros and keywords are way down. That should move helpful
items to the top of the list.

Change-Id: Ibcfe973ebbac2e3bce9cafbe14dc4c71430ddca7
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2012-10-15 15:53:57 +02:00
hjk
6dfe3207d2 Cpp: No need for accessors for simple structs
Change-Id: Ie09c1fc59dd54d2302a78cfc9769d5cda6012be7
Reviewed-by: hjk <qthjk@ovi.com>
2012-10-11 23:16:51 +02:00
Erik Verbruggen
ba75725a7a C++: fix member rewriting when doing template instantiation.
Task-number: QTCREATORBUG-7964
Change-Id: Icc7d87bb4f2d1ab0560a6c06187d9c23da9fe3e9
Reviewed-by: David Schulz <david.schulz@digia.com>
2012-10-11 16:13:32 +02:00
David Schulz
d2a07dfa0d Editor: Fix Completion of includes triggered at '.'
Task-number: QTCREATORBUG-7522

Change-Id: I1a6c165b968fcb0a4058e91f95ca70d8b77a8970
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2012-10-10 07:55:56 +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
Eike Ziller
42f4595e37 Merge remote-tracking branch 'origin/2.5'
Conflicts:
	src/libs/cplusplus/cplusplus-lib.pri

Change-Id: I430ec8c6dda4afad3aedb1bc47d3af64537cfe66
2012-07-24 14:17:33 +02:00
Christian Kamm
9121c21230 C++: Fix class scope completion for templates.
* You now get completion for std::vector<int>::[complete].
* Also added a test.

Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h

Change-Id: I596ebf6bd18ec9a347113f8d162cc124c8a0d6b4
Reviewed-by: hjk <qthjk@ovi.com>
2012-07-20 13:41:15 +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
Sergey Shambir
edabcb40fa Added tooltips on completions proposals
Change-Id: Ic22b99e25159edfa4977e13c98f334ce75809af7
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-07-17 10:19:43 +02:00
Leandro Melo
7d63548964 C++: Fix potentially infinite loop in completion
Could be reproduced in code as below (cursor at |):

    QFormLayout|formLayout *fl = new QFormLayout(this);

Change-Id: I7f5e9ac8ff8dfffbca63d7ab9f837333440c9810
Reviewed-by: hjk <qthjk@ovi.com>
2012-06-29 15:41:40 +02:00
Leandro Melo
93894ab160 C++: Do not reuse content in completion if it's unfinished identifier
Taskn-number: QTCREATORBUG-7521

Change-Id: I7b8edb93d143f599c93a82c82bf2c0d49c8e49e9
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-06-20 16:08:23 +02:00
Erik Verbruggen
60db573660 [C++] Rewrite of the preprocessor.
This rewrite fixes a couple of issues with the pre-processor. It now
supports:
- macros in macro bodies
- stringification of parameters [cpp.stringize]
- the concatenation operator [cpp.concat]
- #include MACRO_HERE
- defined() inside macro bodies used in pp-conditions.

Change-Id: Ifdb78041fb6afadf44f939a4bd66ce2832b8601f
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-03-29 14:28:17 +02:00
Francois Ferrand
c1f3b7170d Do not add parentheses when completing dereferenced function.
When completing function name, scan text backwards to find if we are
trying to dereference the function.

Change-Id: I32cabecb651ff35d949600d9fdeb61c8e68ae98f
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-03-13 11:12:45 +01:00
Erik Verbruggen
2d262bd3b7 [C++] Added object pool handling for CompletionAssistProvider.
Change-Id: I89634989a7f360a30f7ed1bde4e67c93551ddfe4
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-23 10:33:50 +01:00
Eike Ziller
d66acb51d0 Rename IFile->IDocument and FileManager->DocumentManager
And adapt the other API respectively.

Change-Id: I1e04e555409be09242db6890f9e013396f83aeed
Reviewed-by: Bill King <bill.king@nokia.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2012-02-20 13:32:49 +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
Leandro Melo
70b64280ee Improve code-assist API isSortable
Now IGenericProposalModel::isSortable also takes the current prefix
as a parameter. This is particularly useful for cases like in the C++
completion: For global completions it will only sort if there's
already a content prefix - Notice, however, that the "sorting threshold"
for a maximum number of items is still kept in IGenericProposalModel::sort.

Task-number: QTCREATORBUG-6404
Change-Id: I3c2f282aa565287b8b4989930b6a27093862ef25
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-02-10 14:25:42 +01:00
hjk
2931a499e6 Long live the king!
Change-Id: I2b72b34c0cfeafc8bdbaf49b83ff723544f2b6e2
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-26 19:55:36 +01:00
hjk
4a21f0c3c8 Use new static ICore interface.
Change-Id: I9b690d9b150c8d162b15370f9f8986267c9128f1
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 18:48:47 +01:00
Leandro Melo
efe9bca20c C++: Replace non-absolute-critical asserts for soft ones
Change-Id: I021074a78d90929b4e83b8aff9db1ae7995e8c6a
Reviewed-by: hjk <qthjk@ovi.com>
2012-01-24 09:58:59 +01:00
Leandro Melo
c287d90604 C++: Rename source/setSource to utf8Source/setUtf8Source
Continuinng a previous commit... This is in order to make
the interface clearer.

Change-Id: Ic1b05217f878578bc84a064927507b75981c47d6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 11:22:28 +01:00
Leandro Melo
fd179ed951 C++: Accept UTF-8 byte arrays in type of expression
The model uses UTF-8 internally and it makes more sense to only
convert when necessary.

A following commit will rename the source/setSource methods in
document for more clarity too.

Change-Id: I960ea0754efabd1436ad4b4299a57faeb65a8bee
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-13 10:17:03 +01:00
Eike Ziller
85cf2b661e Merge remote-tracking branch 'origin/2.4'
Conflicts:
	src/libs/qmljs/qmljsinterpreter.cpp
	src/libs/qmljs/qmljsinterpreter.h
	src/plugins/debugger/qml/scriptconsole.cpp
	src/plugins/git/gitplugin.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas.cpp
	src/plugins/qmlprofiler/canvas/qdeclarativetiledcanvas_p.h

Change-Id: Iad59c8d87c72a21c79c047e374c0ab689998af39
2011-11-11 09:46:25 +01:00
hjk
82f5573626 more Id type fixes
Change-Id: I3720946ba5485696822976567d83b4d6cb1fb283

x

Change-Id: Iab58bc34bc56371405d132315573b484a533b77c
Reviewed-by: hjk <qthjk@ovi.com>
2011-11-10 15:57:09 +01:00
hjk
31600758de all: s/info@qt.nokia.com/qt-info@nokia.com/
Change-Id: If18afb5d4665924e7d9250dccbc60a65e6daa75e
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-11-03 10:33:19 +01:00
Yuchen Deng
4ea9c21932 C++: Improve completion assist
Avoid inserting characters that are already there.
e.g.
int testFly() {}
te|Fly()
When triggers a completion, the code will changed to:
testFly()|
But in before, the code will changed to:
testFly()|Fly()

Notice:  Character of '|' show the cursor position.

Change-Id: I6c111e30356b2549aebc6fbea05608e70d6ab41f
Merge-request: 398
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-10-17 12:22:00 +02:00
Leandro Melo
a1fa169219 C++: Fix duplicate items in C++ completion for Qt methods
In the old code completion engine items were created on the stack
and passed around by value. With the refactoring of the code assist
API they became heap objects manipulated through pointers. This
patch fixes one reminiscence not caught during the refactoring
in which the same actual pointer was being used more than once to
be appended on the list.

Change-Id: I2009fb0b6aa18df57aa5ca9bde0591536ca2cd74
Reviewed-on: http://codereview.qt-project.org/4444
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 14:53:54 +02:00
Leandro Melo
e15443e952 Code assist: Fix memory leak in completion
One fix is in the runner, which is part of the completion
engine itself. The other is specific for C++.

Task-number: QTCREATORBUG-5947
Change-Id: Ib8fff1eb5adad1ffb2a11da66c50b545e1457df8
Reviewed-on: http://codereview.qt.nokia.com/4355
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-07 14:42:16 +02:00