Commit Graph

26 Commits

Author SHA1 Message Date
hjk
386ca7c8dd Adjust license headers
Change-Id: Ice592c6de9951ee3b2c4cb52ed0bb3b6770e0825
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2012-10-05 17:12:56 +02:00
Leandro Melo
8a917b3011 C++: Fix add definitions on empty files
Task-number: QTCREATORBUG-7838

Change-Id: I8e9d452cf4c8ab5dd9f2a7f39d3802baf84609e1
Reviewed-by: David Schulz <david.schulz@nokia.com>
2012-09-12 14:39:35 +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
5b847a66df C++: Handle add definition on empty files
Now in the case of a matching empty file we still select a best
token so the insertion happens *at* the end of the file.

The patch also fixes line breaks after the definition to be inserted
for situations in which there's no line break yet. Example:

namespace Foo {}

namespace {
}

Another thing for correctness. Member _key from HighestValue is now
value initialized instead of default initialized.

Task-number: QTCREATORBUG-6696
Change-Id: I5c0303675429c3da5cb88825272c9611be022f6a
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-31 16:44:38 +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
474fa9a7ff Fix assert
Change-Id: I41b4b444fdce6d73c0c62aa1d98a7c9d80a6a4c9
Reviewed-by: Tobias Hunger <tobias.hunger@nokia.com>
2012-01-24 14:06:05 +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
b97b45a341 C++: Fix "reference" file in symbol finder
Througout the initial review the singleton was transformed into an
ordinary class, but a error was introduced: The "reference" file was
incorrectly assumed to be the editors file, which is wrong, since
it should be the declaration file.

Change-Id: Iad3e25a690fa8bd07a18184b24b10f8dea965332
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-23 17:17:00 +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
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
107544bd7b C++: Set endOffset of Function symbols even if skipping bodies.
Fixes insert-definition-from-declaration when the source file was not
yet opened in an editor.

Change-Id: I4263113390ae4fbe9d4641104b5cb43373ddc5a4
Reviewed-on: http://codereview.qt-project.org/4394
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-08 10:05:22 +02:00
Christian Kamm
930e7b711d C++ insert def: Insert next to surrounding definitions.
Change-Id: I1bef659084727d7fe69670c991ee5efe2be66497
Reviewed-on: http://codereview.qt.nokia.com/3713
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-30 09:03:08 +02:00
Christian Kamm
8a6d767a8f Refactoring changes: Cleanup and improvements.
Previously RefactoringFiles were usually passed around by value.
However, since a RefactoringFile may sometimes own a QTextDocument
(when it was read from a file), that's not great and caused the
file to be reread after every copy.

With this change RefactoringFile becomes noncopyable and is always
owned by a shared pointer.

This change also allowed having const RefactoringFiles which is
useful because they can be safely used from other threads. See
CppRefactoringChanges::fileNoEditor.

Change-Id: I9045921d6d0f6349f9558ff2a3d8317ea172193b
Reviewed-on: http://codereview.qt.nokia.com/3084
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-19 11:12:09 +02:00
Friedemann Kleint
6a6af5a59c Header cleanup in various plugins.
Change-Id: I16b273cc792bfd2035d35e7c67675f039cd387b9
Reviewed-on: http://codereview.qt.nokia.com/3185
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-08-18 15:05:00 +02:00
Christian Kamm
6fe8d74af8 C++ insert definition: Find better insertion point.
Change-Id: Ic424ae7ed4ac6dcda5d96353071ba0415c1815da
Reviewed-on: http://codereview.qt.nokia.com/2732
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-08 14:47:56 +02:00
hjk
b4b9ba7e2a cpptools: use static CppToolsPlugin functions instead of indirect access
Saves a symbol.

Change-Id: Id949799852560a3e22da9c0a858b399c6ab3d6e1
Reviewed-on: http://codereview.qt.nokia.com/1295
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
2011-07-08 12:39:01 +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
con
d1023c7614 It's 2011 now.
Reviewed-by: hjk
2011-01-12 09:46:24 +01:00
con
04e32b0049 License headers. 2010-12-17 16:03:42 +01:00
Erik Verbruggen
4cebb668bf C++: check for header file without corresponding source file in quickfix.
Reviewed-by: Christian Kamm
2010-10-08 13:15:21 +02:00
Erik Verbruggen
ac9fc40645 C++ Editor: check for method existing decl/def when inserting new ones. 2010-10-08 13:15:20 +02:00
Erik Verbruggen
0555837c7f C++ Editor: prevent insertion of method definitions in header files. 2010-10-08 13:15:20 +02:00
Thorbjørn Lindeijer
9248e2cf46 Fixed compile on case-sensitive file systems 2010-09-30 14:02:35 +02:00
Erik Verbruggen
3ebc328498 C++: added quickfix to insert a method definition.
Reviewed-by: Christian Kamm
2010-09-30 12:19:39 +02:00