Giter Site home page Giter Site logo

Comments (5)

stamblerre avatar stamblerre commented on August 16, 2024 1

Thank you for the repro case - I was able to reproduce the issue. Let's continue the conversation in the upstream gopls issue: golang/go#39124.

from vscode-go.

hyangah avatar hyangah commented on August 16, 2024

@daaku Are you using the language server? Can you share your extension-related settings (go or [go] prefixes)?

If you enabled the language server, can you please capture the gopls logs following the instruction. I hope that shows us whether the gopls, the go language server, detected the go.mod file change or not.

from vscode-go.

daaku avatar daaku commented on August 16, 2024

The go related settings I have are:

    "go.formatTool": "goimports",
    "go.useLanguageServer": true,

I confirmed that this still happens (gopls just got updated to 0.4.1 and the extension to 0.14.2). I captured the log but it contains too much information for me to just share as is. I'll create a empty project and capture the logs and update later.

from vscode-go.

stamblerre avatar stamblerre commented on August 16, 2024

Thanks! It's also fine to redact information in the log if that's easier.

from vscode-go.

daaku avatar daaku commented on August 16, 2024

The trace of a new empty project where I open a file with 3 lines of code and reproduce the issue is nearly 1500 lines and 1.5MB in size. That's too much for me to go an audit to make me feel safe sharing.

Here's a set of repro steps, hopefully that's enough:

mkdir gt
cd gt
go mod init github.com/daaku/gt
touch main.go
code .
# wait for vscode to open, open main.go, don't write anything yet
# then back in the terminal
go get github.com/pkg/errors

No go to the vscode window that is open, open main.go and type this in:

package main

import "github.com/pkg/errors"

var foo = errors.WithStack(nil)
  1. Hit save.
  2. See the package gets a yellow squiggly with the warning "github.com/pkg/errors is not in your go.mod file.go".
  3. Click on the go.mod file in the browser sidebar.
  4. The file opens and the warning disappears.

from vscode-go.

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.