Skip to content

Commit d275b0a

Browse files
author
Akos Kitta
committed
Generalized 'No such file or directory handling'
- Removed the `.h` literally match from the regexp. - Let the submatch handle the `.h` suffix. Closes #30. Signed-off-by: Akos Kitta <[email protected]>
1 parent 580d370 commit d275b0a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: handler/handler.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -360,12 +360,12 @@ func (handler *InoHandler) handleError(ctx context.Context, err error) error {
360360
return err
361361
}
362362
} else if strings.Contains(errorStr, "No such file or directory") {
363-
exp, regexpErr := regexp.Compile("([\\w\\.\\-]+)\\.h: No such file or directory")
363+
exp, regexpErr := regexp.Compile("([\\w\\.\\-]+): No such file or directory")
364364
if regexpErr != nil {
365365
panic(regexpErr)
366366
}
367367
submatch := exp.FindStringSubmatch(errorStr)
368-
message = "Editor support may be inaccurate because the header `" + submatch[1] + ".h` was not found."
368+
message = "Editor support may be inaccurate because the header `" + submatch[1] + "` was not found."
369369
message += " If it is part of a library, use the Library Manager to install it"
370370
} else {
371371
message = "Could not start editor support.\n" + errorStr

0 commit comments

Comments
 (0)