зеркало из 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) {
|
||||
paramMap := params.(map[string]interface{})
|
||||
if method == "gopls/diagnoseFiles" {
|
||||
switch method {
|
||||
case "gopls/diagnoseFiles":
|
||||
paramMap := params.(map[string]interface{})
|
||||
for _, file := range paramMap["files"].([]interface{}) {
|
||||
snapshot, fh, ok, release, err := s.beginFileRequest(ctx, protocol.DocumentURI(file.(string)), source.UnknownKind)
|
||||
defer release()
|
||||
|
|
Загрузка…
Ссылка в новой задаче