@@ -126,28 +126,28 @@ func NewInoHandler(stdio io.ReadWriteCloser, board lsp.Board) *InoHandler {
126
126
},
127
127
}
128
128
handler .clangdStarted = sync .NewCond (& handler .dataMux )
129
- stdStream := jsonrpc2 .NewBufferedStream (stdio , jsonrpc2.VSCodeObjectCodec {})
130
- var stdHandler jsonrpc2.Handler = jsonrpc2 .HandlerWithError (handler .HandleMessageFromIDE )
131
- handler .StdioConn = jsonrpc2 .NewConn (context .Background (), stdStream , stdHandler ,
132
- jsonrpc2 .OnRecv (streams .JSONRPCConnLogOnRecv ("IDE --> LS CL:" )),
133
- jsonrpc2 .OnSend (streams .JSONRPCConnLogOnSend ("IDE <-- LS CL:" )),
134
- )
135
129
136
130
if buildPath , err := paths .MkTempDir ("" , "arduino-language-server" ); err != nil {
137
131
log .Fatalf ("Could not create temp folder: %s" , err )
138
132
} else {
139
133
handler .buildPath = buildPath .Canonical ()
140
134
handler .buildSketchRoot = handler .buildPath .Join ("sketch" )
141
135
}
142
-
143
- handler .progressHandler = NewProgressProxy (handler .StdioConn )
144
-
145
136
if enableLogging {
146
137
log .Println ("Initial board configuration:" , board )
147
138
log .Println ("Language server build path:" , handler .buildPath )
148
139
log .Println ("Language server build sketch root:" , handler .buildSketchRoot )
149
140
}
150
141
142
+ stdStream := jsonrpc2 .NewBufferedStream (stdio , jsonrpc2.VSCodeObjectCodec {})
143
+ var stdHandler jsonrpc2.Handler = jsonrpc2 .HandlerWithError (handler .HandleMessageFromIDE )
144
+ handler .StdioConn = jsonrpc2 .NewConn (context .Background (), stdStream , stdHandler ,
145
+ jsonrpc2 .OnRecv (streams .JSONRPCConnLogOnRecv ("IDE --> LS CL:" )),
146
+ jsonrpc2 .OnSend (streams .JSONRPCConnLogOnSend ("IDE <-- LS CL:" )),
147
+ )
148
+
149
+ handler .progressHandler = NewProgressProxy (handler .StdioConn )
150
+
151
151
go handler .rebuildEnvironmentLoop ()
152
152
return handler
153
153
}
0 commit comments