Skip to content

Conversation

@ghost
Copy link

@ghost ghost commented Apr 9, 2025

Description

Closes #4838

This PR addresses an issue where the context menu functionality in VSCode wasn't respecting the rules and systemMessage configurations from the user's config.yaml file.

Problem

Previously, when a user highlighted code, right-clicked to open the context menu, and selected an option like "Write comments for the code", the system would ignore any rules or systemMessage settings from the config.yaml file. This created inconsistent behavior between the main Continue interface and the context menu functionality.

Solution

The fix modifies the streamInlineEdit function in commands.ts to:

Extract the context menu prompt text
Include the systemMessage from config.yaml at the beginning of the prompt
Append all rules from config.yaml directly into the prompt text sent to the language model
This approach ensures that any configuration settings (language preferences, coding styles, response formats, etc.) specified in the config.yaml file are consistently applied across all Continue.dev interfaces, including the context menu.

Checklist

  • [] The relevant docs, if any, have been updated or created
  • [] The relevant tests, if any, have been updated or created

Screenshots

Before

You can see its generating in English even though I mentioned to use Hindi.

Screen.Recording.2025-04-10.at.02.03.54.mov

After

Now its respecting the yaml config and the context-menu actions are utilizing the config rules.

Screen.Recording.2025-04-10.at.02.10.04.mov

Testing instructions

[ For new or modified features, provide step-by-step testing instructions to validate the intended behavior of the change, including any relevant tests to run. ]

@ghost ghost self-requested a review as a code owner April 9, 2025 20:54
@ghost ghost requested review from tomasz-stefaniak and removed request for a team April 9, 2025 20:54
@netlify
Copy link

netlify bot commented Apr 9, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 73c8586
🔍 Latest deploy log https://app.netlify.com/sites/continuedev/deploys/67f6de701cc51b0008e963ca

@Patrick-Erichsen Patrick-Erichsen requested review from Patrick-Erichsen and RomneyDa and removed request for tomasz-stefaniak April 18, 2025 16:56
Copy link
Collaborator

@Patrick-Erichsen Patrick-Erichsen 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 catching the buggy behavior here!

I'm not sure if these are the right places to introduce the fix however. Both streamInlineEdit and constructPrompt are used in a number of places outside of handling the right-click menu options.

@RomneyDa I feel like you might have some context here, is there a better place to be including rule contents when a user uses the right-click menu?

@RomneyDa
Copy link
Collaborator

@0x23d11 thank you for the contribution, this was fixed with a different approach along with some rules data/architecture changes on this PR
#5104
Commit here c277890

Thanks!

@RomneyDa RomneyDa closed this Apr 25, 2025
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.

Rules in config.yaml does not apply to the four commands in the right-click submenu

2 participants