Skip to content

Fix documentation lookup#460

Merged
JohanMabille merged 2 commits intocompiler-research:mainfrom
mcbarton:main
Mar 18, 2026
Merged

Fix documentation lookup#460
JohanMabille merged 2 commits intocompiler-research:mainfrom
mcbarton:main

Conversation

@mcbarton
Copy link
Collaborator

@mcbarton mcbarton commented Mar 16, 2026

Closes #456

The reason you couldn't look up some of these pieces of documentation in cppreference was due to 2 issues. One is that you need to look up something according to its name in the tag file (e.g. you search for sort and not std::sort). This requires no changes to xeus-cpp. The other issue with documentation lookup, is that it only currently looks for something equal to whatever was after the ? and ignores anything after a space occurs. e.g. ?move, ?move (utility) and ?move (algorithm) will look up the same thing in the cppreference tagfile (i.e move). Once I knew the second bug, I worked with chatgpt, and found the following one line diff to fix the documentation issue. Images below are just to show it working.

image image image image

@codecov-commenter
Copy link

codecov-commenter commented Mar 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.28%. Comparing base (b72097a) to head (53d9e2d).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #460   +/-   ##
=======================================
  Coverage   80.28%   80.28%           
=======================================
  Files          21       21           
  Lines         847      847           
  Branches       78       78           
=======================================
  Hits          680      680           
  Misses        167      167           
Files with missing lines Coverage Δ
src/xinspect.cpp 91.89% <100.00%> (ø)
Files with missing lines Coverage Δ
src/xinspect.cpp 91.89% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions
Copy link
Contributor

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

Copy link
Collaborator

@JohanMabille JohanMabille left a comment

Choose a reason for hiding this comment

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

Thanks for the fix! Can you add a test after this one to check that the interpreter correctly finds the documentation for move (utility) for instance?

Also what does happen if someone wrongy types ?std::vector push_back ?

@mcbarton
Copy link
Collaborator Author

mcbarton commented Mar 17, 2026

?std::vector push_back ?

@JohanMabille thanks for the review. I'll look into writing a test tomorrow, and ping you when its ready.

I'm not sure what is wanted if someone executes ?std::vector push_back ?, but on xeus-cpps current main and this PR you get the documentation for std::vector. What would you expect/want to happen?

@mcbarton
Copy link
Collaborator Author

mcbarton commented Mar 17, 2026

Added 2 tests fetch_documentation_move_algorithm and fetch_documentation_move_utility. This checks we can differentiate between the 2.

I feel someone executing ?std::vector push_back ? is a different issue, and you currently get with this PR the same as what you get on main.

@mcbarton mcbarton requested a review from JohanMabille March 17, 2026 16:45
@github-actions
Copy link
Contributor

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

@JohanMabille
Copy link
Collaborator

What would you expect/want to happen?

Since this PR allows to parse what comes after a space, I was wondering if we would get an error, or if there was an additional matching pattern for finding the tag.

@JohanMabille
Copy link
Collaborator

Ok let's get this one in!

@JohanMabille JohanMabille merged commit 569e5d7 into compiler-research:main Mar 18, 2026
31 of 44 checks passed
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.

[BUG] : Can't fetch documentation for std::sort, std::move, std::copy etc etc

3 participants