-
Notifications
You must be signed in to change notification settings - Fork 35
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
'Create Table of Contents' code action should not be suggested always #96
Comments
What does |
Thanks for mentioning |
Is it possible that Marsksman could not suggest creating a TOC at all, but instead it is available as an LSP command? If the document had a TOC it could still provide a code action to update it. I think this would be the best solution as most documents don't have a TOC and an LSP command seems a more natural solution? Helix is about to get commands added, and Neovim has them already, I don't know the status in other editors, but it is official LSP spec so it should be available. |
I think that a code action of Custom commands typically require a bit of glue code on the client side so I'm not sure what would be the benefit of that over source code actions. |
@rchl Are you saying that custom commands can't just be called via the client, they need specific code on the client side? If so, that would be bad news. |
LSP servers can only tell clients the command IDs they support (for example Clients could expose command IDs and let users trigger them but that wouldn't be very useful in most cases as many commands require arguments. |
Marksman now supports user- and project-level config. With #109 users who don't care about ToC can disable it globally in their user-config and then re-enable on a project-by-project basis if needed. By default, ToC is enabled but this is something to potentially reconsider in future. Re: using code action's range and context to decide whether to suggest the ToC code action or not -- the problem here is that different editors, different LSP clients and different plugins all behave differently and have their own UI/UX for code actions. I hope that the config option will address 90% of the UX problems with ToC code action (particularly for non-VSCode/non-ST users where LSP clients don't do any filtering of code actions). Closing this issue. It's OK to reopen it though, if somebody feels strongly about it. |
The text was updated successfully, but these errors were encountered: