Skip to content
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

Allow to disable supermaven using comments. #100

Open
Shobhit0109 opened this issue Sep 18, 2024 · 5 comments
Open

Allow to disable supermaven using comments. #100

Shobhit0109 opened this issue Sep 18, 2024 · 5 comments

Comments

@Shobhit0109
Copy link

Like we have eslint to disable rule checking , allow supermaven to disable autocomplete in a specific part of code.

eg.
It will not show suggestions in
from line: // disable supermaven
upto line: // enable supermaven

@AlejandroSuero
Copy link
Contributor

There are 3 options to implement this that comes to my mind:

  • Use tree-sitter queries to detect comments and get the value of it.
  • Do a implementation like todo-comments.nvim by the great folke.
  • Run this behaviour at the root (sm-agent) closed source so it will need to be raised to the team.

The first two will need to parse the comment value to check that the value its correct. Then detect if the cursor is between both comments and don't provide suggestions.

Warning

Unless implemented with sm-agent behaviour it will still send the code to be analyzed but will disable the suggestion display behaviour.

If what you want is to not send the code, the best solution will be to wait for the raise of implementation on the agent. Otherwise create a new logic to pause the agent running within the plugin but still listen to document listeners to resume after going out of the comment bounds, but when it resumes it will send the file to get suggestions still.

@Shobhit0109
Copy link
Author

Shobhit0109 commented Sep 20, 2024

I think, we should disable suggestions for a complex logic rather than the extension itself as extension will learn from the code. Therefore, what I suggest is using any of the first 2 mentioned.
We can use another comments type for private code which can be implemented in sm-agent.
Currently no other ai agent is giving this feature, so this can increase trust and productivity.

@AlejandroSuero
Copy link
Contributor

I think I could be possible, would be a good size PR so if @sm-victorw or @super-jacob has something to say about it, to do it or not really. I can maybe start doing it if someone doesn't start it by after the next week.

But as you said I think the first 2 implementations would be the best. Not sure if we can do something like instead of sending the whole buffer, send it but stripped of the sections between comments so it doesn't send that data. But this is something that I don't have a say on that.

Would be nice to be the first AI code copilot to do something like that so ensures more trust and productivity to the users. As they are developing their own editor, it would be a nice feature to implement there if done at plugin level.

Note

One small design aspect I would like to tackle would be the change on how to do the parsing.

i.e.

-- supermaven: disable
local lua_code = "test_code"
-- supermaven: enable

The syntax of supermaven: <action> I think would be a better way to parse in case you are disabling other linters or formatters that use enable <program> so if it finds supermaven: then checks the action, otherwise would skip that part of the logic.

@sm-victorw
Copy link
Collaborator

If there is more demand for this feature it's possible we will look into introducing it in the future, but otherwise I think the plan will be to focus on existing issues/bugs, as there are quite a lot already

@rbuchberger
Copy link

Big +1 for this feature, I'm real tired of my code being called a hack every single time I start a comment. I'm basically paying you to insult me at this point?

Good comments don't explain what you're doing, they explain why, and the AI rarely has the context necessary to provide that information. As a result its suggestions are almost always incorrect and distracting.

image

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

No branches or pull requests

4 participants