microsoft / vssdk-extensibility-samples Goto Github PK
View Code? Open in Web Editor NEWSamples for building your own Visual Studio extensions
Home Page: http://aka.ms/extendvs
License: MIT License
Samples for building your own Visual Studio extensions
Home Page: http://aka.ms/extendvs
License: MIT License
Intra-Text Adornment's README.md looks like it was copy/pasted from somewhere and spacing errors were never resolved.
When you follow the directions and F5 or start debugging, an error shows up
visual studio cannot start debugging because the debug target c:\program files\something something\ide\devenv.exe is missing
Error message in description
It runs
To fix this for yourself, open the project properties and go to the debug tab. There is a Start Action that has the start external program value set incorrectly (for some). Change that to where you have vs installed.
No documentation is available on MSDN :(
Could you please show us some examples on writing extensions for the SQL Server Management Studio 2016?
Could we reuse the already opened connection within the extension in SSMS?
I have attempted to use WPFDesigner_XML
sample to create my own editor.
Edit as per below comment: However for some reason I can't fathom, I have noticed that when the xml file does not have an xml declaration at the top, then the method that Format's the buffer, and specifically the call to ReformatSpan
throw's an exception Value does not fall within the expected range
How do we work around the xml file not having an xml declaration?
The project currently doesn't build due to a missing project file for 'IronPython.EditorExtensions'.
There are also numerous files using types from the IronPython.Hosting namespace, but I cannot find any types defined in that namespace.
The sample "Ook_Language_Integration" has problems with the intellisense when the cursor is placed in a virtual space. The triggerPoint that is obtained with session.GetTriggerPoint(snapshot)
is set back to the non-virtual position before the cursor (and as far as I know, SnapshotPoint can only represent non-virtual positions) which leads to a wrongly positioned intellisense window:
I have the same problem in my own language integration extension and don't know how to fix this.
It seems that Visual Studio intercepts InputBindings, if they're mapped in Visual Studio. I've added two mappings to Ctrl+R and Ctrl+S (Reload and Save). I've tried adding them to the UserControl and to a child element; in both scenarios VS intercepts.
It works if I use a key combination that isn't used by VS.
So, how can my Extension/UserControl get the input instead/first?
Inside a DeployProvider I'm using this to get the version of the referenced assemblies:
reference.Metadata.GetEvaluatedPropertyValueAsync("Version")
being reference
an IAssemblyReference
this used to work a few versions back, but now it returns an empty string... anyone know if this has changed ?
The above is returning an empty string.
Should be returning the version information in the appropriate format: "1.2.3.4"
Missing ICO files that are in the dropdown
Can't build the solution because of the missing ico files - that aren't even selected...
Missing ico files should not stop you from building a solution.
Is it possible to access the Visual Studio graphical resources (toolbar icons, ...) when creating your own WPF UserControl / ToolWindow?
Update
Found "Visual Studio Image Library" here:
https://www.microsoft.com/en-us/download/details.aspx?id=35825
I try running the WPFDesigner_XML example in Visual Studio 2017. However I am not able to run this sample. After changing the .NET version and adding prerequisites to the vsix manifest, I get a build error on the reference Microsoft.VisualStudio.XmlEditor (it cannot find this reference).
I don't find this assembly anywhere in "Add Reference" window nor on Nuget.
I need to display some markers next to files in VS solution explorer (As in the image link below). I have gone through the VS SDK documentation and there are no references in this specific requirement. Is this possible in current SDK?
Thanks-
LSP client fails to initialize if the "Visual C++ package" isn't installed. Whether the current behaviour is the correct behaviour, and more requirements should be listed on readme.md, or a functional issue is not clear to me.
.foo
filesThe file opens in a text editor. Nothing else happens.
The mock language server UI appears.
which sample shows how to create custom project type ?
Is it possible to register a SingleFileGenerator VSIX for a Python project using the CodeGeneratorRegistration attribute?
When saving the XML file in the Python project nothing happens.
When saving the XML file in Python projects a python file is generated and added to the project
After creating new VSIX Project and changing target framework to .NET Framework 4.0 I'm unable to add new item to project. After right clicking on project name, selecting Add > New item I get this dialog (no items to select from):
As described above
I can't add Toolbox Control when targeting .NET Framework 4.0.
The only way to get this working is to change target framework to 4.5 (after doing that I see Windows Forms Toolbox Control), but I must target 4.0.
I want to use Visual Studio 2017 to create VSIX with my custom controls that target .NET 4.0.
I have some legacy projects (targeting .NET 4.0) in which I want to use my custom controls. I need VSIX to install them into Toolbox.
If a source file starts with "" , Visual Studio thinks it's an XML file and there is no syntax highlight nor IntelliSense.
.csproj file is missing, can't load the solution properly
Solution becomes unavailable
Load the solution file without any errors and be easily built.
It would be great to have an example on how to properly get the fonts and colors settings and subscribe to changes :)
Hi,
I cannot run the WPFDesigner_XML correctly.
When I changed a property the call of
_xmlLanguageService = Marshal.GetObjectForIUnknown(ptr) as LanguageService;
return null in ViewModel.GetXmlLanguageService method.
Thanks a lot,
Geotinc
I just cloned the generator sample, followed the steps in the README but in the launched VS instance I always get the warning that the Custom Tool is "not on the system". Any ideas what I am doing wrong?
The basic SCC sample works the first time I run it, but the second time I try, no tool window pops up, and I can't see anything under "Tools->Options, Source Control->Plug-in Selection" for the SCC pluigin anymore.
Covered above.
To be able to repeatedly iterate without having to copy/paste the project each time.
Visual Studio 2017
VSSDK
I am developing a VSIXProject for my assembly.I want to highlight the function my assembly implement and show a tooltip when mouse hover. And search all references of my assembly from solution.
Can i get code references,namespace,classname or other judgment basis from IQuickInfoSource.AugmentQuickInfoSession and ITagger.GetTags?
Is there any service could achieve my require?
How to import services in those case?
Thanks a lot.
Trying to debug the TypingSpeed sample results in the following error:
error MSB4018: The "GetDeploymentPathFromVsixManifest" task failed unexpectedly.
error MSB4018: System.ArgumentNullException: Value cannot be null.
error MSB4018: Parameter name: path1
error MSB4018: at System.IO.Path.Combine(String path1, String path2)
error MSB4018: at Microsoft.VsSDK.Build.Tasks.ExtensionManagerUtilities.GetSettingsManagerForDevenv(String rootSuffix)
error MSB4018: at Microsoft.VsSDK.Build.Tasks.GetDeploymentPathFromVsixManifest.Execute()
error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext()
I get the error above and am unable to debug the sample extension.
It should launch the experimental VS instance with the sample extension installed and the debugger attached.
I want to write an extension to open automatically the CSS
file related to a LESS
or SASS
file in a new vertical tab group. It should create a new tab group if there is not any or use it if there is an existing tab group.
void DoIt()
{
var dte2 = ((IServiceProvider)package).GetService(typeof(SDTE)) as EnvDTE80.DTE2;
var currentActiveWindow = dte2.ActiveWindow;
if (!IsItALessOrSassFile())
return;
var item = dte2.Solution.FindProjectItem(GetTheCssFileNameOfTheCurrentFile());
item = item ?? throw new Exception();
if (item.IsOpen)
return;
var window = item.Open();
// I could not find any property or method to force the window to be opened in a new tab group.
window.Activate();
window.Document.ReadOnly = true;
currentActiveWindow.Activate();
}
I mean the result should be somthing like this.
Also went through the steps in this youtube video: https://youtu.be/pY5uitIIbkA
CaratFishEye and DiffClassifier are missing their vsixmanifest.
For the single file generator extension, why do you not start with the implementation of BaseCodeGeneratorWithSite in Microsoft.VisualStudio.TextTemplating.VSHost.15.0 assembly?
Also your sample doesn't register the file extension for our custom tool, an extra attribute is necessary for that to occur:
[CodeGeneratorRegistration(typeof(XmlClassGenerator), "XmlClassGenerator", vsContextGuids.vsContextGuidVCSProject, GeneratesDesignTimeSource = true, GeneratorRegKeyName = ".xml")]
The default brushes used is the blue theme. The project template created UserControl has the following as a hint, but it's still not the right color:
Background="{DynamicResource VsBrush.Window}"
Foreground="{DynamicResource VsBrush.WindowText}"
However, specifying that for every control becomes quite tedious, isn't there a better way? A "global" style binding?
I'm trying to style the Toolbar and I can't seem to change the overflow arrow's color. It's currently blue while the rest of the Toolbar uses the specified brush.
I'm struggling on styling controls for an extension I'm working so they follow exactly what is in VS...
For example: how do I style properly this Action control on Pending Changes view of Team Explorer?
I think the examples should provide more comprehensive styling examples...
Anyways: thanks for what is available now. 👍
Hi,
I know there is a sample that deals with extending the solution explorer by adding a custom button here https://msdn.microsoft.com/en-us/library/bb166773.aspx.
What I haven't been able to find (perhaps it's my own poor googling skills) is something that captures keystrokes in the solution explorer. I believe the "Microsoft.VisualStudio.Text.Edtior.KeyProcessor" only captures keystrokes in the actual text window. It doesn't seem to be firing when I type keys with the solution explorer selected.
Basically, what I am trying to do is, if the user presses "j" I want to select the file above the currently selected file (The equivalent of pressing the Up-Arrow key on the keyboard when the solution explorer is active and a file is selected) and when the user presses "k" I want to select the file below the currently selected file (The equivalent of pressing the Down-Arrow key on the keyboard when the solution explorer is active and a file is selected).
I would be very grateful if you could point me to a sample that would do something similar.
OptionPageCS project doesn't build because of a missing file.
1>------ Build started: Project: OptionsPageCS, Configuration: Debug Any CPU ------
1>C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.WinFx.targets(711,5): error BG1002: File 'Example.OptionsPage2.png' cannot be found.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Build succeeds.
The ImageWatch extension from VC++ Team does an amazing job, is it possible to include a simple example which does the basic thing in it? Specifically, how to get the image from a C++ variable in break mode?
Cannot run WPFDesigner_XML with sample template out of box.
Object reference not set to and instance of an object is encountered because the following line on 151 of VsDesignerControl.xaml results in es being nothing.
XmlEditorService es = GetService(typeof(XmlEditorService)) as XmlEditorService;
I intend to develop a plug-in, this plug-in is used to develop MCU procedures (such as STM32,AVR ,). I have two questions on this plug-in:
The Menu_And_Commands sample has an incorrectly named file:
Example.MenusAndCommands.png
Should be:
Example.MenuAndCommands.png (singular 'Menu' not 'Menus')
Clone sample and build.
Build fails with: "Could not copy the file "C:\Source\VSSDK-Extensibility-Samples\Menu_And_Commands\C#\Example.MenuAndCommands.png" because it was not found."
Sample should build correctly.
The solution built after I renamed the file as described above.
This code generation example works with a standard .Net 4.5, .Net 4.6 library and PCL library project, but doesn't work with a .NETStandard library project.
The code generator works with old .NET and PLC libraries.
It should work with a .NET Standard library.
I don't really know if this is the best place to ask is (if there's a better place: please point me in that direction).
I stumbled upon the Image Service and was wondering if it is allowed to use it outside of VS Extensions? Can I use it in my standalone application? Can I include the standard VS icon manifest with my application?
I have read Localizing Menu Commands
about how to localize menu/command,
project can be compiled, but when debug/execute it, System.IO.IOException will be thrown, "can't find resource toolwindow1control.xaml"
please provide correct instructions in ms doc or samples ..
I'm not finding barely any docs or examples on the new async package changes (speedy startup). It would be great having an example that show cases this.
Toolbar with drop down combo still receives advised events after toolbar is hidden.
I could not find any event to be notified when toolbar is hidden/shown so could not stop receiving those events.
Advise/Unadvise selection events when toolbar is hidden or shown.
After project upgrade/migration, I build the solution and get an error. I dont have any older Visual Studio versions installed. I have VS2017 installed on the D:\vs2017
I tried upgrading the entire project to the 15.0 version of this dll but I get tons of other problems with that approach.
The lightbulbs never show up
It is supposed to show you how to display lightbulb helpers, but the sample doesn't work at all.
It should show the lightbulbs in txt files so we can use this example to help build extensions
"Menu and Commands Sample" does not compile on VS2017,
Is there anyone able to solve it?
I'm not in favor of doing so :-(
I tried to build it. Since it required the assembly Microsoft.VisualStudio.Utilities , I have referenced to it, but the following warning has been shows:
The primary reference "Microsoft.VisualStudio.Utilities, Version=15.0.0.0, could not be resolved because it was built against the ".NETFramework,Version=v4.6" framework. This is a higher version than the currently targeted framework ".NETFramework,Version=v4.5.2".
I am using MVS 2017. Do you know how can I reference to Microsoft.VisualStudio.Utilities 14 ?
There are some samples coming (#119) that require the VS2013 VSSDK. Rather than installing it for all AppVeyor builds in this repo, we can install the VS2013 VSSDK for the subset of samples that require it.
More info on how to do it: https://www.appveyor.com/docs/build-environment/#using-multiple-images-for-the-same-build.
Not an issue per-se but a question.
I have an extension for a new language that adds syntax coloring (among other features).
The problem I'm facing, I can't find good samples of it, is that in some cases I need to color many lines depending on one already processed. Think of it like the a multiline comment block in C#.
var a = 1; /* So far was valid code
but now it is a comment
until here*/
I've been working with the IClassifier IList<ClassificationSpan> GetClassificationSpans(SnapshotSpan span)
returning different classifiers, but is what I've noticed so far. If I process every line in the span I get, I can effectively color my block of comment as expected, but, it takes waaaay to long and makes the Visual Studio Editor to have jerky moves... it starts to work really slow, even scrolling in the editor get "heavy".
If, on the other way, I process just the first line in the span, I do get a fast editor, but I can't get the comment block to be painted cause I'm always processing one row at a time.
I'm looking for samples but everything I've found so far are single lines coloring. Is there a sample I can be referred to? Or maybe just a tip on how to do it?
Thanks
I am running the WPFDesigner_XML sample (thank you for this)
I was looking at the ProvideXmlEditorChooserDesignerView
attribute which is placed above the VsPackage
The xml I would like to register the xmlchooser for, is in a .dnn
file, and has no xml namespace.
So I did this:
[ProvideXmlEditorChooserDesignerView("DnnManifest", "dnn", LogicalViewID.Designer, 0x60,
DesignerLogicalViewEditor = typeof(EditorFactory), Namespace = "", MatchExtensionAndNamespace = true)]
However, the XmlChooser then fails to open up, can you verify whether Namespace = ""
works to specify xml that's not in any namespace?
When I used MatchExtensionAndNamespace=false
- this had the side effect that my designer was being invoked for non ".dnn" files which has confused me.
To workaround this at present I am now making up a fake namespace and using MatchExtensionAndNamespace=false
. That way the namespace that it matches on is not used by anything else so essentially that has the side effect of just matching on the ".dnn" file extension which is what I want.
[ProvideXmlEditorChooserDesignerView("DnnManifest", "dnn", LogicalViewID.Designer, 0x60,
DesignerLogicalViewEditor = typeof(EditorFactory), Namespace = "http://doesntexist", MatchExtensionAndNamespace = false)]
LSP client fails to initialize if the "Visual C++ package" isn't installed. Whether the current behaviour is the correct behaviour, and more requirements should be listed on readme.md, or a functional issue is not clear to me.
.foo
filesAn error is displayed that the Visual C++ package failed to load
ActivityLog.xml contains the following entries:
<entry>
<record>2176</record>
<time>2018/03/19 10:34:17.814</time>
<type>Error</type>
<source>VisualStudio</source>
<description>SetSite failed for package [Visual C++ Package](null)</description>
<guid>{1B027A40-8F43-11D0-8D11-00A0C91BC942}</guid>
<hr>80070002</hr>
<errorinfo></errorinfo>
</entry>
<entry>
<record>2177</record>
<time>2018/03/19 10:34:19.190</time>
<type>Error</type>
<source>VisualStudio</source>
<description>End package load [Visual C++ Package]</description>
<guid>{1B027A40-8F43-11D0-8D11-00A0C91BC942}</guid>
<hr>80070002</hr>
<errorinfo></errorinfo>
</entry>
The file should open, and the LSP server and LSP client should start
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.