Commit Graph

18 Commits

Author SHA1 Message Date
Leena Miettinen
3b59ea6535 LSP: Fix capitalization of UI text
Change-Id: I4da433bcb3d313782f100775a8553df9d9aadf7e
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-19 11:55:55 +00:00
Christian Stenger
3cdb35dc4a LSP: Restart client if language filter settings change
Alternative way to the more complex way of de-registering
opened documents from the respective client that do no
more match the language filter settings.

Change-Id: I1968a928480e49cf203b91d7d36cf7db26f6d56c
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-19 09:01:14 +00:00
David Schulz
170e599a11 LSP: support file pattern filter and multiple mime types for lsp clients
Change-Id: I6d1b6c38d41dfd247c8883e765e5e432dbe53a9e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-18 12:00:40 +00:00
David Schulz
7826fdaa56 LSP: fix crashing and leaking memory
... in the language client code assist by making the
code assist provider a member of the client.

Change-Id: I8ea22300a2c824ff00b87cdeaf8ea5f0cf95e4a9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-16 10:40:48 +00:00
David Schulz
c37bedfb02 LSP: split out settings specific for std io clients
Change-Id: I25eebfc15a9d0d5665e57137f016e54a069ca849
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-10-15 11:51:10 +00:00
Christian Stenger
fdde4529e8 LanguageClient: Fix condition
Change-Id: I4978fb7d28789c3888aa521b5b400e1d79f31a91
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-10-15 08:23:17 +00:00
Orgad Shaneh
bdc2b4b59f Remove hard-coded disabling of debug logs
Instead, set the default level of all logs to QtWarningMsg.

The call to setFilterRules overrides the user preferences in qtlogging.ini.

Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-10-13 16:36:58 +00:00
David Schulz
525b51edd9 LSP: fix StdIOClient match function
Change-Id: I6834b43c25ed80a3bcbb293019dd15116ece8356
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-09-21 07:37:19 +00:00
David Schulz
dc155b407d LSP: rename LanguageClientSettings -> BaseSettings
And move the static init function to a separate class.

Change-Id: I7c924ce72ad74047e6bfdb04fa04a6132050a360
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 13:08:16 +00:00
David Schulz
d7b4f3fcf2 LSP: store settings on the heap
In preperation for specialized settings other than the stdio client

Change-Id: I20ca33fd1d714e4e0ca527de86261c0a58740d15
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 13:08:05 +00:00
David Schulz
fb058b850b LSP: limit the number of server restart attempts
Change-Id: I65f845d44bcfb318f36d876c0806c7b48e8e09df
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-20 12:37:54 +00:00
Eike Ziller
8195c60917 LSP: Fix lagging behind "documentHighlight"
We highlight the current symbol on cursor changes
(="documentHighlight"), but when the contents change the text editor
widget first informs us about the cursor change, then the content
change. This resulted in the highlighting being done on the old content.
Delay the symbol highlight by a short amount of time, so it always
operates on the new content.

Change-Id: Ic24b2a853697c588ae73b102868e8f74e4437606
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-09-19 11:25:12 +00:00
David Schulz
f6da85cc4b LSP: support 'window/showMessageRequest' and 'window/showMessage'
All showMessage notification are send to the GeneralMessages Pane and
the showMessageRequest will show a message box

Change-Id: Ida3f2a43669ec4c08694ed74e086a281d3d66f9d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-14 09:21:30 +00:00
David Schulz
b236874d2e LSP: const correct ShowMessageParams::toString()
Change-Id: I663c57aff8b23acbdaca1149e59f8f5f35bcfb94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-13 07:56:51 +00:00
David Schulz
8c1edd5c54 LSP: seek input buffer to the end before writing to it
If we receive messages with incomplete header we seek to the position
before we started to read any data from the buffer. Writing to this
buffer where the current position is not at the end results in
misordered data.

Change-Id: Ifaea5c07abee59c803ed08094ed1fdaf40d1cb7b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-13 07:56:29 +00:00
David Schulz
87381bbf90 LSP: use QtcProcess::splitArgs for language server arguments
Also store the executable and arguments in the stdio client to get a
more accurate comparison of clients.

Change-Id: I84fdd4ea5f32b17198d3f08e7f5d494f7fbe67dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-11 10:04:52 +00:00
David Schulz
51e3613057 LSP: Use MimeType file filter for language servers
Change-Id: I13e06b5513c64e20590ab4caf15093a201025b94
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-10 10:49:48 +00:00
David Schulz
d61d29cf16 Introduce a basic client for the language server protocol
The language server protocol is used to transport language specific
information needed to efficiently edit source files. For example
completion, go to operations and symbol information. These information
are transferred via JSON-RPC. The complete definition can be found under
https://microsoft.github.io/language-server-protocol/specification.

This language server protocol support consists of two major parts, the
C++ representation of the language server protocol, and the client part
for the communication with an external language server.

The TypeScript definitions of the protocol interfaces are transferred to
C++ classes. Those classes have getter and setter for every interface
value. Optional values from the protocol are represented by
Utils::optional<ValueType>. The JSON objects that are used to transfer
the data between client and server are hidden by a specialized
JsonObject class derived from QJsonObject. Additionally this JsonObject
provides a validity check that is capable of creating a detailed error
message for malformed, or at least unexpected JSON representation of the
protocol.

The client is the interface between Qt Creator and language server
functionality, like completion, diagnostics, document and workspace
synchronization. The base client converts the data that is sent from/to
the server between the raw byte array and the corresponding C++ objects.
The transportat layer is defined in a specialized base client (this
initial change will only support stdio language server). The running
clients are handled inside the language client manager, which is also
used to connect global and exclusive Qt Creator functionality to the
clients.

Task-number: QTCREATORBUG-20284
Change-Id: I8e123e20c3f14ff7055c505319696d5096fe1704
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-09-03 08:00:46 +00:00