diff --git a/_tools/codespell-ignore.txt b/_tools/codespell-ignore.txt index aaf18813b9d..e0bc96bcd9c 100644 --- a/_tools/codespell-ignore.txt +++ b/_tools/codespell-ignore.txt @@ -4,3 +4,4 @@ lod que raison uint +implementors diff --git a/tutorials/editor/external_editor.rst b/tutorials/editor/external_editor.rst index 5aa87a76456..d29591929c1 100644 --- a/tutorials/editor/external_editor.rst +++ b/tutorials/editor/external_editor.rst @@ -68,3 +68,45 @@ We have official plugins for the following code editors: - `Visual Studio Code `_ - `Emacs `_ + +LSP/DAP support +--------------- + +Godot supports the `Language Server Protocol `_ (**LSP**) for code completion and the `Debug Adapter Protocol `_ (**DAP**) for debugging. You can check the `LSP client list `_ and `DAP client list `_ 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 `_. + +For **LSP**, follow `these instructions `_ 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 `_, and `DAP `_. + diff --git a/tutorials/editor/img/lsp_vscode_status.png b/tutorials/editor/img/lsp_vscode_status.png new file mode 100644 index 00000000000..6303ffe1b40 Binary files /dev/null and b/tutorials/editor/img/lsp_vscode_status.png differ