-
Notifications
You must be signed in to change notification settings - Fork 766
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[READY] Java support using jdt.ls #857
Commits on Jan 21, 2018
-
Basic framework for Java Language Server connection
Build the jdt.ls server in build.py Start the server Connect to the server using stdio Send the initialise request Basic support for completions (prototype) Update the file contents in the server Use a workspace dir for each invocation.
Configuration menu - View commit details
-
Copy full SHA for abea266 - Browse repository at this point
Copy the full SHA abea266View commit details -
Apply textEdits in completion items Language server protocol requires that the client can apply textEdits, rather than just simple text. This is not an optional feature, but ycmd clients do not have this ability. The protocol, however, restricts that the edit must include the original requested completion position, so we can perform some simple text manipulation to apply the edit to the current line and determine the completion start column based on that. In particualr, the jdt.ls server returns textEdits that replace the entered text for import completions, which is one of the most useful completions. TODO: this doesn't currently work where there is a mixture of start positions. We also include experimental support for "additionalTextEdits" which allow automatic insertion of, e.g., import statements when selecting completion items. These are sent on the completion response as an additional completer data item called 'fixits'. The client applies the same logic as a standard FixIt once the selected completion item is inserted.
Configuration menu - View commit details
-
Copy full SHA for b32aa86 - Browse repository at this point
Copy the full SHA b32aa86View commit details -
Add a long-polling endpoint for asyncronous message delivery
A new API endpoint '/receive_messages' has been added which allows the server to return messages for display to the user at arbitrary times. Previously it was only possible for the ycmd server to communicate and action or update on receipt of a synchronous request from the client. However, the language server protocol inherently supports asynchronous message delivery, and it is necessary to provide some of these message to clients. In particular, the jdt.ls server takes a very long time to start up and provides some "status" information. We use a "display message" response to inform the client to show the user a progress update. Fully asyncronous delivery of diagnostics. Implement a proper ready handler (precursor to adding tests)
Configuration menu - View commit details
-
Copy full SHA for 0f64bbd - Browse repository at this point
Copy the full SHA 0f64bbdView commit details -
Configuration menu - View commit details
-
Copy full SHA for 72cb431 - Browse repository at this point
Copy the full SHA 72cb431View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53b7592 - Browse repository at this point
Copy the full SHA 53b7592View commit details -
Add subcommands: FixIt, RefactorRename, GoToReferences, GetDoc, GetType
Support for CodeActions via FixIts Support for RefactorRename Support for GoToReferences Add GoTo and GoToDeclaration aliases for GoToDefinition Implement GetDoc and GetType GetType is removed from language_server_completer.py since a server is allowed to return anything upon textDocument/hover request. GetType and GetDoc are Implemented in java_completer.py with a server specific modifications to the content of the response to the textDocument/hover request.
Configuration menu - View commit details
-
Copy full SHA for 5f54b51 - Browse repository at this point
Copy the full SHA 5f54b51View commit details -
Finalize language server protocol implementation
Use url2pathname and pathname2url from urllib to convert URI to filepath and vice versa in a portable way.
Configuration menu - View commit details
-
Copy full SHA for cc67757 - Browse repository at this point
Copy the full SHA cc67757View commit details -
Initial test framework and StopServer subcommand Implement StopServer subcommand so the server is start/stopped by the tests. Note: This exposes a number of bugs in the shutdown handling. Adds basic eclipse and maven test projects Adds basic tests for completion Add timeouts appropriate for the test environment (Travis) Test for snippets with completions Tests for GetType, GetDoc, GoToReferences, RefactorRename, diagnostics For now the diagnostics tests use os.path.normpath. This doesn't work, but it is required due to extra slashes on filepaths returned by url2filepath Make fixit responses stable across files, for the tests
Configuration menu - View commit details
-
Copy full SHA for 2c69c51 - Browse repository at this point
Copy the full SHA 2c69c51View commit details -
Don't _require_ that someone is listening to the message poll to hand…
…le the messages we care about
Configuration menu - View commit details
-
Copy full SHA for 565a979 - Browse repository at this point
Copy the full SHA 565a979View commit details -
Initialise asyncronously to avoid blocking when the server takes ages…
… to start or fails to start
Configuration menu - View commit details
-
Copy full SHA for 09fca85 - Browse repository at this point
Copy the full SHA 09fca85View commit details -
Return diagnostics for all files asynchronously _and_ on parse request.
This changes the diagnostics delivery so that we return the diagnostics to the client in the same way that the language server does, i.e. per-file. The client then fans them out or does whatever makes sense for the client. In order to be relatively compatible with other clients, we also return diagnostics on the file-ready-to-parse event, even though they might be out of date wrt the code. The client is responsible for ignoring these diagnostics when it handles the asynchronously delivered ones.
Configuration menu - View commit details
-
Copy full SHA for ad36c3f - Browse repository at this point
Copy the full SHA ad36c3fView commit details -
Properly shut down the language server
Close server standard output on close Close all the sockets when the read loop exits
Configuration menu - View commit details
-
Copy full SHA for 03b750f - Browse repository at this point
Copy the full SHA 03b750fView commit details -
Improve handling of the workspace directory
The workspace dir can be legitimately empty Use a tmpdir for the workspace, as the tests can end up with multiple instances using the same one which leads to race conditions Create new workspace on server restart Delete the project, implementing the log handler to populate and put in ycmd's log
Configuration menu - View commit details
-
Copy full SHA for d2434a1 - Browse repository at this point
Copy the full SHA d2434a1View commit details -
Actually send modify requests, as these should be better for lifecycl…
…e management - we still replace the entire file
Configuration menu - View commit details
-
Copy full SHA for abd04b0 - Browse repository at this point
Copy the full SHA abd04b0View commit details -
Improve code clarity and organisation
Rename legacy-named 'server' to 'connection' General code tidy and organisation. Document interface. Consistent use (or not) of _ prefix. Take methods out of class that don't rely on self.
Configuration menu - View commit details
-
Copy full SHA for 8511daf - Browse repository at this point
Copy the full SHA 8511dafView commit details -
Improve workspace handling and test stability
Run the startup/shutdown tests in clean directory to prevent java completer from scanning itself and timing out Reinstate clean workspace, but provide option for reuse Don't create unused and uncleaned temporary directories on Reset Use the project directory calculated by the implementation
Configuration menu - View commit details
-
Copy full SHA for 9ddcd12 - Browse repository at this point
Copy the full SHA 9ddcd12View commit details -
Configuration menu - View commit details
-
Copy full SHA for 435bd5c - Browse repository at this point
Copy the full SHA 435bd5cView commit details -
Add missing test dir Fix subcommands offsets fix diagnostics test
Configuration menu - View commit details
-
Copy full SHA for 5fddce3 - Browse repository at this point
Copy the full SHA 5fddce3View commit details -
Correctly handle textEdit completions
We now no longer support completions with newlines. We now correctly return completions where the entry is a TextEdit and multiple completions have different start columns. We do this super inefficiently by attempting to normalise the TextEdits into insertion_texts with the same start_codepoint. This is necessary particularly due to the way that eclipse returns import completions for packages.
Configuration menu - View commit details
-
Copy full SHA for f377e35 - Browse repository at this point
Copy the full SHA f377e35View commit details -
Configuration menu - View commit details
-
Copy full SHA for b57e72d - Browse repository at this point
Copy the full SHA b57e72dView commit details -
Configuration menu - View commit details
-
Copy full SHA for a4ba2e0 - Browse repository at this point
Copy the full SHA a4ba2e0View commit details -
Configuration menu - View commit details
-
Copy full SHA for ac930d2 - Browse repository at this point
Copy the full SHA ac930d2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c028f9 - Browse repository at this point
Copy the full SHA 5c028f9View commit details -
Configuration menu - View commit details
-
Copy full SHA for 8e50a9d - Browse repository at this point
Copy the full SHA 8e50a9dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 041eab4 - Browse repository at this point
Copy the full SHA 041eab4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6d9bce0 - Browse repository at this point
Copy the full SHA 6d9bce0View commit details -
Tidy some FIXME/TODO Fix 80 chars in README.md Remove unused logging
Configuration menu - View commit details
-
Copy full SHA for c346d0f - Browse repository at this point
Copy the full SHA c346d0fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b1f990 - Browse repository at this point
Copy the full SHA 6b1f990View commit details -
Add gradle test project Move server management tests to their own file. Add gradle test. GoTo tests Working tests for GoTo, GoToDeclaration and GoToDefinition. A test for unicode characters is missing. Fix KeyError bubbling to users when jdt.ls returns dodgy defnition Unicode tests, and fixes
Configuration menu - View commit details
-
Copy full SHA for 76edefe - Browse repository at this point
Copy the full SHA 76edefeView commit details -
Configuration menu - View commit details
-
Copy full SHA for 3171369 - Browse repository at this point
Copy the full SHA 3171369View commit details -
Configuration menu - View commit details
-
Copy full SHA for e159015 - Browse repository at this point
Copy the full SHA e159015View commit details -
Fix printing of raw messages on py2 and py3
Print the bytes of the messages rather than throw an exception. Ref: https://www.simonmweber.com/2014/11/24/python-logging-traps.html
Configuration menu - View commit details
-
Copy full SHA for cfed48d - Browse repository at this point
Copy the full SHA cfed48dView commit details -
If we receive a parse request before the server is initialised, queue…
… it to ensure the server has latest file content
Configuration menu - View commit details
-
Copy full SHA for f663862 - Browse repository at this point
Copy the full SHA f663862View commit details -
Configuration menu - View commit details
-
Copy full SHA for 68aa585 - Browse repository at this point
Copy the full SHA 68aa585View commit details -
Configuration menu - View commit details
-
Copy full SHA for df391a5 - Browse repository at this point
Copy the full SHA df391a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 76f413b - Browse repository at this point
Copy the full SHA 76f413bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 60c849e - Browse repository at this point
Copy the full SHA 60c849eView commit details -
Include the text of the line at the reference site, as the _greatly_ …
…improves the utility of the GoToReferences command
Configuration menu - View commit details
-
Copy full SHA for 7eb7b4f - Browse repository at this point
Copy the full SHA 7eb7b4fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1004f63 - Browse repository at this point
Copy the full SHA 1004f63View commit details -
Configuration menu - View commit details
-
Copy full SHA for 01f84e1 - Browse repository at this point
Copy the full SHA 01f84e1View commit details -
Refactoring and fixes after review
Typos and style changes Move mappings to lsapi Don't include an extra newline, as this is not strictly in the protocol Use the generic implementation of WaitUntilCompleterServerReady Fix exception when running debug info and server not running
Configuration menu - View commit details
-
Copy full SHA for 689f396 - Browse repository at this point
Copy the full SHA 689f396View commit details -
Improve the API and stability for shutdown
Close the connection in the handler thread to avoid race condition. Test failed shutdown
Configuration menu - View commit details
-
Copy full SHA for 072cfd1 - Browse repository at this point
Copy the full SHA 072cfd1View commit details -
Increase the timeout for the shutdown tests for our CI environment Test receive_messages handler without completer support Fix project detection tests Additional tests for things we can't easily test in the CI with real server
Configuration menu - View commit details
-
Copy full SHA for 8c2f192 - Browse repository at this point
Copy the full SHA 8c2f192View commit details -
More refactoring and fixes after review
Rename lsapi to language_server_protocol Tidy build.py Better names for subcommand handlers Use snake case for variables Clarify the threading setup for the language server connection Despatch -> Dispatch Better name for _RefreshFiles Refactor large completion item methods Update API documentation for long poll, and fix the nonblocking pending messages handler rename textEdit to text_edit for coding style Tracing shutdown to help post mortem diagnostics Update copyright year Move all exceptions to he top of the module Public or API methods are not private. All other methods are private More refactoring of completion item resolution code Compute whether or not to resolve completions statically Remove bare except Mention jdt.ls in the ycmd README Fix up comment in example client Typos and stylistic changes Log when we get errors Don't include the optional header Remove import hack laziness for TemporaryClangTestDir Remove extraneous parentheses More trivial code tidy Use correct GoTo response and errors Don't convert the id to string more than once Clarify client capabilitites Add INFORMATION and HINT to the ycmd API rather than mapping it Use 'Unkonwn type' like clang completer
Configuration menu - View commit details
-
Copy full SHA for dd6799d - Browse repository at this point
Copy the full SHA dd6799dView commit details -
Further improvements to shutdown handling
Join the dispatch thread after closing sockets Don't forcefully kill the server as this causes issues on Windows Ensure that we don't start (and not stop) a JediHTTP instance in shutdown tests Use SharedYcmd for handler tests Properly namespace server management tests
Configuration menu - View commit details
-
Copy full SHA for 24853c5 - Browse repository at this point
Copy the full SHA 24853c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f8adc4 - Browse repository at this point
Copy the full SHA 1f8adc4View commit details -
Update to jdt.ls v0.11.0 and complete coverage tests
This required a number of things, not least implementing a proper model of the server file state and using that to reduce the number of didClose/didChange events to send. This fixes the interpretation of the file_data: only modified buffers are included, so we must read the contents of non-modified (but open) buffers from disk. Finally, we also move to using binary packages to improve the build times, and tidy up the third party area.
Configuration menu - View commit details
-
Copy full SHA for 79d8544 - Browse repository at this point
Copy the full SHA 79d8544View commit details -
Configuration menu - View commit details
-
Copy full SHA for c42d5e8 - Browse repository at this point
Copy the full SHA c42d5e8View commit details -
Ensure that the message poll doesn't fail on first request
Since we start the server on the FileReadyToParse event, the client might send the initial poll request before we've attempted to start the server. So in that case we wait at least one poll interval for the initialize sequence to complete before starting the poll loop.
Configuration menu - View commit details
-
Copy full SHA for 9b08789 - Browse repository at this point
Copy the full SHA 9b08789View commit details -
Use UTF16 code unit offsets not codepoint offsets
Per the language server protocol, we need to count UTF16 code units.
Configuration menu - View commit details
-
Copy full SHA for feba227 - Browse repository at this point
Copy the full SHA feba227View commit details -
On larger projects and slower systems, resolving many items can be very costly, and not really all that useful.
Configuration menu - View commit details
-
Copy full SHA for e03836f - Browse repository at this point
Copy the full SHA e03836fView commit details