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: can't add new file to existing package #35605

Closed
muirdm opened this issue Nov 15, 2019 · 3 comments
Assignees
Labels
Milestone

Comments

@muirdm
Copy link

@muirdm muirdm commented Nov 15, 2019

On master (4191b8cbba092238a318a71cdff48b20b4e1e5d8) when I add a new file to an existing package I get no ParseGoHandle for file://... when I try to use gopls functionality in the new file.

Note that in my editor the new file comes pre-populated with the package name based on the file's directory name (i.e. the bug only reproduces if the initial "didOpen" message already contains the "package foo" line). If I subsequently edit the package name then the file gets loaded normally.

Below is an RPC trace starting from opening the new file through the first "no ParseGoHandle" error:

[Trace - 05:01:19 PM] Sending notification 'textDocument/didOpen'.
Params: {
  "textDocument": {
    "uri": "file:///Users/muir/scratch/foo/bar.go",
    "languageId": "go",
    "version": 0,
    "text": "\npackage foo\n"
  }
}


[Trace - 05:01:19 PM] Received notification 'window/logMessage'.
Params: {
  "message": "2019/11/14 17:01:19 go/packages.Load\n\tpackages = 1",
  "type": 3
}


[Trace - 05:01:19 PM] Received notification 'window/logMessage'.
Params: {
  "message": "2019/11/14 17:01:19 go/packages.Load\n\tpackage = foo\n\tfiles = [/Users/muir/scratch/foo/foo.go /Users/muir/scratch/foo/bar.go]",
  "type": 3
}


[Trace - 05:01:19 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/muir/scratch/foo/foo.go"
}


[Trace - 05:01:23 PM] Sending notification 'textDocument/didChange'.
Params: {
  "textDocument": {
    "uri": "file:///Users/muir/scratch/foo/bar.go",
    "version": 1
  },
  "contentChanges": [
    {
      "range": {
        "start": {
          "line": 1,
          "character": 11
        },
        "end": {
          "line": 1,
          "character": 11
        }
      },
      "rangeLength": 0,
      "text": "\n"
    }
  ]
}


[Trace - 05:01:23 PM] Received notification 'textDocument/publishDiagnostics'.
Params: {
  "diagnostics": [],
  "uri": "file:///Users/muir/scratch/foo/foo.go"
}


[Trace - 05:01:23 PM] Sending request 'textDocument/signatureHelp - (568)'.
Params: {
  "textDocument": {
    "uri": "file:///Users/muir/scratch/foo/bar.go"
  },
  "position": {
    "line": 2,
    "character": 0
  }
}


[Trace - 05:01:23 PM] Received response 'textDocument/signatureHelp - (568)' in 6ms.
Result: null


[Trace - 05:01:23 PM] Received notification 'window/logMessage'.
Params: {
  "message": "2019/11/14 17:01:23 no signature help\n\tAt = {2 0}\n\tFailure = no ParseGoHandle for file:///Users/muir/scratch/foo/bar.go",
  "type": 3
}
@gopherbot gopherbot added this to the Unreleased milestone Nov 15, 2019
@gopherbot

This comment has been minimized.

Copy link

@gopherbot gopherbot commented Nov 15, 2019

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.

@stamblerre stamblerre self-assigned this Nov 15, 2019
@stamblerre stamblerre modified the milestones: Unreleased, gopls v1.0 Dec 4, 2019
@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 4, 2019

Thanks for the report. This sounds a lot like #35949, so I will close this as a duplicate.

@stamblerre

This comment has been minimized.

Copy link
Contributor

@stamblerre stamblerre commented Dec 4, 2019

Duplicate of #35949

@stamblerre stamblerre marked this as a duplicate of #35949 Dec 4, 2019
@stamblerre stamblerre closed this Dec 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.