Can't get gopls to work with nvim-lsp

This page summarizes the projects mentioned and recommended in the original post on /r/neovim

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • nvim-lspconfig

    Quickstart configs for Nvim LSP

    https://github.com/neovim/nvim-lspconfig/blob/041dfd7fb648d24c80cb8829dda2469f66f88490/lua/lspconfig/gopls.lua#L8 is the lspconfig, that rootdir I linked to is what triggers the lsp to load. For go it's looking for a go.mod file or a .git directory. You can override that in your server setup if you want it to always load.

  • goimports

    [mirror] Go Tools (by golang)

    You have to install gopls https://github.com/golang/tools/tree/master/gopls which is the server language.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

  • dotfiles

    :open_file_folder: Personal configs: nvim, zsh (by ChrisAmelia)

    And for the config, see https://github.com/ChrisAmelia/dotfiles/blob/master/nvim/lua/lsp.lua#L108-L120

  • example

    Go example projects

    So I just cloned this git repo https://github.com/golang/example and as soon as I entered the hello/hello.go file I was able to get autocomplete and error checking. I don't understand why it isn't working with just a .go file I made.

  • vim

    My configuration for neovim. (by cwebster2)

    check out my lsp setup at https://github.com/cwebster2/vim/blob/nvim-lua/lua/lsp.lua

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts