зеркало из https://github.com/golang/tools.git
gopls: avoid panic during interface assertion for nonstandard requests
This commit is contained in:
Родитель
2dba1e4ea0
Коммит
992e818f8a
|
@ -115,8 +115,9 @@ func (s *Server) workDoneProgressCancel(ctx context.Context, params *protocol.Wo
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) nonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error) {
|
func (s *Server) nonstandardRequest(ctx context.Context, method string, params interface{}) (interface{}, error) {
|
||||||
paramMap := params.(map[string]interface{})
|
switch method {
|
||||||
if method == "gopls/diagnoseFiles" {
|
case "gopls/diagnoseFiles":
|
||||||
|
paramMap := params.(map[string]interface{})
|
||||||
for _, file := range paramMap["files"].([]interface{}) {
|
for _, file := range paramMap["files"].([]interface{}) {
|
||||||
snapshot, fh, ok, release, err := s.beginFileRequest(ctx, protocol.DocumentURI(file.(string)), source.UnknownKind)
|
snapshot, fh, ok, release, err := s.beginFileRequest(ctx, protocol.DocumentURI(file.(string)), source.UnknownKind)
|
||||||
defer release()
|
defer release()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче