Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How can sublime text3 solve the problem that Gosublime can't complete the code automatically?

Shulou Source: shulou.com Published: 2022-06-02 18:53:45 11月12日 Update

This article mainly introduces sublime text3 how to solve the problem that Gosublime can not automatically complete the code, which has a certain reference value, friends who need can refer to it. I hope you will learn a lot after reading this article. Next, let the editor take you to learn about it.

Sublime text3 solves the problem that Gosublime cannot automatically complete the code

Version

Sublime Text3.2.1go version go1.12.1 darwin/amd64Gosublime 18.11.28

Install Gosublime

Open Perferences-Browse Packages... Enter Gosublime and type in the command line:

Git clone https://github.com/DisposaBoy/GoSublime.git

Automatic completion solution

After installing the Gosublime plug-in on windows and mac using sublime text3, it is impossible to automatically complete the code. After days of research, the following solution has been found.

Open Perferences-Browse Packages... , enter Gosublime:

1. Create a margo directory under the src directory

2. Copy the src/margo.sh/extension-example/extension-example.go file to the margo directory

3. Copy the margo folder (all files and directories) to the src/margo.sh/vendor directory

4. Reopen sublime text3 and wait a few minutes to complete the code automatically.

Gosublime configuration

Perferences-Package Settings-Gosublime-Settings-User {"env": {"GOPATH": "/ data", "GOROOT": "/ usr/local/go", "PATH": "$GOROOT:$GOPATH:$GOROOT/bin",}, "gscomplete_enabled": true, "fmt_enabled": true, "fmt_tab_indent": false, "fmt_tab_width": 4, "autocomplete_snippets": true "autocomplete_tests": true, "autocomplete_builtins": true, "autocomplete_closures": true, "autocomplete_suggest_imports": true, "calltips": true, "use_named_imports": true, "autoinst": true, "ipc_timeout": 1, "fmt_cmd": [goimports "]," on_save ": [{" cmd ":" gs_comp_lint "} {"cmd": "goimports"}], "lint_enabled": true, "linters": [{"cmd": ["go", "run"]}], "comp_lint_enabled": true, "comp_lint_commands": [{"cmd": ["go", "install"]}],}

Ctrl+q display help

Perferences-Package Settings-Gosublime-Key Bindings-Default {"keys": ["ctrl+q"], / / "keys": ["super+.", "super+h"], "command": "gs_doc", "args": {"mode": "hint"}, "context": [{"key": "selector", "operator": "equal", "operand": "source.go"}]}, thank you for reading this article carefully I hope the editor will share how sublime text3 can solve the problem that Gosublime can not automatically complete the code. At the same time, I also hope that you can support us, pay attention to the industry information channel, find out when you encounter problems, and the detailed solutions are waiting for you to learn!

Tags: Code directory problem file method article copy help value content at the same time command multi-day plug-in folder friend version ribbon industry line Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Linux macOS Xiaomi Shulou Technology NVidia