Skip to content

Commit

Permalink
fix: find gopls if not in path, fixes #895
Browse files Browse the repository at this point in the history
  • Loading branch information
a-h committed Aug 24, 2024
1 parent ad20522 commit c813195
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.771
0.2.773
5 changes: 2 additions & 3 deletions cmd/templ/lspcmd/pls/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,11 @@ func FindGopls() (location string, err error) {
executableName = "gopls.exe"
}

executableName, err = exec.LookPath(executableName)
pathLocation, err := exec.LookPath(executableName)
if err == nil {
// Found on the path.
return executableName, nil
return pathLocation, nil
}

// Unexpected error.
if !errors.Is(err, exec.ErrNotFound) {
return "", fmt.Errorf("unexpected error looking for gopls: %w", err)
Expand Down

0 comments on commit c813195

Please sign in to comment.