Skip to content

Commit 4ef3fb6

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 4ef3fb6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Diff for: handler/handler.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -360,13 +360,13 @@ 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."
369-
message += " If it is part of a library, use the Library Manager to install it"
368+
message = "Editor support may be inaccurate because the header `" + submatch[1] + "` was not found."
369+
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
372372
}

0 commit comments

Comments
 (0)