Skip to content

Commit 6bf14ca

Browse files
rsubtilCalinou
andauthored
Add LSP/DAP configuration section on external editors (godotengine#7948)
Co-authored-by: Hugo Locurcio <[email protected]>
1 parent 1bc6c89 commit 6bf14ca

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed

_tools/codespell-ignore.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ lod
44
que
55
raison
66
uint
7+
implementors

tutorials/editor/external_editor.rst

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,45 @@ We have official plugins for the following code editors:
7373

7474
- `Visual Studio Code <https://github.com/godotengine/godot-vscode-plugin>`_
7575
- `Emacs <https://github.com/godotengine/emacs-gdscript-mode>`_
76+
77+
LSP/DAP support
78+
---------------
79+
80+
Godot supports the `Language Server Protocol <https://microsoft.github.io/language-server-protocol/>`_ (**LSP**) for code completion and the `Debug Adapter Protocol <https://microsoft.github.io/debug-adapter-protocol/>`_ (**DAP**) for debugging. You can check the `LSP client list <https://microsoft.github.io/language-server-protocol/implementors/tools/>`_ and `DAP client list <https://microsoft.github.io/debug-adapter-protocol/implementors/tools/>`_ to find if your editor supports them. If this is the case, you should be able to take advantage of these features without the need of a custom plugin.
81+
82+
To use these protocols, a Godot instance must be running on your current project. You should then configure your editor to communicate to the running adapter ports in Godot, which by default are ``6005`` for **LSP**, and ``6006`` for **DAP**. You can change these ports and other settings in the **Editor Settings**, under the **Network > Language Server** and **Network > Debug Adapter** sections respectively.
83+
84+
Below are some configuration steps for specific editors:
85+
86+
Visual Studio Code
87+
^^^^^^^^^^^^^^^^^^
88+
89+
You need to install the official `Visual Studio Code plugin <https://github.com/godotengine/godot-vscode-plugin>`_.
90+
91+
For **LSP**, follow `these instructions <https://github.com/godotengine/godot-vscode-plugin#gdscript_lsp_server_port>`_ to change the default LSP port. The connection status can be checked on the status bar:
92+
93+
.. image:: img/lsp_vscode_status.png
94+
95+
For **DAP**, specify the ``debugServer`` property in your ``launch.json`` file:
96+
97+
.. code-block:: json
98+
99+
{
100+
"version": "0.2.0",
101+
"configurations": [
102+
{
103+
"name": "GDScript Godot",
104+
"type": "godot",
105+
"request": "launch",
106+
"project": "${workspaceFolder}",
107+
"port": 6007,
108+
"debugServer": 6006,
109+
}
110+
]
111+
}
112+
113+
Emacs
114+
^^^^^
115+
116+
Check the official instructions to configure `LSP <https://github.com/godotengine/emacs-gdscript-mode#auto-completion-with-the-language-server-protocol-lsp>`_, and `DAP <https://github.com/godotengine/emacs-gdscript-mode#using-the-debugger>`_.
117+
10.1 KB
Loading

0 commit comments

Comments
 (0)