feat(lsp): support Java class file contents and improve definition navigation handling
- Add `_lsp_java_class_file_contents` request to fetch contents of compiled Java classes via LSP (`java/classFileContents`). - Handle `java/classFileContents` responses by opening a new buffer with Java syntax highlighting and inserting the returned source. - Update definition handling to pass URI and range, enabling precise cursor placement after navigation. - Detect `jdt://` URIs in `textDocument/definition` responses and request class file contents instead of direct navigation. - Move goto navigation logic into `LSPServerEventsMixin`, using event system to access the active view and position the cursor. - Expose `emit` and `emit_to` to the response cache for event dispatching. - Restrict completion activation to `USER_REQUESTED`. - Add TODO note about mapping language IDs to dedicated response handlers.
This commit is contained in:
@@ -119,3 +119,11 @@ class LSPControllerEvents:
|
||||
params["position"]["character"] = data["column"]
|
||||
|
||||
GLib.idle_add( self.send_request, method, params )
|
||||
|
||||
def _lsp_java_class_file_contents(self, uri: str):
|
||||
method = "java/classFileContents"
|
||||
params = {
|
||||
"uri": uri
|
||||
}
|
||||
|
||||
GLib.idle_add( self.send_request, method, params )
|
||||
|
||||
Reference in New Issue
Block a user