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

x/tools/gopls: workspace symbol breaks mysteriously with swig package #37660

Open
jackielii opened this issue Mar 4, 2020 · 3 comments
Open

x/tools/gopls: workspace symbol breaks mysteriously with swig package #37660

jackielii opened this issue Mar 4, 2020 · 3 comments

Comments

@jackielii
Copy link

@jackielii jackielii commented Mar 4, 2020

Please answer these questions before submitting your issue. Thanks!

What did you do?

Original error is when I have a package with swig in a internal package, I have a lot other packages that are under pkg. The error behavior is when I search for readat for ReadAt methods the log shows:

[Trace - 15:00:40.629 PM] Sending request 'workspace/symbol - (45)'.
Params: {"query":"readat"}


[Error - 15:00:40.635 PM] Received #45 successfully parsed but no token.File for file:///home/jackieli/.cache/go-build/76/76f45c83da5196e2a6f1b9f32e5c1884578f7160be7760bc83e81255afe88f1d-d (/home/jackieli/.cache/go-build/76/76f45c83da5196e2a6f1b9f32e5c1884578f7160be7760bc83e81255afe88f1d-d:13:1: illegal character U+0023 '#')

However, query with reada it returns ReadAt methods:
image
image

Tried to produce a minimised example at: https://github.com/jackielii/gopls-bug-report/tree/master
This time it doesn't produce any symbles:

tree
.
├── go.mod
├── main.go
└── pkg
    ├── gosimple
    │   └── reader.go
    └── simple
        ├── export_swig.go
        ├── simple.swigcxx
        └── simple_test.go

3 directories, 6 files
cat main.go
package main

import "fmt"

func main() {
        fmt.Println("vim-go")
}

func Hello() error {
        return nil
}
cat pkg/gosimple/reader.go
package gosimple

func ExportedGoSimple() {
        panic("not implemented")
}

log shows:

[Error - 15:05:37.598 PM] Received #43 successfully parsed but no token.File for file:///home/jackieli/.cache/go-build/27/27daf8a702f24cf1afd53660601fae369a268d5a7235413b199ac3d0590f2f97-d (/home/jackieli/.cache/go-build/27/27daf8a702f24cf1afd53660601fae369a268d5a7235413b199ac3d0590f2f97-d:13:1: illegal character U+0023 '#')

What did you expect to see?

at least the non swig symbols show

What did you see instead?

no symbols

Build info

golang.org/x/tools/gopls v0.3.3
    golang.org/x/tools/gopls@v0.3.3 h1:mTFqRDJQmpSsgDDWvbtGnSva1z9uX2XcDszSWa6DhBQ=
    github.com/BurntSushi/toml@v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
    github.com/sergi/go-diff@v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
    golang.org/x/mod@v0.1.1-0.20191105210325-c90efee705ee h1:WG0RUwxtNT4qqaXX3DPA8zHFNm/D9xaBpxzHt1WcA/E=
    golang.org/x/sync@v0.0.0-20190423024810-112230192c58 h1:8gQV6CLnAEikrhgkHFbMAEhagSSnXWGV915qUMm9mrU=
    golang.org/x/tools@v0.0.0-20200227200655-6862ededa516 h1:OX66ZzpltgCOuBSGdaeT77hS2z3ub2AB+EuGxvGRBLE=
    golang.org/x/xerrors@v0.0.0-20191011141410-1b5146add898 h1:/atklqdjdhuosWIl6AIbOeHJjicWYPqR9bpxqxYG2pA=
    honnef.co/go/tools@v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U=
    mvdan.cc/xurls/v2@v2.1.0 h1:KaMb5GLhlcSX+e+qhbRJODnUUBvlw01jt4yrjFIHAuA=

Go info

go version go1.14 linux/amd64

GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/jackieli/.cache/go-build"
GOENV="/home/jackieli/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/jackieli/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/jackieli/gomod/gopls-bug-report/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build057671161=/tmp/go-build -gno-record-gcc-switches"
@gopherbot gopherbot added this to the Unreleased milestone Mar 4, 2020
@gopherbot gopherbot added the Tools label Mar 4, 2020
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Mar 4, 2020

Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here.

@heschik

This comment has been minimized.

Copy link
Contributor

@heschik heschik commented Mar 4, 2020

The cause of the error is #36129. It might be reasonable for workspace symbols to continue despite it.

@heschik

This comment has been minimized.

Copy link
Contributor

@heschik heschik commented Mar 4, 2020

I take it back -- we are ignoring the errors from #36129. #37098 is what kills it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.