First, run `cp -r contrib/ide/vscode .vscode` to create new directory `.vscode` with the contents of folder [contrib/ide/vscode](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/contrib/ide/vscode) at the root of the repository. Then, open the project directory in VSCodium.
[GNU Emacs](https://www.gnu.org/software/emacs/) is an open source implementation of the Emacs text editor.
The [Emacs Go-mode](https://github.com/dominikh/go-mode.el), in combination with the [Go language-server](https://github.com/golang/tools/blob/master/gopls/doc/emacs.md) and a LSP client can be used to work on Forgejo's code base.
A prejequisite for working with the language server is [installing gopls](https://github.com/golang/tools/blob/master/gopls/README.md#installation).
After this, you'll want to install the necessary packages in Emacs using `M-x package-install` followed by `go-mode` and your preferred LSP client, so _either_`lsp-mode`_or_`eglot`.
After the installation, you'll need to activate the packages in your [initialization file](https://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html).
Regardless of your choice of LSP client, you'll need to add:
```elisp
(require 'go-mode)
(require 'go-mode-load)
```
Then, for lsp-mode, add:
```elisp
(use-package lsp-mode
:ensure
:commands lsp
:custom
(add-hook 'lsp-mode-hook 'lsp-ui-mode) ;; Optional, see below
(add-hook 'go-mode-hook #'lsp-deferred))
;; lsp-ui mode is optional. It shows inline hints.
(use-package lsp-ui
:ensure
:commands lsp-ui-mode
:custom
(lsp-ui-peek-always-show t)
(lsp-ui-sideline-show-hover t)
(lsp-ui-doc-enable nil))
;; Set up before-save hooks to format buffer and add/delete imports.
;; Make sure you don't have other gofmt/goimports hooks enabled.
(defun lsp-go-install-save-hooks ()
(add-hook 'before-save-hook #'lsp-format-buffer t t)
(add-hook 'before-save-hook #'lsp-organize-imports t t))
As additional quality of life inprovements, you might consider installing [company](https://company-mode.github.io/), [flycheck](https://www.flycheck.org/en/latest/) and/or [magit](https://magit.vc/). Consider the package website for a complete explanation and installation instructions.
<details>
<summary> Here is an init example if you just want to use all three packages </summary>
```elisp
;; company
(use-package company
:ensure
:custom
(company-idle-delay 0) ;; how long to wait until popup
(company-minimum-prefix-length 1)
;; (company-begin-commands nil) ;; uncomment to disable popup