Currently, I am attempting to create a language server for generating and saving an image from a custom language (similar to plantUML). I want to be able to define multiple diagrams in one file, and as such I was wondering if it is possible for a vscode language server extension to make a context menu item appear only when the cursor is focused on the name of the diagram.
I believe this would have to performed with a custom when clause, however this must be done client-side, and I cannot figure out if there is some way for me to force the client to perform this check every time the cursor is moved. Currently, I have only figured out how to detect the cursor location on activation.
I have also thought about using one of the current requests sent to the language server (such as go to definition), and using this instead to run my command, however I would prefer to add my own context menu item if possible.
Is there a way for me to get the client to check the cursor location every time it is moved, so that I can use this to update a when clause? Or is there a different workaround so that I can get the context menu item to appear only on certain words?
my menu contribution to the package.jsonmy current activate function
Many thanks for any help/ideas, and please let me know if I can provide further explanation.
Cassandra Braun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.