roslyn - Visual Studio vsix package for custom command, similar to "Go To Definition" (F12) -


my company wants custom command in visual studio behave rather go definition (f12) feature (from context menu in code editor window), in order navigate specific implementation of method inside solution.

so created vsix package sample on git hub , added custom command item, , tweak .vsct shows new navigation item in context menu along other items ('quick actions , refactorings', 'copy', 'paste', etc.). part ok.

question 1 : in call of command how can retrieve syntax , symbol classes piece of code under carret of code editor window ? object sender , eventargs e parameters looks inacurate needs. :/

question 2 : using code analysis , compiler api features, how analyse semantics , jumps right file , and class through solution ? there samples of code analyse "jump to" functionality ?

any tutorials, samples or recommandations welcome.

call getopendocumentincurrentcontextwithchanges() extension method (in microsoft.codeanalysis.editorfeatures.text.dll) on itextsnapshot roslyn document.

you can use normal roslyn apis semantic model, resolve symbols, examine syntax tree, etc.

example


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -