Commit Graph

100 Commits

Author SHA1 Message Date
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
Leandro Melo
466ea4842c C++: Improve file accuracy when finding symbols
This patch introduces a priority-based mechanism when searching for certains
symbols in the snapshot. The priority corresponds to how similar the file path
from the "reference" symbol is to the file path from the "candidate" symbol.
This solves a variety of issues when matching "equivalent" symbols but that
are in another file/project, such as when following a function declaration,
a forward class declaration, or adding a definition through a quickfix.

There's now a symbol finder which will compute the "best" search order and cache
the most recent results. A consequence is that following symbols in some cases
is slower, but not apparently significatly.

Note: The "find" functions were moved from the Snapshot to the new SymbolFinder
class.

Task-number: QTCREATORBUG-6697
Task-number: QTCREATORBUG-6792

Change-Id: Ia518f014275fec1f4d0cb3224bd4e06a9df6d557
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-23 11:34:44 +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
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
Christian Kamm
5cd2123862 C++: Fix findMatchingDeclaration for functions not in a class.
That fixes navigation and the 'function signature update' quickfix for
global functions and functions in namespaces.

Task-number: QTCREATORBUG-6413
Change-Id: Ifc68a88a34eb363f4e84c72e9f72444d22df1086
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-10-31 11:52:07 +01:00
Christian Kamm
9898a5e094 C++: Fix bug in findMatchingDefinition.
In strict mode, don't give up after the first Document with candidates.

Change-Id: I62ba59708a3501b31f79d979b1a85bede875eccb
Reviewed-on: http://codereview.qt-project.org/5142
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-20 07:24:37 +02:00
Christian Kamm
10a956a8f7 QmlJS: Find setContextProperty calls in C++ and expose to QML.
Task-number: QTCREATORBUG-3199

Change-Id: I591490ceafadc0f5a07c63ec063f1bdfa7055f47
Reviewed-on: http://codereview.qt-project.org/4074
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-09-08 12:34:22 +02:00
Christian Kamm
9f7a2194f7 QmlJS: Fix infinite loop when scanning for exported C++ types.
Setting extra diagnostics would call updateDocument which would in turn
trigger another scan.

Change-Id: I3810a380cdf716a12767d94ff82dc30f8ae3954d
Reviewed-on: http://codereview.qt.nokia.com/3917
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-31 10:53:21 +02:00
Christian Kamm
51ea52971f C++: Always remove NumericLiterals when removing the AST.
Contrary to StringLiterals, keeping them around is unnecessary.

Change-Id: Idc1967c125e1373e69ce4c7640328d323a84ec14
Reviewed-on: http://codereview.qt.nokia.com/3395
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-08-25 13:19:32 +02:00
Christian Kamm
27d0830698 QmlJS: Move the exported-C++-type detection out of C++ code.
It now lives in qmljstools/qmljsfindexportedcpptypes, all in one place.

Also ensures that the source code is available when a file is being
scanned for QML exports. This will enable checking comments for
annotations about the URI a plugin is usually imported as.

Change-Id: I1da36d0678e0a8d34b171dbe0f6b5690d89eb18b
Reviewed-on: http://codereview.qt.nokia.com/3392
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-24 12:13:41 +02:00
Christian Kamm
451e9dbb02 C++: Fix ::A name handling in findMatchingDeclaration.
Change-Id: Id158be80c42056c145c2b787d4f569e2c0a0b66e
Reviewed-on: http://codereview.qt.nokia.com/2932
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-08-16 11:13:52 +02:00
Christian Kamm
8f14bc0ea2 C++: Synchronize function decl/def refactoring.
When editing a function declaration or definition the code model
may realize the same changes have to be applied somewhere else. A
refactoring marker will pop up that can be clicked to perform the
changes. Alternatively, press enter to apply.

Change-Id: I2299a2ecfb6a8f87d4853fc7cfa99486f890a1d3
Reviewed-on: http://codereview.qt.nokia.com/2909
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-16 11:13:12 +02:00
Christian Kamm
01bb7443fd C++: Fix off-by-one in scopeAt.
The only Scope that set the end offset to *before* the last token
was ObjCClassDeclaration.

Change-Id: Icbdb5bcdd72d96087ac586ad51510fed74a633eb
Reviewed-on: http://codereview.qt.nokia.com/2820
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-10 14:37:17 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
Christian Kamm
ccb49b9873 QmlJS: Disable possibly confusing warnings on qmlRegisterType.
Reviewed-by: Roberto Raggi
Reviewed-by: Erik Verbruggen
2011-03-03 11:55:48 +01:00
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
Christian Kamm
d3c1dd6a09 C++/Qml: Don't allow exported types to override builtins.
There was trouble when a plugin qmlRegisterType'd something like 'Item'
into the global default module.

Reviewed-by: Roberto Raggi
2011-01-10 14:40:40 +01:00
Christian Kamm
c7070526ec Qml/C++: Allow dynamic uri in qmlRegisterType if fixed by Q_ASSERT.
Reviewed-by: Erik Verbruggen
2011-01-06 15:01:59 +01:00
Christian Kamm
0194da7300 Qml-C++: Find C++ qmlRegisterType calls and populate QML code model.
Reviewed-by: Erik Verbruggen
2011-01-04 15:58:22 +01:00
con
b1bcf081d8 Merge branch '2.1'
Conflicts:
	src/plugins/coreplugin/basemode.cpp
	src/plugins/coreplugin/basemode.h
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.cpp
	src/plugins/coreplugin/scriptmanager/qworkbench_wrapper.h
	src/plugins/debugger/cdb/cdbsymbolpathlisteditor.cpp
	src/plugins/debugger/debuggeragents.cpp
	src/plugins/debugger/debuggeruiswitcher.cpp
	src/plugins/debugger/debuggeruiswitcher.h
	src/plugins/projectexplorer/buildconfigdialog.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.cpp
	src/plugins/qmldesigner/components/propertyeditor/colorwidget.h
	src/plugins/qmldesigner/designercore/include/enumeratormetainfo.h
	src/plugins/qmldesigner/designercore/include/modelutilities.h
	src/plugins/qmldesigner/designercore/include/nodeinstance.h
	src/plugins/qmldesigner/designercore/include/propertymetainfo.h
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicsscenenodeinstance.h
	src/plugins/qmldesigner/designercore/instances/graphicsviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/graphicswidgetnodeinstance.h
	src/plugins/qmldesigner/designercore/instances/nodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/qmlviewnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.cpp
	src/plugins/qmldesigner/designercore/instances/widgetnodeinstance.h
	src/plugins/qmldesigner/designercore/metainfo/enumeratormetainfo.cpp
	src/plugins/qmldesigner/designercore/metainfo/propertymetainfo.cpp
	src/plugins/qmldesigner/designercore/model/modelutilities.cpp
	src/plugins/snippets/inputwidget.cpp
	src/plugins/snippets/snippetscompletion.cpp
	src/plugins/snippets/snippetscompletion.h
	src/plugins/snippets/snippetspec.cpp
	src/plugins/snippets/snippetsplugin.cpp
	src/plugins/snippets/snippetswindow.cpp
	src/plugins/snippets/snippetswindow.h
	src/plugins/texteditor/snippetsparser.cpp
	src/tools/qml/qmldom/main.cpp
	tests/manual/trk/runner.cpp
	tests/manual/trk/trkolddevice.cpp
	tests/manual/trk/trkolddevice.h
	tests/manual/trk/trkserver.cpp
2010-12-17 17:00:53 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Roberto Raggi
63138eb808 Added some initial support for function overloading. 2010-12-10 10:32:46 +01:00
Erik Verbruggen
72aa551a97 C++: implemented switch decl to def for operators
Task-number: QTCREATORBUG-2313
Reviewed-by: Roberto Raggi
2010-11-19 11:50:28 +01:00
Roberto Raggi
05f2fd6669 Renamed Symbol::scope() to Symbol::enclosingScope(). 2010-08-26 16:16:22 +02:00
Roberto Raggi
988cc958ab Renamed Symbol::identity() to Symbol::unqualifiedName(). 2010-08-26 12:23:09 +02:00
Roberto Raggi
e5ecb6b072 Nicer implementation of Document::lastVisibleSymbolAt(). 2010-08-17 13:42:30 +02:00
Roberto Raggi
0540aa362d Get rid of the old Semantic pass. 2010-08-13 16:55:43 +02:00
Roberto Raggi
6659e3ecba Use the new binder 2010-08-13 16:55:43 +02:00
Roberto Raggi
41b4af0501 Get rid of the prefix findOrInsert for the functions in CPlusPlus::Control. 2010-08-11 15:25:19 +02:00
Roberto Raggi
354b9712e4 Merged ScopedSymbol and Scope. 2010-08-11 15:25:18 +02:00
Erik Verbruggen
867bf3dae8 Fixes for scope range calculation. 2010-07-19 10:42:32 +02:00
Erik Verbruggen
13ff3e2961 Added comment. 2010-07-16 16:04:58 +02:00
Roberto Raggi
fff4203a46 Introduced helpers to rewrite types and names.
Done-with: Erik Verbruggen
2010-07-16 11:04:52 +02:00
Erik Verbruggen
45e12ccb42 Fixed scope calculation in code completion. 2010-07-06 09:19:20 +02:00
Roberto Raggi
76ebb46479 Fixed: "Follow symbol" on constructor or destructor always jumps to class definition
Task-number: QTCREATORBUG-1776
2010-07-05 13:38:53 +02:00
Christian Kamm
eb2ac188f2 C++: Make 'follow symbol' for classes work in more cases.
Previously, it would still fail if a forward declaration and declaration
for a class were in the same file.

Task-number: QTCREATORBUG-20
2010-06-18 09:28:32 +02:00
Christian Kamm
e1a0f5abef C++: Make 'follow symbol' work with forward declared classes.
If it encounters a forward declaration, it tries to find the class
declaration globally now.

Task-number: QTCREATORBUG-20
2010-06-16 15:37:39 +02:00
Roberto Raggi
09bf431ab5 Fixed jump to the matching definition. 2010-05-21 11:35:37 +02:00
Roberto Raggi
8ecbb44183 Turn on C++0x support. 2010-05-21 10:51:48 +02:00
Erik Verbruggen
164aed22a5 Fixed scope discovery. 2010-05-20 16:07:33 +02:00
Roberto Raggi
18490596f9 Renamed Document::findSymbolAt(). 2010-05-17 13:01:56 +02:00
Roberto Raggi
c739119c2a Fixed Document::scopeAt() to always return a valid scope. 2010-05-14 13:55:21 +02:00
Roberto Raggi
60f76c96e8 Improved LookupItem and get rid of some deprecated code. 2010-05-14 13:55:21 +02:00
Roberto Raggi
c282da7d1e Introduced Snapshot::findMatchingDefinition(). 2010-05-11 14:15:07 +02:00
Roberto Raggi
7eae51507c Removed deprecated method Snapshot::globalNamespaceBinding(). 2010-05-11 14:15:06 +02:00
Thorbjørn Lindeijer
b9757a5eb3 Disable C++0x support for now
It introduced at least one new crash to do with recovering from parsing
errors.

Reviewed-by: Roberto Raggi
2010-03-25 19:32:45 +01:00
Roberto Raggi
8329d7db94 Recognize C++0x lambda expressions. 2010-03-24 13:49:02 +01:00
Roberto Raggi
61a504c427 Ensure that the memory pool can be reused after a rewind and get rid of the segmented array. 2010-03-18 15:23:13 +01:00
Erik Verbruggen
1cc5e1fe01 Put the include depenency table into a separate class, and cache it when possible. 2010-03-17 14:20:17 +01:00