Answered by
ghost
Mar 27, 2025
Replies: 1 comment
|
I ended up giving up on this specific feature, I just created a command where I prompt the user to the Options -> CodeLens menu and hope that the user is smart enough to disable the codelenses of my extension, in case they want that. The code looks very much like this:
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

I ended up giving up on this specific feature, I just created a command where I prompt the user to the Options -> CodeLens menu and hope that the user is smart enough to disable the codelenses of my extension, in case they want that.
The code looks very much like this:
public async Task ShowCodeLensMenuAsync() { await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync(); var dte = Package.GetGlobalService(typeof(DTE)) as DTE; EnvDTE.Commands commands = dte.Commands; dte.ExecuteCommand("EditorContextMenus.CodeLens.CodeLensOptions"); }