-
Notifications
You must be signed in to change notification settings - Fork 3
[elastic] Move the deps downloading into 'intialize' request handle #79
[elastic] Move the deps downloading into 'intialize' request handle #79
Conversation
internal/lsp/elasticserver.go
Outdated
@@ -215,6 +214,13 @@ func (s ElasticServer) ManageDeps(folders *[]protocol.WorkspaceFolder) error { | |||
} | |||
} | |||
} | |||
for _, folder := range *folders { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this guarded by the downloading deps flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea, will do
b948c72
to
64bd846
Compare
The official option to disable network access is |
64bd846
to
0a0f0d7
Compare
summaryUnder module mode, any standard Code has an option
Test results
Test result of Kubernetes:
The test for https://github.com/prometheus/prometheus got stuck in the end. |
0a0f0d7
to
59b5269
Compare
59b5269
to
62da059
Compare
62da059
to
6b319e4
Compare
@zfy0701 this PR has come to the final stage, for now, the option Related PR: elastic/kibana#43940 |
The original implementation relies on 'go list' to download the deps. And 'go list' will be called by the request handler indirectly. This approach is unpredictable and 'go list' is black box to us. So it's better download the deps manually in 'ManageDeps', i.e. inside 'initialize' request handler. If the client sends the initialize option `installGoDependency: true`, download the deps in `initialize` handler. If the client doesn't send the initialize option `installGoDependency: true`, disable the network access by `GOPROXY=off` and find the deps from vendor folder.
6b319e4
to
097700a
Compare
Note: The index time increase almost 15% than elastic#79
Note: The index time increase almost 15% than #79
The original implementation relies on 'go list' to download the deps.
'go list' is called by other request handler indirectly. This approach
is unpredictable and 'go list' is black box to us. So it's better
download the deps manually in 'ManageDeps', i.e. inside 'initialize'
request handler.