Skip to content

Generalized 'No such file or directory handling' #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 29, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,13 +360,13 @@ func (handler *InoHandler) handleError(ctx context.Context, err error) error {
return err
}
} else if strings.Contains(errorStr, "No such file or directory") {
exp, regexpErr := regexp.Compile("([\\w\\.\\-]+)\\.h: No such file or directory")
exp, regexpErr := regexp.Compile("([\\w\\.\\-]+): No such file or directory")
if regexpErr != nil {
panic(regexpErr)
}
submatch := exp.FindStringSubmatch(errorStr)
message = "Editor support may be inaccurate because the header `" + submatch[1] + ".h` was not found."
message += " If it is part of a library, use the Library Manager to install it"
message = "Editor support may be inaccurate because the header `" + submatch[1] + "` was not found."
message += " If it is part of a library, use the Library Manager to install it."
} else {
message = "Could not start editor support.\n" + errorStr
}
Expand Down