How to enable code completion

This article explains how to use code completion in server-side development.


In this article, we will start the explanation from the state where the project is deployed from the project template.

For more information about project deployment using project templates, please refer to " Introduction To Diarkis Server Template" and " Diarkis Server Template Directories".

Get a code reference for code completion

Get the archive with the same name as the Diarkis version you want to use.

current.tar.gz is a link to the latest version.

If you want to use old version, "current" to "v0.x.x" in URL.

After download it, extract it to an arbitrary location.

Referencing the code reference from the project

Add the following statement to go.mod, you can refer to the code reference from the code completion function of editor/IDE.

replace => /path/to/downloaed/coderef

Path should be the location where the code referece will be extracted.

What is "replace" directive

This is a directive that replaces the content (reference) of the module specified by import.

See also :


The replace directive in go.mod (replace is ignored when building with diarkis-cli, so there is no need to remove when you want to build project.

Last updated