Commit Graph

67787 Commits

Author SHA1 Message Date
Jarek Kobus
cb7b3dd817 ClassView: Move delaying of update into the main thread
Minimize the communication with parser's thread.
Don't call getParseDocumentTree() multiple times
when subsequent request for the same document comes
before the timeout.
Don't queue again already queued documentUpdated()
signal (it's emitted form non-gui thread).
Prepare for moving the calls to SessionManager out of the
parser's thread.

Task-number: QTCREATORBUG-25317
Change-Id: I5d4898b5addbb589d415e00c66de5cba7b96d512
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:29:45 +00:00
Jarek Kobus
aeac17ecf5 ClassView: Reparse the tree when files are removed
In order to refresh GUI, call reparse after files are removed.

Task-number: QTCREATORBUG-25317
Change-Id: I8f29c042c9002587dd791800597af0e42e19856e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:21:25 +00:00
hjk
fabd449236 Utils: Consolidate some label related bits of aspects
Change-Id: I55706c87a17f1d011d53ada6055290d4aab2d425
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 10:10:33 +00:00
Leena Miettinen
c57d9c2a9c Doc: Describe disabling Clang checks from Output pane
Task-number: QTCREATORBUG-25162
Change-Id: Id80094fda3a5b4655f38ce22e345b96457991f73
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-19 09:56:21 +00:00
Leena Miettinen
77e76d22f8 Doc: Accommodate changes made to Library view
Fixes: QDS-3718
Change-Id: I04b3809d23341fb26484b5f3ec63b710042fbf66
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-19 09:28:20 +00:00
Jarek Kobus
d05d9fc65c QmlJS: Inline getter
Change-Id: Ife8a2b0d6eb67ee28a4de808c1c848dbf633c49b
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:46:57 +00:00
Jarek Kobus
38bc3dd308 Remove unneeded Q_UNUSED
Change-Id: Ia773eb99e1d50bf6ecdc128e5c75dc5e1c5a1459
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:46:47 +00:00
Jarek Kobus
aef1bb943d Use QMutexLocker in conjunction with QWaitCondition
Change-Id: Ia5d55b9161a58387b0806e792f0fb1b21f118330
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-19 08:20:09 +00:00
Michael Weghorn
2d8dff4a8a Debugger: Avoid exception with GDB 10 to fix running dumper tests
Since GDB commit 1ba1ac88011703abcd0271e4f5d00927dc69a09a [1]
("gdb: Enable stdin on exception in execute_gdb_command",
committed 2020-01-24), stdin for GDB is re-enabled whenever
an exception is caught during 'gdb.execute()'.

When running the dumper tests for GDB, such an exception
was thrown when loading the qtcore library, resulting
in the GDB commands after the 'run' command (s.
'tst_Dumpers::dumper') to be be handled by GDB prematurely
when loading the library instead of when reaching the
end of the test program.

This resulted in the dumper tests failing with output like

    29: (gdb)
    29: &"up 0\n"
    29: &"No stack.\n"
    29: ^error,msg="No stack."
    29: (gdb)
    29: &"python theDumper.fetchVariables({'token':2,'fancy':1,'forcens':1,'autoderef':1,'dyntype':1,'passexceptions':1,'testing':1,'qobjectnames':1,'expanded':['local']})\n"
    29: &"Traceback (most recent call last):\n"
    29: &"  File \"<string>\", line 1, in <module>\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 711, in fetchVariables\n"
    29: &"    variables = self.listLocals(partialName)\n"
    29: &"  File \".../qt-creator/share/qtcreator/debugger/gdbbridge.py\", line 597, in listLocals\n"
    29: &"    frame = gdb.selected_frame()\n"
    29: &"gdb.error: No frame is currently selected.\n"
    29: &"Error while executing Python code.\n"
    29: ^error,msg="Error while executing Python code."

Avoid the exception by first trying to 'gdb.execute' the
command that works for GDB 8+ and fall back to the command
for earlier GDB versions, i.e. reverse the order. That
should be fine for all GDB versions, given the commit
mentioned above is only contained from GDB 10 on.

While at it, move the assignment to 'cmd' into the
corresponding 'try' blocks to make the context a bit
clearer.

[1] https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=1ba1ac88011703abcd0271e4f5d00927dc69a09a

Change-Id: I2d1bb52a777801e6bd77a5eda581a2fd5dd3a18f
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:14:31 +00:00
Jarek Kobus
ee77958998 Use atomic_bool and drop QMutex locking
Change-Id: I70d472b0de717467c53bbb29cc407367b7e80e7f
Reviewed-by: hjk <hjk@qt.io>
2021-02-19 08:02:16 +00:00
David Schulz
e4fba42a8a LSP: fix WorkspaceEdit documentChanges key
Change-Id: Iff6799cc171dc6857fde6d947f0eb081687364f4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-19 05:33:17 +00:00
Mahmoud Badri
43eaa09b11 Add components library expand/collapse all context menu options
also change import name from "library" to "module" and relevant tweaks.

Task-number: QDS-3589
Change-Id: Ib467dda61b6720cebe843e34cb807aee6221f5cb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-18 18:43:57 +00:00
Eike Ziller
c26b31b7f7 Update to latest qlitehtml
Fixes installation of library in the Qt Creator directory.

Change-Id: I7833431242c114dc247dd7e1121493a8aa3ec4f7
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-18 16:50:01 +00:00
Christian Kandeler
d3deefc3a4 Core: Streamline SearchResultWindow interface
That is, make SearchResultItem the one data type for adding search
results.
This will allow us to add additional properties to search results
without adding more and more parameters to a bunch of functions.

Change-Id: Ic2740477ae47449cee75caa2525727fe2b460f91
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 16:46:08 +00:00
David Schulz
fa5fdef6e1 LanguageClient: clean up client interface declaration
Change-Id: I18b5b8a5b39a6be7c538054385c7dca188676eef
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 16:15:24 +00:00
hjk
a2d6c2b34a Utils: Consolidate more aspect functionality
The concepts of 'value', 'defaultValue' and changed signals are present
in a few aspects, with varying implementations. Time to get things
sorted out.

The values are stored now as QVariant in the base, with typed accessors
in the derived classes, keeping the user visible interface the same.

Change-Id: I4d37ef5c7a9795f46ce1bbbabc6a251222b1d54e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 15:55:25 +00:00
David Schulz
acd33a45d8 Java: add java language server settings
Change-Id: Ic8e8ce5833052fcbb3acb004ae577722e2ef8fc3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 13:56:42 +00:00
Cristian Adam
fc411cd0d1 CMakeProjectManager: Make backup of CMake configuration before starting CMake
CMake's fileapi functionality will save the project structure in json
files in the .cmake/api/v1/reply directory.

When issuing a cmake command with -D variables CMake will update its
CMakeCache.txt file even if cmake will fail.

This commit will rename .cmake/api/v1/reply as .cmake/api/v1/reply.prev
and make a copy of CMakeCache.txt before starting CMake, and if
something fails, replace the existing files with the previous values.

Also make sure the changed values are not dissappearing when the
old .cmake/api/v1/reply gets parsed.

Fixes: QTCREATORBUG-24593
Change-Id: I82141786fea7068699e0f761a8978ba1f3203e47
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 13:21:11 +00:00
hjk
2fb9d08082 Utils: Don't use ptrace in the process stub
Previously, ptrace was used to keep a tight hold on the spawned process
across the exec(), followed by raising a SIGSTOP to allow un-racy
attaching a debugger.

This makes implementation of 'Run as root' more difficult and is
apparently not needed: instead of the ptrace use, the SIGSTOP can be
raised directly, before exec().

Change-Id: I36025ac547b2a335e2a203c728d221830e4c0a7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-18 13:18:21 +00:00
Eike Ziller
36b23fff03 Merge remote-tracking branch 'origin/4.14'
Change-Id: I42000e1ceca42f97c4e512505161151ab7369cd0
2021-02-18 14:16:04 +01:00
Marco Bubke
fd6446e07b Sqlite: Fix missing typename
Some compilers are more picky than others.

Amends e3d12e659a.

Change-Id: Idb189658724880252e17ff1d561a13e281d2ec3a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-18 12:54:10 +00:00
Christian Kandeler
63cd4c1b58 ProjectExplorer: Improve MSVC output parsing
- Recognize "note:" messages as continuations.
- Do not remove leading spaces from continuation messages, as that
  hurts readability.

Fixes: QTCREATORBUG-25321
Change-Id: Ia8eebb688296ad4829648bc66e8afcd0198cf2d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-02-18 10:33:05 +00:00
David Schulz
032407a6fe LanguageClient: select current client when opening inspector
Change-Id: I4bfd74e7e9a8c0f4b60ed034faac86c2fb9bb018
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 09:39:01 +00:00
David Schulz
f9502a3ba6 LanguageClient: move capabilities widget to inspector
The capabilities are not changeable for the user, but only there to
check whether a server is capable of a specific task. This will also
allow us to have more specialized settings widgets for specific servers
like for the java language server without the need to add the
capabilities to each of those special widgets.

Also add the dynamic capabilities to the widget so users have a complete
overview of the capabilities.

Change-Id: I9f2ed6ed11b458f0d4c67be3df632fd810023286
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-18 09:38:56 +00:00
Alessandro Portale
c697b503e9 QmlDesigner: Add missing "const" and "&" in range-basd for loops
Change-Id: I93821f97fb1d8c3154bc03b8f54c504a6f712269
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-18 09:35:38 +00:00
Alessandro Portale
e2dd9639e5 QmlDesigner: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I7fb1c012b4e6b0608c5888d58c7752b194baf78b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-18 09:35:31 +00:00
Alessandro Portale
ae5255cebd Android: Fix android-*-deployment-settings.json detection
Qt 6.0 + CMake: The name for the Android deployment settings file needs
to be determined by using the build key of the current run configuration
rather than by using the display name of the project root node.

Since in contrast to qmake/Qbs, CMake does not supply us with the file
name and we have to contruct it ourselves. Therefore, it makes sense to
move the value into the Android plugin.

This change adds AndroidQtVersion::androidDeploymentSettings which lets
qmake and Qbs still provide the value as before while handling the CMake
fallback.

Fixes: QTCREATORBUG-25209
Change-Id: I12314d06a45d6e045cb654d9140f9d2ed4602f67
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-02-18 09:34:48 +00:00
Eike Ziller
768d4321f9 Merge remote-tracking branch 'origin/4.14'
Change-Id: I214b8d59e8ff7fe0511cd6116ec7725ddc4376ee
2021-02-18 09:26:22 +01:00
Christian Stenger
1133e26d3a AutoTest: Do not mix up sanitizer results and normal results
If a test framework uses stderr for output we might end up adding
real test output to a not-yet-sent sanitizer result.

Fixes: QTCREATORBUG-24328
Change-Id: I389c09da626229aa8985b2f99671b6ba8b6c467c
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 08:25:03 +00:00
Jarek Kobus
d74edd2806 Remove unused includes of mutex classes
Change-Id: I5a34cda0b27786cb37e642479b11fbd24b8b5c36
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-18 07:02:07 +00:00
Leander Schulten
213ad8368a Fix build
Change-Id: If4593342cd92716fb2238d633e5b25135a02ce57
Reviewed-by: hjk <hjk@qt.io>
2021-02-18 06:28:55 +00:00
hjk
34945f84e4 Debugger: Use a class for GdbMI parser parameters
Currently only the previous from/to pair, but can be extended
by codec state.

Task-number: QTCREATORBUG-24462
Change-Id: I3d101e74d1fef65bb75ddaab1dc2eaf77201dcde
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-18 06:07:36 +00:00
Ivan Komissarov
8d5b4815d3 Update Qbs submodule to the top of 1.18 branch
Change-Id: I820c20cfe285c6796977b9880d05f3c7f4c80a3a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 21:01:05 +00:00
Jarek Kobus
144f46bb54 ClassView: Remove unused includes
Amends a513f25c39
Amends 23047f16f7

Task-number: QTCREATORBUG-25317
Change-Id: I19a817ddfead6a123116efe05f24131973cea7ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 17:23:14 +00:00
Christian Kandeler
7d4a632cb2 qbs build: Remove code for creating deployment packages
Not a use case anymore, and if it were, we'd do it using built-in
capabilities.

Change-Id: I4c588ad7fb282530880210cb4c5795677074b1e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 16:11:49 +00:00
Christian Stenger
185598f303 QmlDesigner: Fix qbs build
Amends 151184a609.

Change-Id: Iccc6232a0b9fa4a06fcb6b14420e41380a9c3dea
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-02-17 15:33:29 +00:00
hjk
c5cc771656 Valgrind: Allow specifying extra arguments to valgrind etc
Fixes: QTCREATORBUG-18693
Change-Id: Ibb968dcd82b118340a45329b4a14b28d85700661
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 14:59:03 +00:00
Christian Stenger
5b9d8f0061 QmlDesigner: Fix compile on Linux and macOS
Amends 151184a609.

Change-Id: I5f898434e60560a97d8c4155906fdb77f0fc8d24
Reviewed-by: hjk <hjk@qt.io>
2021-02-17 14:58:07 +00:00
David Schulz
027f83f178 LSP: generate valid default WorkspaceFoldersChangeEvent
Change-Id: I762150c50228764da95d759ba766f3f8125e7621
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 14:49:35 +00:00
Alessandro Portale
97a45f7512 Libs: Use qAsConst with non-const Qt containers in range-loops
Change-Id: I00d9f7c1634bbb62191470d58158e1fd150533c0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:45:05 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Cristian Adam
1d27f894bb QtCreator: Add ability to specify text codec for default locale
On Windows you get one locale for unicode applications, and one
for old non-unicode applications.

Qt Creator uses QTextCodec::codecForLocale(), which would result
in the "System" codec, which is mapped for the default language
in the system.

Task-number: QTCREATORBUG-24776
Change-Id: I64496cc440931d3bf6f09314bdfc7c29e01b9f4f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-17 14:29:27 +00:00
Alessandro Portale
38a38cd0ed Utils: Fix output formatter "new searchDir found" signalling
Change-Id: Id9bc5cb0641dbac902b7d5af8ee3d00e0308478e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 12:55:34 +00:00
David Schulz
5cbf323014 LanguageClient: track clients again
Amends 166fce5036.

Change-Id: If78ca6a15fd5b5f809ef7693b3b31131a0973df3
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-17 11:30:52 +00:00
Alessandro Portale
afc2fda8a9 ProjectExplorer: Use qAsConst w/ non-const Qt containers in range-loops
Change-Id: I6422b3e40a6925504a231be2d47b3214d86c6e06
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:21 +00:00
Alessandro Portale
e4f260d544 ClangTools: Use qAsConst with non-const Qt containers in range-loops
Change-Id: Id9df0a27c4bcba57ee76574e32ca53cb6c28a43d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 11:19:15 +00:00
Jarek Kobus
d6574a6e5f DiffEditor: Rely on compiler generated constructors
Change-Id: I16527f2f971fa110ceb0b35755a1f49663ccb460
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-17 11:07:22 +00:00
Jarek Kobus
406c3e3f99 There are people, who still work on linux :)
Amends 151184a609

Change-Id: Ibe868754b3822fc6e93fcfb847a17aa7c9242228
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-02-17 11:04:22 +00:00
Mahmoud Badri
151184a609 Implement new item library UI
- Create a new header qml widget.
- Move tabs and filtering search to the header widget.
- Add imports/assets using a new "+" button on the tabs.
- Remove import flow tag view (still some remainings to be removed in another commit).
- Change layout from grid to vbox.
- Rename some classes and variables to make them clearer.
- New "Add Library" view that replaces the QML imports view (older QML imports classes removed).
- Enable Search in the "add import" view.
- Hide category header if only 1 category is under an import.
- Assorted relevant fixes, tweaks, and clean ups.

Task-number: QDS-3589
Change-Id: I710aed50858b32e024200911c6a21fd963e1b692
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-02-17 09:38:20 +00:00
Christian Stenger
60f1e23ff2 AutoTest: Enable ubsan handling as well
Task-number: QTCREATORBUG-24328
Change-Id: Ibe1e3d55963139ff50f1ebc4a861d1be17f83322
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-02-17 08:52:16 +00:00