File tree 1 file changed +6
-7
lines changed
1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -81,10 +81,11 @@ func (s *Serve) Run(ctx context.Context, args ...string) error {
81
81
return s .forward ()
82
82
}
83
83
84
- // For debugging purposes only.
85
- run := func ( ctx context. Context , srv * lsp. Server ) {
86
- go srv . Run ( ctx )
84
+ prepare := func ( ctx context. Context , srv * lsp. Server ) * lsp. Server {
85
+ srv . Conn . AddHandler ( & handler {})
86
+ return srv
87
87
}
88
+ run := func (ctx context.Context , srv * lsp.Server ) { go prepare (ctx , srv ).Run (ctx ) }
88
89
if s .Address != "" {
89
90
return lsp .RunServerOnAddress (ctx , s .app .cache , s .Address , run )
90
91
}
@@ -96,7 +97,7 @@ func (s *Serve) Run(ctx context.Context, args ...string) error {
96
97
stream = protocol .LoggingStream (stream , out )
97
98
}
98
99
ctx , srv := lsp .NewServer (ctx , s .app .cache , stream )
99
- return srv .Run (ctx )
100
+ return prepare ( ctx , srv ) .Run (ctx )
100
101
}
101
102
102
103
func (s * Serve ) forward () error {
@@ -119,9 +120,7 @@ func (s *Serve) forward() error {
119
120
return <- errc
120
121
}
121
122
122
- type handler struct {
123
- out io.Writer
124
- }
123
+ type handler struct {}
125
124
126
125
type rpcStats struct {
127
126
method string
You can’t perform that action at this time.
0 commit comments