Commit Graph

18 Commits

Author SHA1 Message Date
David Schulz
0422233af4 LanguageClient: Move the interface out of the gui thread
Change-Id: Iec34f5a0ca3f7f8e2306d3c8a50c2155b5b96807
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-19 09:49:42 +00:00
David Schulz
0b6bc0d187 LanguageClient: Move the BaseMessage to JsonRpcMessage conversion
... to the client interface. JsonRpcMessages are the only messages used
so far and no other types of messages are currently used by any of the
supported Language Servers. If a client is going to need special message
parsing it can still implement a specialized client interface and
overwrite parseCurrentMessage. This is the preparation to move receiving
and parsing data passed to and from the language server out of the GUI
thread.

Change-Id: Ibd4cd95daab7efff947273ca9e7d457de0286f47
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-05-17 04:31:06 +00:00
Christian Kandeler
db1f2c8dd9 LSP: Do not copy a message before sending it out
Change-Id: I58cc1f50b504bf21ea4ee9f99edba2ae8dc1ca1c
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-05-13 07:19:15 +00:00
hjk
aa3bdcb427 Utils: Add a QString-based write to QtcProcess
Centralize some boiler plate and warn about best-guessed cases.

Keep the QByteArray based access as writeRaw()

Fixes: QTCREATORBUG-27445
Change-Id: I948d80fba78b36cf85cc73664175ab05eb7707d4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-04-28 08:20:11 +00:00
hjk
e2cb64471a Utils: Move QtcProcess constructor setup data to shared setup data
This includes replacing DeviceProcess terminal handling with base
member.

Change-Id: Id1541bfce33c71dddc71b4816ad0b174dce3879c
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2022-02-11 17:33:48 +00:00
Jarek Kobus
d6f56254d1 Get rid of QtcProcess::workingDirectory() overload
Adapt all callers' code so that it passes the FilePath
instead of QString. As a consequence introduce
TemporaryDirectory::masterDirectoryFilePath() and use
it where easily possible.

Change-Id: I14564949b3b916921e32a2957c84c03d1da43af2
Reviewed-by: hjk <hjk@qt.io>
2022-01-18 17:18:34 +00:00
Jarek Kobus
d22505c41f Use refactored ProcessMode
This patch needs to be applied together with the parent change.

There are 3 basic cases:
1. The user doesn't write anything to the write channel:
   You don't need to call closeWriteChannel manually anymore.
   By default the QtcProcess you create is in ProcessMode::Reader mode.
   Internally it opens the process in ReadOnly mode and
   closes the write channel just after starting.
2. The user writes some initial data (after being started)
   and then closes the write channel:
   All what is needed now it to set the write data
   (QtcProcess::setWriteData) before calling start.
   You also use the default ProcessMode::Reader mode.
   Internally it opens the process in ReadWrite mode
   and writes the writeData asynchonously when the process
   already started. After writing the data it closes the
   write channel automatically.
3. The user writes the data also after calling start.
   All you need now is to create a process with
   ProcessMode::Writer mode. In this mode the write
   channel is not closed.
   Internally it opens the process in ReadWrite mode
   as some writers also read the data from the process.

All the code base is adapted here to the above rules.

Change-Id: Id103019d1d71a3012fd1eade226fe96b9aaa48c2
Reviewed-by: hjk <hjk@qt.io>
2021-08-09 07:51:31 +00:00
hjk
fe7d6f0def Utils: Drop QProcess specific parameters from QtcProcess::finished()
Mid-term plan is to concentrate on use of QtcProcess::result()
instead which is a bit more system-agnostic.

There's quite a bit of potential for downstream cleanup by
re-using QtcProcess::exitMessage() now.

Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 13:31:05 +00:00
hjk
08040e4e94 Utils: Move QProcess base to QtcProcessPrivate
Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 13:21:08 +00:00
hjk
2f593d9db9 LanguageServer: Use Utils::CommandLine in StdIOClientInterface
Change-Id: Ic2516387d7308bfad05cef54467c417cc47a7655
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-03 11:31:17 +00:00
hjk
e5312362c8 LanguageClient: Avoid one use of SynchronousProcess
Change-Id: I39329a68691ad084128056c34cc41554776fd18b
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-05-03 11:27:31 +00:00
David Schulz
605df0c4b6 Java: use a temporary directory for the workspace
Change-Id: Ie8fc01f680393f141f099f57b98eb16a10b37d7e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-02-23 08:48:49 +00:00
David Schulz
ea81b676c7 LSP: log non protocol lines instead of throwing an error
Some language server send non protocol conform lines over the same
transport layer as the protocol messages. Do not switch the client for
those servers into the error state, but print a warning message with the
content of these lines to a categorized log.

Change-Id: Ic6c62648f0237362136fd657fde71dd104bca9d1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-05-09 06:25:53 +00:00
Eike Ziller
4545c81e57 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	doc/src/howto/creator-sidebar-views.qdoc
	doc/src/howto/creator-ui.qdoc
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/autotest/testresultmodel.cpp
	src/plugins/autotest/testresultmodel.h

Change-Id: I24cc585ca7782cb1d9cb0b8b73b46892b41937fd
2019-05-08 12:41:25 +02:00
Christian Stenger
7bdb29412c LanguageClient: Fix error message on crash
Change-Id: I46c3fbcff2fcd8eaac57e2c8edcb03f73b7b063f
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-07 09:14:31 +00:00
David Schulz
7f348c1878 LanguageClient: Compare expanded arguments for stdio clients
Change-Id: I6b33aa6b3ddb03a1965dbda4e7e1e1724299eba1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-04-02 11:29:47 +00:00
David Schulz
bbbf727272 LanguageClient: fix restart check for stdio clients
Change-Id: I4acb61b48b7ac18423b2e106f1f9ea9b3f7ccb70
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-03-12 13:07:11 +00:00
David Schulz
eac1b6059c LSP: separate communication interface and client logic
Change-Id: I7d35fa634287b5f858c4a87aa10f99bf18d1ad07
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-04 09:43:11 +00:00