Commit Graph

389 Commits

Author SHA1 Message Date
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
07d335b215 C++: Avoid trying to generate Doxygen when at end of file
Change-Id: I1fc126782bd88dd65ff83f50fc1dcf65e51a37ff
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2012-02-10 16:25:41 +01:00
Tommi Asp
94747f578b C++: Fix while-loop from CppEditorWidget
Caused while to run forever when not checking
cursor.movePosition() return value.

Change-Id: Ie8211a477ab1889d4583d3b01e1a200d9905fd6d
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-02-10 15:56:45 +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
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
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
b0b105d575 ProjectExplorer: make currentProject static
This saves one function call compared to the instance()->currentProject()
pattern and is typically less to type on the caller site.

Change-Id: I65568f30205fc90e2aaca7e8e7f0192241df8c85
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
2012-01-24 19:20:13 +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
fa34576f3f C++: Avoid superfluous * in comment continuation
This fixes the issue pointed below and the general case
int which superfluous asterisks are generated.

Task-number: QTCREATORBUG-6823
Change-Id: I1c8659fb5734609d90cfad052804943b8b99d5df
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-24 11:41:56 +01:00
Leandro Melo
8e3c88f02b C++: Share symbol finder across editor instances
Change-Id: I75880597d237bbbe1393dd02153cedba1165bed6
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2012-01-24 11:41:49 +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
Bojan Petrovic
a138465848 C++: Select All select the symbol while renaming symbol
https://bugreports.qt.nokia.com//browse/QTCREATORBUG-5520

Change-Id: Ifb163adb2609e17cdbc3df1e90b7e583c75fac49
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-01-20 15:27:09 +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
Friedemann Kleint
9128fc2ab0 CppEditor: Compile with QT_NO_CAST_FROM_ASCII.
- Avoid unnecessary conversions
- Add missing tr().

