Giter VIP home page Giter VIP logo

Comments (9)

fannheyward avatar fannheyward commented on May 29, 2024

In non-gomod project, everything is work perfectly. But in gomod project, which has go.mod and GO111MODULE =on, go list error.

from bingo.

saibing avatar saibing commented on May 29, 2024

@fannheyward

Whether the '$GOPATH/pkg/mod/github.com/jinzhu/configor' directory exists?

from bingo.

fannheyward avatar fannheyward commented on May 29, 2024

There is $GOPATH/pkg/mod/github.com/jinzhu/[email protected].

from bingo.

fannheyward avatar fannheyward commented on May 29, 2024

New test with bingo project:

  1. git clone https://github.com/saibing/bingo.git to src/bingo
  2. export GO111MODULE=on
  3. open with VSCode
  4. error in /tmp/lspserver.log
<-- notif: textDocument/publishDiagnostics: {"uri":"file:///Users/fannheyward/src/bingo/main.go","diagnostics":[{"range":{"start":{"line":3,"character":1},"end":{"line":3,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import context (missing package: \"context\")"},{"range":{"start":{"line":4,"character":1},"end":{"line":4,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import flag (missing package: \"flag\")"},{"range":{"start":{"line":5,"character":1},"end":{"line":5,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import fmt (missing package: \"fmt\")"},{"range":{"start":{"line":6,"character":1},"end":{"line":6,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import io (missing package: \"io\")"},{"range":{"start":{"line":7,"character":1},"end":{"line":7,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import log (missing package: \"log\")"},{"range":{"start":{"line":8,"character":1},"end":{"line":8,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import net (missing package: \"net\")"},{"range":{"start":{"line":9,"character":1},"end":{"line":9,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import net/http (missing package: \"net/http\")"},{"range":{"start":{"line":10,"character":1},"end":{"line":10,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import os (missing package: \"os\")"},{"range":{"start":{"line":11,"character":1},"end":{"line":11,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import runtime/debug (missing package: \"runtime/debug\")"},{"range":{"start":{"line":12,"character":1},"end":{"line":12,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import time (missing package: \"time\")"},{"range":{"start":{"line":14,"character":1},"end":{"line":14,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import github.com/saibing/bingo/langserver (missing package: \"github.com/saibing/bingo/langserver\")"},{"range":{"start":{"line":15,"character":1},"end":{"line":15,"character":1}},"severity":1,"source":"LSP: Go compiler","message":"could not import github.com/sourcegraph/jsonrpc2 (missing package: \"github.com/sourcegraph/jsonrpc2\")"},{"range":{"start":{"line":17,"character":3},"end":{"line":17,"character":3}},"severity":1,"source":"LSP: Go compiler","message":"could not import net/http/pprof (missing package: \"net/http/pprof\")"}]}

^[[C--> request #1: textDocument/definition: {"textDocument":{"uri":"file:///Users/fannheyward/src/bingo/main.go"},"position":{"line":44,"character":6}}
<-- error #1: textDocument/definition: {"code":0,"message":"definition not found","data":null}

from bingo.

saibing avatar saibing commented on May 29, 2024

@fannheyward

thank your feedback

I have fixed this bug, please try the latest version's bingo

from bingo.

fannheyward avatar fannheyward commented on May 29, 2024

Test with the latest build, after open main.go, lspserver.log error:

<-- notif: window/showMessage: {"type":1,"message":"go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- /usr/local/go/src/builtin]: exit status 1: go: cannot find main module; see 'go help modules'\n"}
<-- error #0: initialize: {"code":0,"message":"go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- /usr/local/go/src/builtin]: exit status 1: go: cannot find main module; see 'go help modules'\n","data":null}

from bingo.

fannheyward avatar fannheyward commented on May 29, 2024

VSCode settings:

"go.autocompleteUnimportedPackages": true,
    "go.inferGopath": true,
    "go.useLanguageServer": true,
    "go.alternateTools": {
        "go-langserver": "bingo"
    },
    "go.languageServerExperimentalFeatures": {
        "format": true,
        "autoComplete": true,
        "rename": true,
        "goToDefinition": true,
        "hover": true,
        "signatureHelp": true,
        "goToTypeDefinition": true,
        "goToImplementation": true,
        "documentSymbols": true,
        "workspaceSymbols": true,
        "findReferences": true
    },

from bingo.

saibing avatar saibing commented on May 29, 2024

@fannheyward
I'm very sorry for this.
please try the latest version's bingo again

from bingo.

fannheyward avatar fannheyward commented on May 29, 2024

It works! Thanks for your woking.

from bingo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.