vspackage

how to update Visual Studio UI when using DynamicItemStart inside a vsix package

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 07:46:12
问题 I'm implementing a DynamicItemStart button inside a Menu Controller. I'm loading the dynamic items for this button when Visual Studio starts. Everything is loaded correctly so the initialize method is called an I see all the new items in this Dynamic button. After the package is completely loaded I want to add more items to this Dynamic button, but since the package is already loaded the initialize method is not called again and I cannot see the new items in this Dynamic button. I only see

GetClassificationSpans in Visual Studio 2015 doesn't return anything

笑着哭i 提交于 2019-12-23 13:39:36
问题 I have a tagger (subclass of ITagger) and I'm trying to call GetClassificationSpans so I can use the classifications to find comments to format using tags. This worked in Visual Studio 2013, but now when running it in Visual Studio 2015, GetClassificationSpans always returns an empty list - even when I've examined the span in the debugger and it is definitely passing a span with a comment in it. Does anyone know what could have changed in 2015 in regards to calling GetClassificationSpans? BTW

How to notify the editor about document changes

和自甴很熟 提交于 2019-12-23 05:25:07
问题 I work on a custom project system and I have an issue with renaming items. The project system implementation is based on MPF and renaming items via the solution explorer worked more or less without any problems, but... When an item gets renamed, I also update information which are stored in the file itself. In case the document is opened by the code editor, the text in the editor doesn´t get refreshed (only the document window´s caption changes to the new filename). If I save the open

How to refresh Visual Studio settings after setting a value in a VSPackage

偶尔善良 提交于 2019-12-22 08:22:30
问题 In a Visual Studio extension I have defined a VSPackage with a number of commands in it. In the handler for one of the commands, I set a user setting using the following code: SettingsManager settingsManager = new ShellSettingsManager(this); WritableSettingsStore userSettingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); userSettingsStore.SetBoolean("Text Editor", "Visible Whitespace", true); This successfully sets the value in the registry (at HKEY_CURRENT_USER

Create Visual Studio Theme Specific Syntax Highlighting

大憨熊 提交于 2019-12-21 09:17:17
问题 I would like to create a Syntax Highlighter in Visual Studio 2012 (and above) that supports different themes (Dark, Light, Blue). Visual Studio's Editor Classifier project template explains how to create your own colors in the environment using Microsoft.VisualStudio.Text.Classification.ClassificationFormatDefinition . It works fine... ... until you realize that there are different themes in Visual Studio 2012 (and above) and you don't really support them. Your pretty dark blue colored

How to Get Project Type Guid of selected project in the Solution Explorer by using VS Package

江枫思渺然 提交于 2019-12-19 10:32:38
问题 I've created the simple VS Package for adding new item in the context menu of solution explorer. In that I need to check Selected Project's Project Type GUID. How can i get this. For example, One Solution contains the three different type of projects, like WindowFormsApplication, MVC Projects,WebApplication. While select the MVC Projects, we need to get that ProjectType GUID. I've tried the followings in my Package.cs, IVsMonitorSelection monitorSelection = (IVsMonitorSelection)Package

How to Get Project Type Guid of selected project in the Solution Explorer by using VS Package

雨燕双飞 提交于 2019-12-19 10:32:08
问题 I've created the simple VS Package for adding new item in the context menu of solution explorer. In that I need to check Selected Project's Project Type GUID. How can i get this. For example, One Solution contains the three different type of projects, like WindowFormsApplication, MVC Projects,WebApplication. While select the MVC Projects, we need to get that ProjectType GUID. I've tried the followings in my Package.cs, IVsMonitorSelection monitorSelection = (IVsMonitorSelection)Package

Detect current VSIX package's version from code

允我心安 提交于 2019-12-19 10:15:12
问题 I am writing a VSIX project and I would like for the code to be able to determine whether an update is available. I know Visual Studio would be able to check for the update, however, I would like for the extension to be able to prompt user (developer) more verbosely. I wonder how could make the extension read its own version from the package manifest? Thank you. 回答1: I found that I could read the version information directly from the manifest XML file. var doc = new XmlDocument(); doc.Load

VSIX Project Context Menu

妖精的绣舞 提交于 2019-12-19 09:26:34
问题 I'm trying to create a Visual Studio 2017 extension, just for fun and to learn how VS extensibility works. My extension must be usable from the Solution Explorer tab as a context menu button, but I would like to include it at a menu level that isn't root. My goal is to put it in the "Add" sub-menu, but at the moment I'm only able to put it at root level (when you right-click the Project item, the menu entry is shown as the last of the context menu control). How can I move it under the "Add"

How do I programmatically refresh/reload a VS project after modifying the underlying file?

痴心易碎 提交于 2019-12-19 03:23:15
问题 I am developing a Visual Studio package and I have written some code that will make a file in Solution Explorer dependant upon another file. What this means is that it gives them the same relationship as code-behind files or designer files, where they appear nested under the parent file with a plus/minus icon. + MainForm.cs - MainForm.cs MainForm.Designer.cs MainForm.resx The code that I have written successfully and correctly modifies the underlying project file, however the change is not