Change-Id: I3c0dd627a3621929c9c6fc71db6924fa513e34a7
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2012-01-12 13:50:30 +01:00
Leandro Melo
beede7d7cf C++: Automatic Doxygen comment blocks generation
This improves our completion support for documentation
comments. It's now possible to have a Doxygen block
generated when hitting enter after a /** or /*! comment
start. A couple other related options are also available.

Task-number: QTCREATORBUG-2752
Task-number: QTCREATORBUG-3165

Change-Id: I1c81c0b4b370eb1d409ef72a9c7f22c357f202f4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@nokia.com>
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-12-09 10:25:59 +01:00
Eike Ziller
fbd47e25ee Merge remote-tracking branch 'origin/2.4'
Conflicts:
	qtcreator.pri
	share/qtcreator/templates/qtquickapp/main.cpp
	src/plugins/analyzerbase/analyzermanager.cpp
	src/plugins/qmlprofiler/qmlprofilertool.cpp

Change-Id: I3be78f22e7301d61a9c7fc142cbc34a3cebc2cf4
2011-11-18 10:16:49 +01:00
Leandro Melo
fa7c7c4eca C++: Don't show unused mark for known RAII types
Change-Id: Id552539c6a2cf5d7558adf88bed61a11ab770516
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-11-15 11:12:36 +01:00
Christian Kamm
af8b381f98 C++ editor: Unify rehighlight() and semanticRehighlight().
They did the same thing.

Change-Id: Ic4d1a269417575110ea32ba5d583a01397c9d806
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-15 08:57:32 +01:00
Christian Kamm
b182606193 C++ editor: Reparse after applying rename.
Fixes using quick fixes directly after finishing a rename.

Task-number: QTCREATORBUG-6412

Change-Id: I22ee1df5f64189e87f6a3b3ae41781ed4b24afb4
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
2011-11-14 13:25:48 +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
Leandro Melo
36deb6b060 C++: Fix navigation for macros
Task-number: QTCREATORBUG-6399

Change-Id: Ic259d6cfed10e650d2eb7e07bdfacbc9038e51d0
Reviewed-by: Christian Kamm <christian.d.kamm@nokia.com>
2011-11-08 15:11: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
hjk
488330255d core: rename uniqueidmanager.{cpp,h} as the class UniqueIdManager is gone
Change-Id: Iffe04bc3bb0103cbac605f0734bbfd66eb7fd854
Reviewed-on: http://codereview.qt.nokia.com/4215
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
2011-09-05 18:04:55 +02:00
Christian Kamm
e99f915623 C++: Trigger function signature change via quick fix.
This way we don't need to override Return and Escape.

Change-Id: I1548118c06ee7338ba3dd9d84b82b9314ab16782
Reviewed-on: http://codereview.qt.nokia.com/4183
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-09-05 12:14:27 +02:00
Christian Kamm
13a2e49dda C++: Set property on CppEditorWidget when in function link.
To allow FakeVim to pick up on the state and pass through Enter/Return.

Change-Id: Ia203a1b3fa8877d90cbaf4b46183bb01a6de1362
Reviewed-on: http://codereview.qt.nokia.com/3856
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: hjk <qthjk@ovi.com>
2011-08-30 10:20:10 +02:00
Christian Kamm
3dcf168165 C++ function link: Disable function links on name change.
Change-Id: Ib5e3a3a381568347a7a465f956f7daad15f10ab0
Reviewed-on: http://codereview.qt.nokia.com/3596
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
2011-08-26 08:47:36 +02:00
Christian Kamm
47789fb4f9 C++: Remove unused SemanticInfo::diagnosticMessages.
Change-Id: I06e3be876e971d191905fd9bfbeca55a762afa5c
Reviewed-on: http://codereview.qt.nokia.com/3483
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-25 14:37:46 +02:00
Christian Kamm
c105ae47c1 QmlJS: Add semantic highlighting.
Change-Id: If9293244075cff1a52801b50cdbb77248ecd21ea
Reviewed-on: http://codereview.qt.nokia.com/3310
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-08-24 11:30:20 +02:00
Christian Kamm
e434969446 C++ function link: Unbreak same-file links.
Change-Id: Icfb71278c796dfb8668de423a691c7dc90e9531f
Reviewed-on: http://codereview.qt.nokia.com/3170
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-08-18 13:08:16 +02:00
Christian Kamm
4e1d92fddc C++ function link: Disable link if target editor changes.
Change-Id: I7041f3c520e88b4376c5cbac08ed79aa44641f0f
Reviewed-on: http://codereview.qt.nokia.com/3088
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-18 10:57:40 +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
ac87bca151 C++: Make Source::revision unsigned instead of int.
All places that use it deal with unsigned revisions:
* SemanticInfo::revision
* Document::revision
* CPPEditorWidget::editorRevision

Even though QTextDocument::revision is int.

Change-Id: I2b3a94056d15fd02539d14c7cec35511abed57b5
Reviewed-on: http://codereview.qt.nokia.com/2954
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
2011-08-16 08:02:50 +02:00
Kai Koehne
7c5c6fc88e Fix gcc warnings about signed/unsigned comparison
Change-Id: I43f0de47dccf67da2f4b622f70c76a69198286d5
Reviewed-on: http://codereview.qt.nokia.com/2860
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
2011-08-12 11:19:37 +02:00
Leandro Melo
4becd473f8 C++ editor: Make semantic info aware of file rename
This also changes the mutex so that the check for reusing
the last semantic info is consistent.

Task-number: QTCREATORBUG-5276

Change-Id: Ia5a2dae25ba3aa40949ac751bcda209d0bcf1f3c
Reviewed-on: http://codereview.qt.nokia.com/1581
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-07-13 13:11:45 +02:00
Leandro Melo
b260bf1e73 C++ editor: Fix follow symbol for member functions
Fix a regression introduced by ad53fa42b0
in which follow symbol takes you to the function declaration (instead
of to the type) for situations like the one below (the | indicates the
cursor):

void Ty|pe::function() {}

Change-Id: Iffd15b23bb0cd67eca5965cb22d9b60c4d024fb7
Reviewed-on: http://codereview.qt.nokia.com/1375
Reviewed-by: Erik Verbruggen <erik.verbruggen@nokia.com>
2011-07-08 14:22:05 +02:00
Leandro Melo
b9bbf24680 C++ editor: Restrict outline combo popup width
Use Creator's main window as a reference for the width. Note that
this does not necessarily imply they are aligned.

Task-number: QTCREATORBUG-4021
Change-Id: Id0be8a7435d9b3f9eaab638f7a82bb0bd1afa192
Reviewed-on: http://codereview.qt.nokia.com/109
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Reviewed-by: Fawzi Mohamed <fawzi.mohamed@nokia.com>
2011-05-25 14:08:49 +02:00
Christian Kamm
779fafcbfe Make C++ code style configurable.
Change-Id: Iaf08edb2361146e6b5e1cbafdb716a23c938875b
Done-with: Jarek Kobus
Task-number: QTCREATORBUG-2670
Task-number: QTCREATORBUG-4310
Task-number: QTCREATORBUG-2763
Task-number: QTCREATORBUG-3623
Task-number: QTCREATORBUG-567
Reviewed-on: http://codereview.qt.nokia.com/74
Reviewed-by: Leandro T. C. Melo <leandro.melo@nokia.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@nokia.com>
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
2011-05-24 12:45:07 +02:00
Leandro Melo
bec4f02495 New code assist API
This is a re-work of our completion engine. Primary goals are:

- Allow the computation to run in a separate thread so the GUI is not locked.
- Support a model-based approach. QStrings are still needed (filtering, etc), but
internal structures are free to use more efficient representations.
- Unifiy all kinds of *assist* into a more reusable and extensible framework.
- Remove unnecessary dependencies on the text editor so we have more generic
and easily "plugable" components (still things to be resolved).
2011-05-18 10:46:20 +02:00
Oswald Buddenhagen
9ac137fb06 add auto-saving of modified editors
Task-number: QTCREATORBUG-2847
2011-05-12 20:10:03 +02:00
Oswald Buddenhagen
a14955d0fb move the "cannot undo" warning to the search result pane
this is where it belongs, rather than into some arbitrary editor.
as a nice side effect, now not only the "rename symbol", but also the
global search&replace has such a warning.
2011-05-12 20:10:03 +02:00
Oswald Buddenhagen
882e34ee28 rewrite editor info bar handling
the info about the bars is now stored in the IFile, not in the
EditorView. this is somewhat more expensive for the bars which
identically apply to all editors of one type, but fixes consistency
issues between views.

additionally, it is now possible to set several simultaneous
info bars per file, which ensures that no information is lost.

Co-authored-by: mae
2011-05-12 20:10:02 +02:00
Tobias Hunger
aa2acec14c Fix/add copyright headers
Change-Id: I8b73d583be1ee7183f4074bce49d5390e38631a2
2011-05-06 15:17:05 +02:00
Oswald Buddenhagen
fae7dc9584 add errorString output argument to IFile::reload() & IEditor::open()
add/unify read error handling in all affected classes
2011-04-18 14:10:13 +02:00
Oswald Buddenhagen
dc3c156cac Merge branch '2.2'
Conflicts:
	src/plugins/debugger/gdb/pythongdbengine.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4desktoptargetfactory.h
	src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.cpp
	src/plugins/qt4projectmanager/qt-desktop/qt4simulatortargetfactory.h
	src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemodeviceconfigurations.cpp
	src/plugins/qt4projectmanager/qt-maemo/maemoglobal.cpp
	src/plugins/qt4projectmanager/qt-maemo/qt4maemotargetfactory.cpp
	src/plugins/qt4projectmanager/qt-s60/qt4symbiantargetfactory.cpp
	src/plugins/qt4projectmanager/qt-s60/s60deploystep.cpp
	src/plugins/qt4projectmanager/qt4target.cpp
	src/plugins/qt4projectmanager/qt4target.h
	src/plugins/qt4projectmanager/qtoptionspage.h
	src/plugins/qt4projectmanager/qtversionmanager.cpp
	src/plugins/welcome/welcomemode.cpp
2011-04-14 12:39:31 +02:00
hjk
70d392d235 core: make context and widget IContext data members 2011-04-14 11:15:07 +02:00
hjk
8397663964 Update license. 2011-04-13 11:49:28 +02:00
hjk
9352f4b68f cppeditor: show 40 items in dropdown, mimicing the file list size 2011-03-24 12:39:23 +01:00