sourcegraph / go-langserver

Go language server to add Go support to editors and other tools that use the Language Server Protocol (LSP)
https://sourcegraph.com
MIT License
1.17k stars 89 forks source link

Goto definition not working for dot imports #227

Open ramya-rao-a opened 6 years ago

ramya-rao-a commented 6 years ago

In the below case, the definition provider fails for Println

package main

import . "fmt"

func main() {
   Println("hello")
}
keegancsmith commented 6 years ago

We also use godef as well. The use of . imports is discouraged and linting tools actually complain if you use them outside of a package test https://github.com/golang/go/wiki/CodeReviewComments#import-dot

As such this is a very very rarely used go feature. So will be pretty low priority for us to fix, so I don't think we will fix it anytime soon.

lloiser commented 6 years ago

There is a pull request at godef: https://github.com/rogpeppe/godef/pull/68

RahmanQureshi commented 4 years ago

Any update on this? I'm using the language server.

keegancsmith commented 4 years ago

@RahmanQureshi I would suggest migrating to gopls

RahmanQureshi commented 4 years ago

@keegancsmith yes I am using the gopls language server.

keegancsmith commented 4 years ago

This issue is for another language server. You likely need to file an issue against gopls. https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#file-an-issue