nemethf / eglot-x Goto Github PK
View Code? Open in Web Editor NEWProtocol extensions for Eglot
License: GNU General Public License v3.0
Protocol extensions for Eglot
License: GNU General Public License v3.0
TLDR: I've (setq eglot-x-enable-snippet-text-edit nil)
to work around this problem. The rest of this report is there as a record of how I arrived at this solution, and as a list of other ways to address this.
In a Go source file, I get this error when I run M-x eglot-format-buffer
:
Debugger entered--Lisp error: (void-function eglot-range-region)
eglot-range-region((:start (:line 291 :character 0) :end (:line 291 :character 6)) markers)
#<subr F616e6f6e796d6f75732d6c616d626461_anonymous_lambda_43>((:range (:start (:line 291 :character 0) :end (:line 291 :character 6)) :newText ""))
eglot-x--apply-text-edits([(:range (:start (:line 291 :character 0) :end (:line 291 :character 6)) :newText "")])
eglot-x--override-text-edits(#<subr eglot--apply-text-edits> [(:range (:start (:line 291 :character 0) :end (:line 291 :character 6)) :newText "")])
apply(eglot-x--override-text-edits #<subr eglot--apply-text-edits> [(:range (:start (:line 291 :character 0) :end (:line 291 :character 6)) :newText "")])
eglot--apply-text-edits([(:range (:start (:line 291 :character 0) :end (:line 291 :character 6)) :newText "")])
eglot-format(nil nil)
eglot-format-buffer()
funcall-interactively(eglot-format-buffer)
command-execute(eglot-format-buffer record)
execute-extended-command(nil "eglot-format-buffer" nil)
funcall-interactively(execute-extended-command nil "eglot-format-buffer" nil)
command-execute(execute-extended-command)
I'm using:
In that version of eglot there is an eglot--range-region
function. Perhaps eglot-x should use that if eglot-range-region
is missing?
Alternatively, if, by policy, eglot-x isn't compatible with Emacs 29.3's default eglot version, perhaps catch this an issue an error about it? That could save time for others. For example, if eglot-x was on melpa (#1), the proper version dependencies could be expressed.
The situation with upgrading built-in packages is a bit of a pain (see https://www.gnu.org/software/emacs/manual/html_node/emacs/Package-Installation.html), but I have options for upgrading eglot to 1.17 (the current GNU Elpa version), if I must (but I'd rather not...if I want bleeding edge eglot I'd just assume run bleeding edge Emacs too)
I just updated to eglot 1.16 and noticed a parameter was added to eglot--apply-text-edits
:
joaotavora/eglot@88c46bd#diff-d6c5a55ddb4dd8dca075c4e0d48c851460ead14c77f333c66b02ccc7d1c2aff0L3320
This results in errors with the advised version:
Before-save hook error: (wrong-number-of-arguments #<subr eglot-x--apply-text-edits> 3)
Would be nice to be able to
(use-package eglot-x
:ensure t
:config
(with-eval-after-load 'eglot (require 'eglot-x)))
To use this package.
Hi there,
Is there any examples or documentation on how to run the files feature? I might've misunderstood but I had thought it would allow something like running a language server in docker while emacs itself runs on a local machine but it's not clear how to support that.
But how should the UI look like? Delegate this to xref as usual?
Hi,
I get the following error:
[eglot] Connected! Server `ccls' now managing `(c-mode c-ts-mode c++-mode c++-ts-mode)' buffers in project `c_sandbox'.
eglot--lsp-position-to-point: Symbol’s function definition is void: eglot-move-to-column
error in process filter: eglot--lsp-position-to-point: Symbol’s function definition is void: eglot-move-to-column
It looks like it is related to this:
Line 608 in 7d1724a
I am running the following version of Emacs:
GNU Emacs 29.0.91 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.37, cairo version 1.16.0)
WDYT
AS the title says, see dart-lang/sdk#55935. Disabling eglot-x with eglot-x-disable
lets me still run the server, and perhaps ultimately the issue is with dart's language server being too strict, but maybe there's a better way of handling this.
This results in eglot failing to run the dart language-server, with errors like this:
[jsonrpc] D[00:39:52.098] Running language server: dart language-server --client-id emacs.eglot-dart
[jsonrpc] e[00:39:52.099] --> initialize[1] {"jsonrpc":"2.0","id":1,"method":"initialize","params":{"processId":183783,"clientInfo":{"name":"Eglot","version":"1.17"},"rootPath":"/home/tlater/Documents/Work/Sonnenshift/frontend/","rootUri":"file:///home/tlater/Documents/Work/Sonnenshift/frontend","initializationOptions":{},"capabilities":{"workspace":{"applyEdit":true,"executeCommand":{"dynamicRegistration":false},"workspaceEdit":{"documentChanges":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":false},"configuration":true,"workspaceFolders":true},"textDocument":{"synchronization":{"dynamicRegistration":false,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":false,"completionItem":{"snippetSupport":true,"deprecatedSupport":true,"resolveSupport":{"properties":["documentation","details","additionalTextEdits"]},"tagSupport":{"valueSet":[1]}},"contextSupport":true},"hover":{"dynamicRegistration":false,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":false,"signatureInformation":{"parameterInformation":{"labelOffsetSupport":true},"documentationFormat":["markdown","plaintext"],"activeParameterSupport":true}},"references":{"dynamicRegistration":false},"definition":{"dynamicRegistration":false,"linkSupport":true},"declaration":{"dynamicRegistration":false,"linkSupport":true},"implementation":{"dynamicRegistration":false,"linkSupport":true},"typeDefinition":{"dynamicRegistration":false,"linkSupport":true},"documentSymbol":{"dynamicRegistration":false,"hierarchicalDocumentSymbolSupport":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"documentHighlight":{"dynamicRegistration":false},"codeAction":{"dynamicRegistration":false,"resolveSupport":{"properties":["edit","command"]},"dataSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"isPreferredSupport":true},"formatting":{"dynamicRegistration":false},"rangeFormatting":{"dynamicRegistration":false},"rename":{"dynamicRegistration":false},"inlayHint":{"dynamicRegistration":false},"publishDiagnostics":{"relatedInformation":false,"codeDescriptionSupport":false,"tagSupport":{"valueSet":[1,2]}}},"window":{"showDocument":{"support":true},"workDoneProgress":true},"general":{"positionEncodings":["utf-32","utf-8","utf-16"]},"experimental":{"snippetTextEdit":true,"serverStatusNotification":true,"colorDiagnosticOutput":true,"openServerLogs":true,"commands":{"commands":["rust-analyzer.runSingle","rust-analyzer.showReferences","rust-analyzer.gotoLocation","rust-analyzer.rename","editor.action.rename"]},"hoverActions":true,"localDocs":true},"offsetEncoding":["utf-32","utf-16"]},"workspaceFolders":[{"uri":"file:///home/tlater/Documents/Work/Sonnenshift/frontend","name":"~/Documents/Work/Sonnenshift/frontend/"}]}}
[jsonrpc] e[00:39:52.276] <-- initialize[1] {"id":1,"jsonrpc":"2.0","error":{"code":-32001,"message":"An error occurred while handling initialize request"}}
[jsonrpc] D[00:39:52.276] Connection state change: `killed
'
----------b---y---e---b---y---e----------
[jsonrpc] e[00:39:52.283] <-- window/logMessage {"jsonrpc":"2.0","method":"window/logMessage","params":{"message":"An error occurred while handling initialize request: type '_Map<String, dynamic>' is not a subtype of type 'List<dynamic>?' in type cast\n#0 new LspClientCapabilities (package:analysis_server/src/lsp/client_capabilities.dart:201:45)\n#1 LspAnalysisServer.handleClientConnection (package:analysis_server/src/lsp/lsp_analysis_server.dart:382:27)\n#2 InitializeMessageHandler.handle (package:analysis_server/src/lsp/handlers/handler_initialize.dart:27:12)\n#3 MessageHandler.handleMessage (package:analysis_server/src/lsp/handlers/handlers.dart:334:12)\n#4 ServerStateMessageHandler.handleMessage (package:analysis_server/src/lsp/handlers/handlers.dart:396:25)\n#5 LspAnalysisServer._handleRequestMessage (package:analysis_server/src/lsp/lsp_analysis_server.dart:1010:41)\n#6 LspAnalysisServer.handleMessage.<anonymous closure>.<anonymous closure> (package:analysis_server/src/lsp/lsp_analysis_server.dart:461:21)\n#7 OperationPerformanceImpl.runAsync (package:analyzer/src/util/performance/operation_performance.dart:172:29)\n#8 LspAnalysisServer.handleMessage.<anonymous closure> (package:analysis_server/src/lsp/lsp_analysis_server.dart:444:33)\n#9 _rootRun (dart:async/zone.dart:1399:13)\n#10 _CustomZone.run (dart:async/zone.dart:1301:19)\n#11 _runZoned (dart:async/zone.dart:1826:10)\n#12 runZonedGuarded (dart:async/zone.dart:1814:12)\n#13 LspAnalysisServer.handleMessage (package:analysis_server/src/lsp/lsp_analysis_server.dart:436:5)\n#14 LspByteStreamServerChannel._readMessage (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:84:16)\n#15 LspByteStreamServerChannel.listen.<anonymous closure> (package:analysis_server/src/lsp/channel/lsp_byte_stream_channel.dart:53:24)\n#16 _rootRunUnary (dart:async/zone.dart:1407:47)\n#17 _CustomZone.runUnary (dart:async/zone.dart:1308:19)\n#18 _CustomZone.runUnaryGuarded (dart:async/zone.dart:1217:7)\n#19 _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:365:11)\n#20 _DelayedData.perform (dart:async/stream_impl.dart:541:14)\n#21 _PendingEvents.handleNext (dart:async/stream_impl.dart:646:11)\n#22 _PendingEvents.schedule.<anonymous closure> (dart:async/stream_impl.dart:617:7)\n#23 _rootRun (dart:async/zone.dart:1391:47)\n#24 _CustomZone.run (dart:async/zone.dart:1301:19)\n#25 _CustomZone.runGuarded (dart:async/zone.dart:1209:7)\n#26 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1249:23)\n#27 _rootRun (dart:async/zone.dart:1399:13)\n#28 _CustomZone.run (dart:async/zone.dart:1301:19)\n#29 _CustomZone.runGuarded (dart:async/zone.dart:1209:7)\n#30 _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1249:23)\n#31 _microtaskLoop (dart:async/schedule_microtask.dart:40:21)\n#32 _startMicrotaskLoop (dart:async/schedule_microtask.dart:49:5)\n#33 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:118:13)\n#34 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:185:5)\n","type":1}}
[stderr]
[stderr]
[stderr] nil
[stderr] nil
[stderr] Process EGLOT (frontend/(dart-mode dart-ts-mode)) stderr finished
Hi,
Should we mention the fact that this program expects dot
(graphviz) and graph-easy
to be installed in the README?
https://github.com/nemethf/eglot-x/blob/master/eglot-x.el#L1149C23-L1149C33
Hi,
Are there any plans to support the built-in flymake over flycheck?
Hi,
Do you personally use this with rust-mode or rustic?
Hi! Thank you for your contributions to this project. This package has greatly helped me in debugging rust-analyzer
on Emacs.
However, recently I encountered an issue after from the commit a7994d19f4f98ba8d943ee4c55c5082ec2d8b82f
where Emacs frequently reports the following error:
eglot-x--run-after-jump: [eglot-x] Server sent an unknown Runnable kind: nil
This error makes xref-go-back
unusable. I suspect it might be a bug in eglot-x
. Could you please look into it?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.