-
Notifications
You must be signed in to change notification settings - Fork 128
Don't show code lenses for code with compilation errors #2511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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.
Close. a couple more comments
formatting checks failed |
Fixed the formatting issues by running |
Can you run all the checks and tests? you broke clippy |
Fixed clippy warnings by consolidating duplicate match arms that all returned |
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.
Looks like the code generated is overly complex and modifies dependencies unnecessarily. As Dmitry pointed out, it's also missing unit tests for project errors.
5d6ccd2
to
522da68
Compare
OK, simplified the code, everyone can breathe a sigh of relief now |
Code lenses (Run, Histogram, Estimate, Debug, Circuit) require executing the program, but a program will never successfully execute if it has compilation or project errors. This PR prevents these code lenses from being shown when there are errors that would block execution.
Changes
get_code_lenses()
to check for blocking compilation errors before returning code lensesExample
Before this fix, code with compilation errors would still show code lenses:
The "Run" code lens would appear but clicking it would just result in an error. Now, no code lenses are shown when compilation errors are present.
Testing
Added comprehensive test
no_code_lenses_with_compilation_errors
that verifies code lenses are properly blocked when frontend compilation errors are present. All existing tests continue to pass, ensuring backward compatibility.Fixes #2510.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.