You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR addresses several integration issues across different IDE environments (Antigravity, Cursor, and VS Code) to ensure AI agent chat features and custom agent skills trigger and sync correctly. It also improves compatibility with official LeetCode submission extensions.
Changes Made
Cross-IDE Chat Integration (src/extension.ts):
Refactored openChatWithPrompt to reliably trigger the chat panel across environments.
Fixed an issue in Antigravity where the chat wouldn't open by routing it through the native antigravity.sendPromptToAgentPanel command.
Improved clipboard paste fallbacks for environments where direct query passing isn't supported.
AI Agent Skill Syncing (CursorLcexPluginInstall.ts):
Expanded the agent rule installer to automatically sync customized LeetCode skills across IDE formats:
Added standard @lc app=leetcode, @lc code=start, and @lc code=end metadata comments to the generated solution templates. This allows the official LeetCode VS Code extension (or browser extensions) to recognize the file for submission.
Documentation (README.md):
Added a "Known Limitations" note detailing that Cloudflare 403s block automated remote submissions and officially recommending the use of native LeetCode extensions for final submissions. Additional Feature: Fallback Editor Matching for Code Execution
Enhanced executeCode() (in ProblemView.ts) to gracefully fall back if the currently active tab isn't a supported language file (e.g., if you are currently reading the problem description Markdown file).
It now scans through other visible editor tabs to find a solution file matching the problem slug. This allows you to click the "Run" or "Submit" buttons from the problem view without needing to manually focus your code tab first.
Thanks for this one, the chat integration restructure, the @lc template markers, and the README note are all solid, and the branch builds cleanly. There is one blocking issue and two risky behaviors I would like addressed before merge.
Blocking
The skill sync silently overwrites files in the user's project.ensureCursorLcexPluginInstalled() now writes .agents/skills/* and .github/copilot-instructions.md into the workspace root on every activation. writeIfDifferent overwrites when content differs, and copilot-instructions.md is a file many real projects already have, so anyone opening a .leetcode workspace that also uses Copilot gets their instructions clobbered with no prompt and no opt-out. It also only handles workspaceFolders[0] and does not verify that folder contains the .leetcode marker. Please gate the workspace-level sync behind a config flag (default off), never replace a pre-existing file the extension did not create (append a clearly marked section, or skip with a warning), and target the folder that actually has the marker.
Risky
The executeCode fallback can run or submit the wrong file. The slug-match stage in ProblemView.ts is a good idea, but the second stage falls back to any visible editor with a supported extension. Clicking Run on problem X while a solution for problem Y is visible would silently execute Y's code against X. Please keep the slug match and drop the any-editor fallback.
Chat command ordering may regress Cursor.workbench.action.chat.open is now tried before aichat.newchat and cursor.chat.new. If Cursor registers that command, it will "succeed" and be treated as auto-submitted, so the Cursor-native path is never reached. Please confirm the Ask Agent flow still works in Cursor with this ordering, or keep the Cursor commands first.
Minor
The committed .agents/skills/* and .github/copilot-instructions.md files are generated artifacts of the sync code and will drift from the constants in CursorLcexPluginInstall.ts; I would gitignore them instead of committing them.
submitted in openChatWithPrompt is assigned but never read.
activate() gained stray blank lines and a debug log that should be tidied.
Happy to merge once the blocking item is resolved and the Cursor flow is confirmed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR addresses several integration issues across different IDE environments (Antigravity, Cursor, and VS Code) to ensure AI agent chat features and custom agent skills trigger and sync correctly. It also improves compatibility with official LeetCode submission extensions.
Changes Made
src/extension.ts):openChatWithPromptto reliably trigger the chat panel across environments.antigravity.sendPromptToAgentPanelcommand.CursorLcexPluginInstall.ts):.agents/skills/.github/copilot-instructions.md.cursor/rules/TemplateEngine.ts):@lc app=leetcode,@lc code=start, and@lc code=endmetadata comments to the generated solution templates. This allows the official LeetCode VS Code extension (or browser extensions) to recognize the file for submission.README.md):Additional Feature: Fallback Editor Matching for Code Execution
executeCode()(inProblemView.ts) to gracefully fall back if the currently active tab isn't a supported language file (e.g., if you are currently reading the problem description Markdown file).