vsix

Access current code pane in Visual Studio Extension

穿精又带淫゛_ 提交于 2020-12-29 05:26:26
问题 Im writing a visual studio (2010) extension with a right click menu whilst in a code view. I want to be able to examine the current code from my menu item event handler but havent been able to find somewhere in the object model to do this. How do i access the code in the current window in a visual studio extension? EDIT Heres the code i used to get the current document text DTE dte = Package.GetGlobalService(typeof(DTE)) as DTE ; TextDocument activeDoc = dte.ActiveDocument.Object() as

How can I programmatically examine the stack in my Visual Studio extension?

随声附和 提交于 2020-08-11 18:42:13
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

How can I programmatically examine the stack in my Visual Studio extension?

為{幸葍}努か 提交于 2020-08-11 18:40:04
问题 In a VS extension, assume that the code has just hit a breakpoint, and is in break mode. How can I programmatically examine the stack? Also, is there a way to figure out what the last executed statement was? I haven't been able to find an advanced sample. There are hello-world type samples but they are mostly focused on adding/modifying UI elements in Visual Studio IDE. 回答1: You'll need to hook into the EnvDTE.Events.DebuggerEvents.OnEnterBreakMode event or equivalent to know when the process

How to close/dispose tool window when visual studio solution closed and create/open toolwindow again in an extension

怎甘沉沦 提交于 2020-08-06 06:09:08
问题 I created a tool window inside visual studio extension using https://docs.microsoft.com/en-us/visualstudio/extensibility/adding-a-tool-window?view=vs-2019. I show some documentation in it based on user inputs from the wizard.Ex : User selected Tab, I show Tab related documentation User closed the solution User created another project , He changed the user input Ex : Bot is selected Expected : Bot documentation to be shown Actual : Tab documentation is shown(Tool window content doesn't change)

How to change a ClassificationFormatDefinition

纵然是瞬间 提交于 2020-07-08 00:59:22
问题 My Visual Studio extension (VSIX) is derived from the Ook Language Example (found here). Basically, I have the following ClassificationFormatDefinition with a function loadSavedColor that loads the color the user has configured. Everything works fine. [Name("some_unique_name")] internal sealed class OokE : ClassificationFormatDefinition { public OokE() { DisplayName = "ook!"; //human readable version of the name ForegroundColor = loadSavedColor(); } } Question: After the user has configured a

VSIX - Minor visual studio version

佐手、 提交于 2020-06-13 09:09:08
问题 Does somebody know if/how it is possible to obtain the minor Visual Studio version that is currently running, from within a VSIX extension? I've already found the following property, but we would like to have the more detailed version number (more parts). https://docs.microsoft.com/en-us/dotnet/api/envdte._dte.version?view=visualstudiosdk-2017 回答1: Assuming you may want the level like X.Y.Z instead of X.0 or X.Y . (e.g: VS2017-15.9.13=>15.9=>15.0). Sergey's great answer can help you resolve

Is there a way to add conditions in vsTemplates? or a way to generate output projects based on user selections

纵饮孤独 提交于 2020-05-31 05:42:49
问题 I have a requirement to generate a custom projects template. I am showing the wizard (using vsix project) to the user which has three check boxes in which user can select one or many of them, based on the selection the number of projects need to be created. Suppose user choose one, then output solution must have one project. Suppose user choose any two, then output solution must have those two projects. At Present irrespective of selection three output projects are created. The root

Visual Studio SDK get type modifier information - is type abstract or internal?

百般思念 提交于 2020-04-18 12:35:38
问题 I use the IVsObjectList2.GetCategoryField2 method to retrieve different information of a type. Now I wonder how I can retrieve C# specific information like abstract or internal modifier of a type? The Object Browser can displays this informations. Update 1: I have made another attempt to get this information. Via the DynamicTypeService and the IVsHierarchy (of the project) I can get the TypeResolutionService . This can then return the Type I'm are looking for, and form the Type I get the