mirror of
https://github.com/godotengine/godot-docs.git
synced 2025-12-31 17:49:03 +03:00
Add LSP/DAP configuration section on external editors (#7948)
Co-authored-by: Hugo Locurcio <hugo.locurcio@hugo.pro>
This commit is contained in:
@@ -4,3 +4,4 @@ lod
|
||||
que
|
||||
raison
|
||||
uint
|
||||
implementors
|
||||
|
||||
@@ -73,3 +73,45 @@ We have official plugins for the following code editors:
|
||||
|
||||
- `Visual Studio Code <https://github.com/godotengine/godot-vscode-plugin>`_
|
||||
- `Emacs <https://github.com/godotengine/emacs-gdscript-mode>`_
|
||||
|
||||
LSP/DAP support
|
||||
---------------
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Below are some configuration steps for specific editors:
|
||||
|
||||
Visual Studio Code
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
You need to install the official `Visual Studio Code plugin <https://github.com/godotengine/godot-vscode-plugin>`_.
|
||||
|
||||
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:
|
||||
|
||||
.. image:: img/lsp_vscode_status.png
|
||||
|
||||
For **DAP**, specify the ``debugServer`` property in your ``launch.json`` file:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": "GDScript Godot",
|
||||
"type": "godot",
|
||||
"request": "launch",
|
||||
"project": "${workspaceFolder}",
|
||||
"port": 6007,
|
||||
"debugServer": 6006,
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Emacs
|
||||
^^^^^
|
||||
|
||||
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>`_.
|
||||
|
||||
|
||||
BIN
tutorials/editor/img/lsp_vscode_status.png
Normal file
BIN
tutorials/editor/img/lsp_vscode_status.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
Reference in New Issue
Block a user