mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-24 03:04:21 +01:00
refactor: use context for automatic lsp process cleanup
This commit is contained in:
@@ -48,8 +48,8 @@ type Client struct {
|
||||
openFilesMu sync.RWMutex
|
||||
}
|
||||
|
||||
func NewClient(command string, args ...string) (*Client, error) {
|
||||
cmd := exec.Command(command, args...)
|
||||
func NewClient(ctx context.Context, command string, args ...string) (*Client, error) {
|
||||
cmd := exec.CommandContext(ctx, command, args...)
|
||||
// Copy env
|
||||
cmd.Env = os.Environ()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user