Skip to content

Add cursor position to chat request #5562

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

Open
wants to merge 13 commits into
base: feature/q-lsp-chat
Choose a base branch
from

Conversation

manodnyab
Copy link
Contributor

Description

Add selected character position to chat request

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@manodnyab manodnyab requested review from a team as code owners April 11, 2025 08:51
Copy link

Qodana Community for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked
☁️ View the detailed Qodana report

Contact Qodana team

Contact us at [email protected]


fun getCursorState(project: Project): CursorState? {
return runReadAction {
val editor = FileEditorManager.getInstance(project).selectedTextEditor ?: return@runReadAction null
Copy link
Contributor

Choose a reason for hiding this comment

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

let's make this a util because i think we might need a slightly different implementation for remote

val endLine = document.getLineNumber(endOffset)
val endColumn = endOffset - document.getLineStartOffset(endLine)

return@runReadAction CursorState(
Copy link
Contributor

Choose a reason for hiding this comment

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

please see FocusAreaContextExtractor and determine if we need to port the logic or if the cursor state is sufficient

Base automatically changed from manodnyb/setupChatComponentsWithFlare to feature/q-lsp-chat April 11, 2025 20:05
@manodnyab manodnyab changed the base branch from feature/q-lsp-chat to manodnyb/addQuickActions April 17, 2025 00:27
Base automatically changed from manodnyb/addQuickActions to feature/q-lsp-chat April 21, 2025 06:03
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.

2 participants