Skip to content

Conversation

tharun571
Copy link
Contributor

No description provided.

@tharun571 tharun571 marked this pull request as draft May 26, 2024 12:45
@tharun571 tharun571 marked this pull request as ready for review May 26, 2024 12:46
@tharun571
Copy link
Contributor Author

@alexander-penev review please.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@tharun571 tharun571 marked this pull request as draft May 26, 2024 15:32
xcpp::interpreter interpreter((int)Args.size(), Args.data());

std::string code = "foo = a.isal";
Copy link
Collaborator

@alexander-penev alexander-penev May 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For autocomplete to work, we must first execute some code to include the appropriate header file and then attempt to use desired functions. Functions isalnum and isalpha are defined in ctype.h
Тherefore, before the use "complete" function, we must execute this code through the interpreter:
#include <ctype.h>
Something like:
nl::json result = interpreter.execute_request("#include <ctype.h>", /*silent=*/false, ... etc );

However, my experiments showed that maybe there is some problem in the implementation of the "complete" function in CppInterOp, and indeed even with the included library and the code that is appropriate, for example auto i = isal function does not return any suggestions. It is good to add an issue to report the CppInterOp bug.

It's a good idea to try if the test case code works in Jupyter Notebook or Jupyter Console.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried it out in all the platforms and it seems that the code completion is not working for the functions involving importing from the header files. The updated code in this PR shows that it works for normal cases.

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@codecov-commenter
Copy link

codecov-commenter commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.08%. Comparing base (ef0992a) to head (7fd7b2c).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #124   +/-   ##
=======================================
  Coverage   75.08%   75.08%           
=======================================
  Files          17       17           
  Lines         602      602           
  Branches       59       59           
=======================================
  Hits          452      452           
  Misses        150      150           

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@tharun571
Copy link
Contributor Author

tharun571 commented May 27, 2024

@anutosh491 this PR covers #114 but there is a possible bug in CppInterOp. Do you want to close the issue with this simple test case or wait till that bug is resolved?

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@tharun571 tharun571 requested a review from alexander-penev May 28, 2024 06:33
Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

Copy link
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@tharun571 tharun571 marked this pull request as ready for review May 28, 2024 14:23
@vgvassilev
Copy link
Contributor

@alexander-penev, ping.

@vgvassilev
Copy link
Contributor

I am wondering why this did not increase code coverage.

@tharun571
Copy link
Contributor Author

I am wondering why this did not increase code coverage.

It said it has already been covered, but this is the only piece of code calling that function. And also it shows some code has not been covered even when it has been covered. Maybe codecov is not 100% accurate.

@vgvassilev
Copy link
Contributor

We seem to have that coverage here:

def test_codecomplete(self) -> None:

It is good to have it on the other place, too. This explains why we did not see coverage increase.

@vgvassilev vgvassilev merged commit 33ad76a into compiler-research:main May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants