Open FlashIvano opened 1 year ago
Note that depending on the language server this may result on multiple language server instances being spawn for every file opened.
The suggestion isn't right, and we won't be doing it, but there may be something we can do to make gopls
work with more projects. Go project structure is even more rigid than most other languages. Could you tell us more about which files you are editing?
A singel .go file is often used to make a simple command tool, because go can be used as a scripting language. Please refer to https://github.com/erning/gorun I think the right judgement sequence is go.work, go.mod, single file.
@FlashIvano Could we set the project root to the cwd if we detect ^#!
as the first line? (A regular expression) Would that be enough?
@FlashIvano Could we set the project root to the cwd if we detect
^#!
as the first line? (A regular expression) Would that be enough?
Maybe not appropriate. Because the solution still does not support GOPATH mode.
What is "GOPATH mode?"
ale/ale_linters/go/gopls.vim
Add following lines after line 26: