Commit Graph

77 Commits

Author SHA1 Message Date
hjk
ca15d0aa95 Apply static pattern to TextEditorSetting
Change-Id: I4e6f573d893c0aa2bb4ca9812fc8db2961dac172
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
2013-09-20 10:28:22 +02:00
Erik Verbruggen
b4a1bd415f C++: clean-up CppCompletionAssist.
This is step 1 of 2 for merging the various provider factories into a
single class. Merging has the advantage that selecting based on editor
(content) mime-type only has to select one class, instead of re-doing
the selection for each class separately.

Change-Id: I11f815151bd4769ae6028b636793d6a80d02e202
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-09-09 11:59:14 +02:00
hjk
a37589d431 Apply 'static' pattern to MimeDatabase
Also adjust and streamline using and surrounding code.

Change-Id: I6a8b05126bdcbb74ff611b21c7cb3c5902a2d5ca
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2013-09-03 11:41:45 +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
Oswald Buddenhagen
c2e90c360b Merge remote-tracking branch 'origin/2.8'
Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h
	src/plugins/projectexplorer/customtoolchain.cpp
	src/plugins/vcsbase/command.cpp

Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
2013-08-21 14:39:18 +02:00
David Schulz
e3c5796d2f Editor: Fix placing cursor after replacing "." with "->".
Task-number: QTCREATORBUG-9891

Change-Id: I9488dfc74226b12012c8d1cccd00db6d619074e1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-08-01 15:33:23 +02:00
Nikolai Kosjar
8d283ffd16 CppTools: Hide "QPrivateSignal" on signal completion (Qt5)
See also http://woboq.com/blog/how-qt-signals-slots-work-part2-qt5.html

Task-number: QTCREATORBUG-8540
Change-Id: Iccad837d7a0da982e7d7a1eda95ff1828cf1dce6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@digia.com>
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
2013-07-31 10:21:14 +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
Erik Verbruggen
1478e661ed Introduced mime-type for ObjC++.
Updated/fixed the code to treat treat text/x-objcsrc and
text/x-objc++src correctly.

Change-Id: I1ab97577c786a28381398e4e0fac177325d00d7b
Reviewed-by: Sergey Shambir <sergey.shambir.auto@gmail.com>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-07-18 16:45:27 +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
Eike Ziller
dd43d9908f Rename IDocument::fileName --> filePath
That is what it actually is, wrt how Qt API calls it.

Change-Id: Ied02055debf6aad75556b0d9d22e8ba2f72be555
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2013-07-09 13:51:42 +02:00
Przemyslaw Gorszkowski
68d6a762d9 C++: add support for local types
This change addes support for class, enum definition inside blocks({}) or
functions, e.g.:
void f()
{
	struct S
	{
		int bar;
	};
	S s;
	s.bar;
}

It fixes:
* code completion
* highlighting
* follow symbol
* marking
* find usages

It fixes also problem with namespace aliases inside blocks or functions.

This change can have also impact on performance(there are additional processing)

Task-number: QTCREATORBUG-166 (namespace aliases inside function/block)
Task-number: QTCREATORBUG-3620
Task-number: QTCREATORBUG-6013
Task-number: QTCREATORBUG-8020
Change-Id: Iaea6c6dfe276f1d7b2279b50bdd2e68e375d31eb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-06-18 10:09:51 +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
Oswald Buddenhagen
6fb94a7b10 Merge branch '2.7'
Conflicts:
	doc/src/qtquick/qtquick-components.qdoc
	doc/src/qtquick/qtquick-designer.qdoc
	qtcreator.pri
	qtcreator.qbs
	src/plugins/cppeditor/cppinsertdecldef.cpp
	src/plugins/qnx/qnxruncontrolfactory.cpp

Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
2013-05-15 10:21:47 +02:00
Erik Verbruggen
8e18adc70f C++: Fix crash in code completion.
Caused by a dangling pointer of a template instantiation which had been
cloned into the wrong control. The fix is to remove that control and
refer to the control of the bindings (which is the correct one).

Change-Id: I951a60f2e613aae1e4ac901ce99c820212018709
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
2013-05-03 10:56:26 +02:00
Erik Verbruggen
09ea0d235a C++: moved the CppPreprocessor into its own file.
Change-Id: I399d667a1fccb376fadbd6ab8fbba243e86d8f4b
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
2013-04-26 13:56:08 +02:00
Eike Ziller
b450b3071e TextEditors: Separate away methods that actually work on a document
Introduces ITextEditorDocument. This is part of a more general "use
documents instead of editors whereever possible". It will allow to move
to e.g. ITextEditor::openedTextDocumentContents() instead of
ITextEditor::openedTextEditorsContents().

Change-Id: I5ebceaa257a0d2c3e8ac4ac51b9b08b6faa42487
Reviewed-by: David Schulz <david.schulz@digia.com>
2013-04-19 16:21:30 +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
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