Skip to content

feat: add cursor_data to context#66

Merged
azorng merged 2 commits intoazorng:mainfrom
sudo-tee:main
Jun 17, 2025
Merged

feat: add cursor_data to context#66
azorng merged 2 commits intoazorng:mainfrom
sudo-tee:main

Conversation

@sudo-tee
Copy link
Copy Markdown
Contributor

This PR enhances the prompt context generated by the template engine by including the current cursor position and the content of the line under the cursor.

@azorng
Copy link
Copy Markdown
Owner

azorng commented Jun 13, 2025

Thanks for the PR, this was part of the context some time ago but I removed it because I didn't find it useful and prompts seem to be more effective with less context. If we send cursor data on every prompt, we are giving the llm information that most of the times is not needed, which can impact the focus or the intent of the original query.

If this is really wanted I'm fine adding a context option in config.lua so this behaviour becomes configurable

@sudo-tee
Copy link
Copy Markdown
Contributor Author

This is totally reasonable.

I will update the MR with it as an option.

Thanks

@sudo-tee
Copy link
Copy Markdown
Contributor Author

I added a config for the cursor_data

I also added a quick unit test around the functionality

@azorng
Copy link
Copy Markdown
Owner

azorng commented Jun 17, 2025

awesome, thanks!

@azorng azorng merged commit ada7651 into azorng:main Jun 17, 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.

2 participants