refactor: use context for automatic lsp process cleanup

This commit is contained in:
Nacho Vazquez
2025-04-12 12:43:23 -03:00
parent 6fe85c66e7
commit bd2cb4b5b9
3 changed files with 3 additions and 20 deletions

View File

@@ -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()