File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change 1
1
package main
2
2
3
3
import (
4
- "errors"
5
4
"flag"
6
5
"fmt"
7
- "io"
8
6
"os"
9
7
10
8
"github.com/microsoft/typescript-go/internal/bundled"
@@ -49,7 +47,7 @@ func runLSP(args []string) int {
49
47
DefaultLibraryPath : defaultLibraryPath ,
50
48
})
51
49
52
- if err := s .Run (); err != nil && ! errors . Is ( err , io . EOF ) {
50
+ if err := s .Run (); err != nil {
53
51
return 1
54
52
}
55
53
return 0
Original file line number Diff line number Diff line change @@ -187,16 +187,17 @@ func (s *Server) Run() error {
187
187
g .Go (func () error { return s .dispatchLoop (ctx ) })
188
188
g .Go (func () error { return s .writeLoop (ctx ) })
189
189
g .Go (func () error { return s .readLoop (ctx ) })
190
- return g .Wait ()
190
+
191
+ if err := g .Wait (); err != nil && ! errors .Is (err , io .EOF ) {
192
+ return err
193
+ }
194
+ return nil
191
195
}
192
196
193
197
func (s * Server ) readLoop (ctx context.Context ) error {
194
198
for {
195
199
msg , err := s .read ()
196
200
if err != nil {
197
- if errors .Is (err , io .EOF ) {
198
- return nil
199
- }
200
201
if errors .Is (err , lsproto .ErrInvalidRequest ) {
201
202
s .sendError (nil , err )
202
203
continue
You can’t perform that action at this time.
0 commit comments