go-langserver icon indicating copy to clipboard operation
go-langserver copied to clipboard

Goto definition not working for dot imports

Open ramya-rao-a opened this issue 7 years ago • 6 comments

In the below case, the definition provider fails for Println

package main

import . "fmt"

func main() {
   Println("hello")
}

ramya-rao-a avatar Jan 19 '18 03:01 ramya-rao-a

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.

keegancsmith avatar Jan 19 '18 07:01 keegancsmith

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

lloiser avatar Jan 19 '18 07:01 lloiser

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

RahmanQureshi avatar Mar 18 '20 17:03 RahmanQureshi

@RahmanQureshi I would suggest migrating to gopls

keegancsmith avatar Mar 18 '20 18:03 keegancsmith

@keegancsmith yes I am using the gopls language server.

RahmanQureshi avatar Mar 18 '20 19:03 RahmanQureshi

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

keegancsmith avatar Mar 18 '20 20:03 keegancsmith