Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lsp is installed every time it comes in #21

Closed
j2501987804 opened this issue Aug 29, 2021 · 21 comments
Closed

lsp is installed every time it comes in #21

j2501987804 opened this issue Aug 29, 2021 · 21 comments
Labels
help wanted Extra attention is needed

Comments

@j2501987804
Copy link

image
How to make it take effect automatically

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

Servers installed by nvim-lspinstall is stored permanently on your disk.
You can execute ls ~/.local/share/nvim to check if a directory called lspinstall exists.

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

lspinstall

@j2501987804
Copy link
Author

image

@j2501987804
Copy link
Author

j2501987804 commented Aug 29, 2021

image
I have already installed it, and it will not be loaded automatically. Every time I open vim, I have to execute it manually: lspinstall go

#21 (comment)

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

execute LspInfo when you enter this buffer, correct result is like this:
lspinstall

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

You may need to git pull to get my latest updates.

@j2501987804
Copy link
Author

image

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

Do you have go.mod in this directory?

@j2501987804
Copy link
Author

#21 (comment)
Just pull is still not working, the directory has go.mod

@ayamir
Copy link
Owner

ayamir commented Aug 29, 2021

The correct sequence is this:

  1. make the package dir.
  2. touch go.mod.
  3. touch main.go.
  4. vim main.go.
    sequence

success

@1096015776
Copy link
Contributor

hey , does your go work? i try it and it work ,just touch go.mod and main.go,it work.
i find if i not touch main.go,I just nvim main.go,the lsp is not work,may this is answer.
so you should touch main.go then nvim main.go

@1096015776
Copy link
Contributor

截屏2021-08-29 下午6 57 28
截屏2021-08-29 下午6 57 11

@p1k0pan
Copy link

p1k0pan commented Aug 30, 2021

Mine is not work on go, but it work on python. I runned LspInstall python just like I runned LspInstall go, but python can work automatically and go failed.

@p1k0pan
Copy link

p1k0pan commented Aug 30, 2021

DeepinScreenshot_select-area_20210830125613
I assume that Lsp server has installed the gopls ,but the autocompletion not configure.
How to set it up?

@ayamir
Copy link
Owner

ayamir commented Aug 30, 2021

Mine is not work on go, but it work on python. I runned LspInstall python just like I runned LspInstall go, but python can work automatically and go failed.

golsp need to detect your directory if a work directory or not. Please refer to this and this.

@p1k0pan
Copy link

p1k0pan commented Aug 30, 2021

Mine is not work on go, but it work on python. I runned LspInstall python just like I runned LspInstall go, but python can work automatically and go failed.

golsp need to detect your directory if a work directory or not. Please refer to this and this.

Thank you for your time for a newbee. It work well after adding go.mod . However I wonder why the autocompletion on go still not perform like on python, when I want to type Print, it does not show any code suggestion. Is there anything that I should set up?

@ayamir
Copy link
Owner

ayamir commented Aug 30, 2021

Mine is not work on go, but it work on python. I runned LspInstall python just like I runned LspInstall go, but python can work automatically and go failed.

golsp need to detect your directory if a work directory or not. Please refer to this and this.

Thank you for your time for a newbee. It work well after adding go.mod . However I wonder why the autocompletion on go still not perform like on python, when I want to type Print, it does not show any code suggestion. Is there anything that I should set up?

Did gopls attact to your buffer? You can check this via lualine quickly. Autocompletion is out of the box if gopls starts correctly.

@p1k0pan
Copy link

p1k0pan commented Aug 30, 2021

DeepinScreenshot_select-area_20210830143126
yes

@ayamir
Copy link
Owner

ayamir commented Aug 30, 2021

DeepinScreenshot_select-area_20210830143126
yes

Your go.mod need line like this:
gomod
The module name is your root_dir's name normally. Its gopls's request.

@p1k0pan
Copy link

p1k0pan commented Aug 30, 2021

DeepinScreenshot_select-area_20210830143126
yes

Your go.mod need line like this:
gomod
The module name is your root_dir's name normally. Its gopls's request.

Oh sorry I just run the go file and it said go.mod not set up , and I follow the default set up for go.mod and finally worked, just like your advise. I really appreciate your neovim set up. Thanks again!!

@JerryAllison
Copy link

没有lspinstall命令
image

@qcmc17 qcmc17 mentioned this issue Mar 24, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants