Comments (14)
It looks strange. I'm going to ping who originally implemented this feature.
from emacs-gdscript-mode.
Since Emacs has figured out the 6008 port, it seems that the function I added has finished successfully. Can you use something like netstat
(not sure if Mac has this program or any alternatives to it) to verify that Emacs indeed makes a connection to port 6008?
Other than that, I have no clue -- I only based my work on mailing list discussions and my reading of some Emacs documentation, and don't have much experience in the internals of eglot.
from emacs-gdscript-mode.
Hello, @bbbscarter
The automatic eglot configuration in the current version has not been tested on Macos,
You can check ~/.config/godot/editor_settings-4.tres
exists.
If not exists , to find editor_settings-4.tres
in what directories, and then we can fix this program.
from emacs-gdscript-mode.
Using emacs 29.1 and Godot 4.1 on MacOS, configured to use port 6008.
eglot connects to the Godot instance, but doesn't do anything - and then times-out after 30 seconds.
By contrast, lsp-mode connects and continues working, albeit with a warning: "Unknown notification: gdscript/capabilities"
eglot-stderr-buffer shows nothing, with "No current JSON-RPC connection".
@bbbscarter
Can you disable lsp-mode
and shutdown lsp-mode's connection.
Then test eglot
?
Or you can just use eglot
.
from emacs-gdscript-mode.
Yup, to confirm on both these points:
-
The gdscript-eglot-contact method is failing on Mac. (On MacOS, Godot's config isn't in
~/.config
referenced in that function, it's in~/Library/Application Support/Godot/
). I manually hackedeglot-server-programs
to point to localhost:6008. -
I can confirm this was failing without LSP - I only installed LSP when I couldn't get eglot to work.
-
Also, it definitely makes the initial connection - the client connection is logged in the Godot console, and the capabilities are sent back Emacs, as shown in the log above. However it times out 30 seconds later for some reason.
I'm not particularly familiar with debugging lsp servers in general, or eglot specifically - but if someone can tell me where to start I'm happy to give it a go!
from emacs-gdscript-mode.
@bbbscarter
You can debug LSP relevant .
- You can use
wireshark
to captureLookback: lo
packets and check if there are corresponding messages ingodot lsp
. - Modify
X11
->Json
by selecting "Decode as" in theright-click
menu. - Check Tcp package has "Transmission Contorl Protocol, Src Port: 6008 Dist:xxx" After eglot's request.
- Compare the differences between the corresponding messages of lsp-mode and eglot
from emacs-gdscript-mode.
Okay - done that, and attached the results. The main obvious difference is that the initialisation payload is very different between LSP and eglot, but not sure if that's relevant.
I've pulled out the relevant JSON sections below.
from emacs-gdscript-mode.
@bbbscarter
I think this is because the last request package did not send content in json-rpc
format.
Please confirm if the eglot version is too low, and then you can send an error report to report-emacs-bug
On my machine, the following compiled versions are available.
In GNU Emacs 29.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
3.24.38, cairo version 1.17.8) of 2023-07-31 built on xiliuya-pc
Repository revision: 525d05c1b8ac54a4f7ad166b97f2fa913f80e73c
Repository branch: makepkg
System Description: Arch Linux
from emacs-gdscript-mode.
@bbbscarter
To debug eglot , you can edebug-defun
eglot--connect
, in the following areas:
:success-fn
(eglot--lambda ((InitializeResult) capabilities serverInfo)
(unless canceled
(push server
(gethash project eglot--servers-by-project))
(setf (eglot--capabilities server) capabilities)
(setf (eglot--server-info server) serverInfo)
(jsonrpc-notify server :initialized eglot--{})
from emacs-gdscript-mode.
I was running the version that comes with emacs 29.1 - 1.12.29.
I've just upgraded eglot to 1.15 and I'm getting the same behaviour.
I will see if I get anywhere with edebug.
from emacs-gdscript-mode.
Tried both edebug, and adding logging messages to eglot--connect - neither the succed-fn nor the error-fn callbacks are being called, only the timeout-fn.
(I also checked that they are being called in other eglot connections, such as csharp, and they are).
from emacs-gdscript-mode.
@bbbscarter
You can tracking stack information timeout-fn
(edebug-mode key 'd').
And based on your packet capture information, for some reason, the 'initialized' packet that eglot should have sent was not generated correctly on your machine.
(:jsonrpc "2.0" :method "initialized"
This may be the problem, I think you should provide bug reports to emacs maill list.
from emacs-gdscript-mode.
I think maybe this code has problem:
(with-eval-after-load 'eglot
(defvar eglot-server-programs)
(push (cons 'gdscript-mode #'gdscript-eglot-contact)
eglot-server-programs))
Can you test to eval:
(setq eglot-server-programs (list (cons 'gdscript-mode #'gdscript-eglot-contact)))
Then try again.
from emacs-gdscript-mode.
Since gdscript-eglot-contact doesn't work for me, in order to connect I'm already setting that list directly (in my case to ("localhost" 6008)
. As it is, I think the existing line should work - push
will put it at the front of the list, which in an alist will override later entries.
In any case, I think you're correct - this looks like it's either an eglot problem, or a Godot problem. I'll fire something over to the emacs lists.
Thanks!
Simon
from emacs-gdscript-mode.
Related Issues (20)
- Lots of "unknown notification" errors HOT 5
- The hydra window is very large and makes coding a bit jarring HOT 5
- About Godot C# HOT 2
- Cannot Use gdscript-debug-add-breakpoint HOT 2
- Breakpoints don't appear in the left margin
- Link to LSP-Docs just links back here when looking how to install HOT 5
- Question: how to run-script with arguments? HOT 1
- Can't open local docs with C-c C-b a HOT 2
- "open-project-in-editor" Flatpak Support HOT 6
- add support for eglot ? HOT 1
- This repository needs a new maintainer HOT 14
- Performance Issues HOT 7
- gdscript-eglot-version should be documented in README HOT 2
- eglot + godot3.5.2: Searching for program: No such file or directory, localhost:6008 HOT 4
- Eglot post-command-hook error for Godot3 flatpak HOT 2
- Symbol’s value as variable is void: gdscript-hydra--menu HOT 9
- Consistent text file formatting in this code base HOT 1
- Package metadata (including package version) inconsistent in source files HOT 2
- gdscript-mark-defun is missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from emacs-gdscript-mode.