Commit Graph

10 Commits

Author SHA1 Message Date
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