Skip to content

internal/lsp: error handling #75

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

Closed
wants to merge 2 commits into from
Closed

internal/lsp: error handling #75

wants to merge 2 commits into from

Conversation

mbana
Copy link

@mbana mbana commented Feb 18, 2019

Main change is to the File interface found in internal/lsp/source/view.go.

@gopherbot
Copy link
Contributor

This PR (HEAD: 60553e5) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

Message from Gobot Gobot:

Patch Set 1:

Congratulations on opening your first change. Thank you for your contribution!

Next steps:
Within the next week or so, a maintainer will review your change and provide
feedback. See https://golang.org/doc/contribute.html#review for more info and
tips to get your patch through code review.

Most changes in the Go project go through a few rounds of revision. This can be
surprising to people new to the project. The careful, iterative review process
is our way of helping mentor contributors and ensuring that their contributions
have a lasting impact.

During May-July and Nov-Jan the Go project is in a code freeze, during which
little code gets reviewed or merged. If a reviewer responds with a comment like
R=go1.11, it means that this CL will be reviewed as part of the next development
cycle. See https://golang.org/s/release for more details.


Please don’t reply on this GitHub thread. Visit golang.org/cl/163006.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

This PR (HEAD: 9febbbd) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: b46ebbf) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: c69cefc) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 18628d1) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

@gopherbot
Copy link
Contributor

This PR (HEAD: 1e56d3e) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

* Add Markdown `cmd/gopls/GOPLS.md` file with instructions on how to install `cmd/gopls`.
* Add script `cmd/gopls/install-gopls.sh` to automate install.
@gopherbot
Copy link
Contributor

This PR (HEAD: f6e21a2) has been imported to Gerrit for code review.

Please visit https://go-review.googlesource.com/c/tools/+/163006 to see it.

Tip: You can toggle comments from me using the comments slash command (e.g. /comments off)
See the Wiki page for more info

cd tools
vim internal/lsp/server.go # modify some code
cmd/gopls/install-gopls.sh
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is not needed.

fi

echo -e "\\033[92m ---> installed cmd/gopls (race=${RACE}) \\033[0m"
find "$(command -v gopls)" -printf "%c %p\\n"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@gopherbot
Copy link
Contributor

Message from Ian Cottrell:

Patch Set 7:

I just (last week) removed all the error return values from File accessors, as I think they are the wrong choice.
See https://go-review.googlesource.com/c/tools/+/162399
Happy to have a conversation about it if you like.


Please don’t reply on this GitHub thread. Visit golang.org/cl/163006.
After addressing review feedback, remember to publish your drafts!

@gopherbot
Copy link
Contributor

Message from Yudai Iwasaki:

Patch Set 7:

Patch Set 7:

I just (last week) removed all the error return values from File accessors, as I think they are the wrong choice.
See https://go-review.googlesource.com/c/tools/+/162399
Happy to have a conversation about it if you like.

By the way, the previous commit broke gopls because there are some code that doesn't expect nil from those File functions. gopls now panics due to nil returned by GetPackage().
(since the change was intentional, we should fix diagnostics.go?)

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x50 pc=0x6e88ed]

goroutine 21 [running]:
golang.org/x/tools/internal/lsp/source.Diagnostics(0x8b54c0, 0xc00009e010, 0x8b5600, 0xc0000ba120, 0xc00008a360, 0x57, 0xc00004e740, 0x1, 0x5d785e)
/home/yudai/gopath/src/golang.org/x/tools/internal/lsp/source/diagnostics.go:56 +0xcd
golang.org/x/tools/internal/lsp.(*server).cacheAndDiagnose.func1(0x8b54c0, 0xc00009e010, 0xc0000a7000, 0xc00008a360, 0x57)
/home/yudai/gopath/src/golang.org/x/tools/internal/lsp/diagnostics.go:24 +0x81
created by golang.org/x/tools/internal/lsp.(*server).cacheAndDiagnose
/home/yudai/gopath/src/golang.org/x/tools/internal/lsp/diagnostics.go:23 +0x13c


---
Please don’t reply on this GitHub thread. Visit [golang.org/cl/163006](https://go-review.googlesource.com/c/tools/+/163006#message-a2c9e23f4a6647dcdb893018408ab004dc89c5eb).
After addressing review feedback, remember to [publish your drafts](https://github.com/golang/go/wiki/GerritBot#i-left-a-reply-to-a-comment-in-gerrit-but-no-one-but-me-can-see-it)!

@mbana mbana closed this Apr 18, 2019
@mbana mbana deleted the lsp_error_handling branch April 18, 2019 09:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants