-
Notifications
You must be signed in to change notification settings - Fork 31
Replace std::regex in codecomplete to use llvm::regex #424
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
// remove <# #> to keep only the type | ||
r = std::regex_replace(r, std::regex("\\<\\#([^#>]*)\\#\\>"), "$1"); | ||
r = removeTags.sub("$1", r, &error); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we check the error
variable and fail if there is something in it?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #424 +/- ##
=======================================
Coverage 70.96% 70.96%
=======================================
Files 9 9
Lines 3541 3541
=======================================
Hits 2513 2513
Misses 1028 1028
|
clang-tidy review says "All clean, LGTM! 👍" |
lib/Interpreter/Compatibility.h
Outdated
@@ -163,17 +166,45 @@ inline void codeComplete(std::vector<std::string>& Results, | |||
std::vector<std::string> results; | |||
size_t column = complete_column; | |||
I.codeComplete(code, column, results); | |||
std::string error; | |||
llvm::Error Err; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
llvm::Error Err; | |
llvm::Error Err = llvm::Error::success(); |
clang-tidy review says "All clean, LGTM! 👍" |
clang-tidy review says "All clean, LGTM! 👍" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@alexander-penev We ran into an issue with torchlib that is triggered by the loading of
std::regex
. I have replaced the usage withllvm::Regex
that fi xes it. Can you verify if this works with your usecases when developing the feature? The unittests for codecomplete pass but I am not sure if it is extensive enough..