Commit Graph

35 Commits

Author SHA1 Message Date
Christian Kandeler
b8c2be4cf8 CppEditor: Hide CppRefactoringChangesData
Change-Id: I5d88651a9b3a295bd95de5ee5e9b117e449195b3
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-20 14:39:05 +00:00
Christian Kandeler
ac952955a4 TextEditor: Clean up RefactoringFile interface
Change-Id: I1e415b6b51065d16bc49a25118931723b600c00b
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-11-20 14:38:51 +00:00
Christian Kandeler
246a878a34 TextEditor: Remove RefactoringChanges::m_data
There is no use for a data member in the base class.

Change-Id: I126d8713d2a7bf4061ecbd60b4c144d39c08d550
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-17 10:01:48 +00:00
Christian Kandeler
5d6fc1fc3b TextEditor: Remove RefactoringFile::m_data
There is no use for a generic data member.

Change-Id: Iabfbc0587db2cffcc1c19baed832aa866f696ffe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-17 10:01:34 +00:00
Christian Kandeler
6f3bc431fc TextEditor: Move more code into RefactoringFile
We want to get rid of RefactoringChangesData.

Change-Id: Ia428563a0ff70ec9660761beac3eb7168b8e9eca
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-11-17 09:43:02 +00:00
Christian Kandeler
413a6a6fde TextEditor: Make RefactoringChanges::file() virtual
More preparation for de-virtualization of RefactoringChangesData.

Change-Id: Ib5f7782a8dcaa2ae093b62aebedbd7bae9d4c3f1
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-11-17 08:37:14 +00:00
David Schulz
5122d8addc Merge remote-tracking branch 'origin/11.0'
Change-Id: Idbf5f641aa9db7574cf2a4bd09adb8bcd03da894
2023-08-22 08:10:48 +02:00
Christian Kandeler
66a6cceaf4 CppEditor: Fix possible null pointer access
Fixes: QTCREATORBUG-29484
Change-Id: I047ea13e6808902a3b0fb94b9eacdd48e411a22a
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-10 13:48:39 +00:00
Christian Kandeler
f93836b25d CppEditor: Add quickfix for converting comments from C++ to C style
... and vice versa.

Fixes: QTCREATORBUG-27501
Change-Id: I8584cc1e86718b3fe0f0ead2a3436495303ca3c8
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-08 07:33:41 +00:00
Christian Kandeler
fdc834c0d1 CPlusPlus: Remove TranslationUnit::getTokenStartPosition()
It was exactly the same as getTokenPosition().

Change-Id: I292522faa18933ec400b556c384786eb9efdfb3a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-07-13 07:16:29 +00:00
hjk
0b83f110f4 CppEditor: Make a few CppModelManager functions static
... to simplify code using it.

Change-Id: Ib2bfbb5a17a1d48088a9cf4973d4c3f006cd34e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-07-12 13:08:09 +00:00
Christian Kandeler
9f6878ddab CppEditor: Format code inserted by quickfixes
Task-number: QTCREATORBUG-10807
Task-number: QTCREATORBUG-19158
Change-Id: Ieac52e1a1a10afad91fea56290e7dcfd1d302e7f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-06-28 09:18:15 +00:00
Christian Kandeler
a03bea81c7 CppEditor: Remove WorkingCopy::contains()
Most uses involved a double look-up.

Change-Id: Ifeb62ea2361222ed0faad749f44a59735c8d6930
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-03 09:50:53 +00:00
hjk
b87f0519e3 CppEditor: Use FilePath for ProjectPath::m_sourceFiles
... and update using code.

Change-Id: I682727a4b2982dba388e7cc7b9488225748d591f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-01-11 09:54:25 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
4159c4b5d5 CppEditor: More migration to FilePath
Change-Id: I261b713671e00bb567f61b4ee5ecf6fa83473bff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-12-14 09:14:12 +00:00
hjk
9ceaf39929 CppEditor: Remove WorkingCopy::{revision,source}(QString) overloads
... and fix fallout.

Change-Id: I3748d0f90345c0d92321d465abfc3d324ee49a0c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-11-25 13:34:17 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
David Schulz
3a6dff6743 ProjectExplorer: filepathify actualTabSettings
Change-Id: I4b08b96d56bfeed0348d82bb96ff70d5f8ad583b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-02-04 11:51:52 +00:00
Christian Kandeler
92156cc1d6 LanguageClient: Indent code coming from the server
... if the client implementation requests it.
The server is not necessarily aware of our indentation style, so we
might have to apply it to the newly inserted code.

Change-Id: I43518575c7124568da42be3b04a28d7f352f6dc2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-02-03 14:30:19 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Erik Verbruggen
3ebc328498 C++: added quickfix to insert a method definition.
Reviewed-by: Christian Kamm
2010-09-30 12:19:39 +02:00
Christian Kamm
642b6fb0d3 C++ indenter: Separate indent into logical indent and padding. 2010-09-13 12:38:34 +02:00
Erik Verbruggen
cacb0db0eb C++: fixed completion in braceless statements following a control statement.
- Changed generator to generate:
- Changed AST::lastToken to return 1 if there is none
- Changed Bind.cpp to set the scope of the block following a control
  statement to extend upto (and not including) the first token after
  the block. So basically, including any whitespace after the control
  statement.

Reviewed-by: Roberto Raggi
2010-09-09 15:26:43 +02:00
Kai Koehne
a8747f32e4 CppEditor: Simplify CppRefactoringChanges class
Remove unneeded methods from API.
2010-08-16 16:16:25 +02:00
Christian Kamm
7a5df3c39d QuickFix: Move helpers from QuickFixData to RefactoringFile.
Makes them easy to use everywhere. Also when calling
QuickFixData::textOf and friends, it wasn't really clear which file
they would run on.
2010-08-13 12:51:22 +02:00
Christian Kamm
bbe64796a0 QuickFix: Introduce CppRefactoringFile. 2010-08-13 12:51:22 +02:00
Christian Kamm
03b443b86b QuickFix: Simplify getting a Document for a C++ refactoring. 2010-08-12 14:21:35 +02:00
Christian Kamm
538f611503 Indenters: Move style setup into the QtStyleCodeFormatter constructors.
This makes sure styles are consistent for the editor and the quick fix
engine.
2010-08-12 14:21:35 +02:00
Christian Kamm
0355e37e53 QuickFix: Migrate to a nicer API for cross-file quick fixes. 2010-08-12 14:21:35 +02:00
Christian Kamm
235f4d1d26 QuickFix: Clean up RefactoringChanges and add missing functionality.
* Can change files without opening an editor.
* Can open an editor without changing a file.
* Default to reindenting new files.
* Allow reading a file temporarily to access document and text.
2010-08-12 14:21:35 +02:00
Roberto Raggi
e78380fdf2 Share the LookupContext. 2010-07-19 18:27:11 +02:00
Roberto Raggi
0344b728e9 Store the time stamp if necessary. 2010-06-22 12:13:31 +02:00
Roberto Raggi
27f6b2ceb5 Renamed CppRefactoringChanges::parsedDocumentForFile(). 2010-06-22 12:13:30 +02:00
Roberto Raggi
91eff02007 Moved CppRefactoringChanges. 2010-06-22 12:13:30 +02:00