Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Yann Duran
@yannduran
@kaveeshd my bad, for WPF you inherit from UIElementDialogPage, not DialogPage
@cameron314 sorry, I'm talking about options pages, i misread the original text
Cameron
@cameron314
Cool, didn't know UIElementDialogPage existed :-)
Yann Duran
@yannduran
@cameron314 at least i got something right lol
Cameron
@cameron314
hehe
Yann Duran
@yannduran
this article is a little old now, but the explanation still holds true Setting for Your Visual Studio Extension, just make sure you keep reading till the end
slooker
@slooker
Good morning. Is there a room to ask questions about extensions? My remote wsl just randomly stopped working, and now I'm dead in the water. I've done some investigating, and figured out that for some reason even though I can curl locally on my WSL, I can't curl from my windows machine to WSL on the port that's opened by VSCode. I've tried reinstalling the extension, removing the .vscode-server directory on my WSL, removing the extension properties in my windows box, and checking for updates for both the extension and actual VSCode.
slooker
@slooker
If there's somewhere else someone can recommend, I'd be super appreciative.
slooker
@slooker
For anyone that cares, disabling ipv6 in windows immediately fixed the problem.
Daniel Griffen
@dgriffen
@slooker you might want to open up an issue on the VSCode github, this gitter channel is for Visual Studio, not Visual Studio Code.
Kaveesh Dashora
@kaveeshd
@yannduran Thanks. This helps
Matt Lacey
@mrlacey
@madskristensen watching https://www.youtube.com/watch?v=RgQEfUUHUYw and noticed that you say that any visual studio extension can be made into an extension pack. How does this work? Does it mean I can include a .vsext file in a regular extension and the user will also be prompted to install the referenced extensions at the same time?
Mads Kristensen
@madskristensen
@mrlacey That's exactly right. I do that in my Image Sprites extension and a few others too
James Lavery
@jameslavery
Hi all,
We want to exclude the designer.cs files, generated from RESX files, from our repositories. To achieve this, we need to make VS run the resource generator at project load (because the resource generation tool only runs when a RESX file is changed). This triggers two questions:
  1. Is there already an extension which does this (can't find one).
  2. If not, which SDK class/event can I hook into so I can run the resource generator when a Project loads?
Matthijs ter Woord
@mterwoord
that means no build server either?
James Lavery
@jameslavery
@mterwoord Correct.
Matthijs ter Woord
@mterwoord
just asking.
Out of curiosity: why?
James Lavery
@jameslavery
@mterwoord Erm... because that's how the development environment is set up at this customer?
Matthijs ter Woord
@mterwoord
Don't get me wrong, I'm used to always have automated builds at a server, even its just to verify everythings commited :)
was just curios to learn new visions.. :)
James Lavery
@jameslavery
@mterwoord No problem!
Markus Amshove
@MarkusAmshove
Is it possible to extend the WorkItems in CodeLens somehow, so that it interprets Issues from other trackers? We're using Redmine and I would like to be able to create an extension that mimics the VSTS work item code lens behavior but with information from redmine :-)
Ken Domino
@kaby76

Hi All,
I’ve been writing an extension for Antlr grammars for VS IDE for a couple of years, and now that it works--more or less--I’m interested in writing a new extension targeting at runtime any language via a meta grammar and tables detailing information for tagging, etc.
The problem with this idea is that I use MEF (Managed Extensibility Framework), and virtually all samples that I can find are based in MEF. Unfortunately, MEF works on a statically defined type system, i.e., the types are created upfront then compiled. It attaches C# attributes to describe the language it implements, e.g., the tagger provider and the file suffix associated with the language is hardwired at compile time:

    [Export(typeof(ITaggerProvider))]
    [ContentType(AntlrVSIX.Constants.ContentType)]
    [TagType(typeof(ClassificationTag))]
    internal sealed class AntlrClassifierProvider : ITaggerProvider
    {
        [Export]
        [Name(/* AntlrVSIX.Constants.LanguageName */ "Antlr")]
        [BaseDefinition("code")]
        internal static ContentTypeDefinition AntlrContentType = null;

        [Export]
        [FileExtension(/* AntlrVSIX.Constants.FileExtension */ “.g;*.g4”)] 
        [ContentType(AntlrVSIX.Constants.ContentType)]
        internal static FileExtensionToContentTypeDefinition AntlrFileType = null;
    …
 }

I can, of course, generate a per-language extension via a template, then build the extension. But I was hoping for something that would be more dynamic. Is there something more modern than MEF for implementing VS extensions, something that isn’t based on a static type system framework?
Thanks for the info.
Ken

jcassidyav
@jcassidyav
Momchil Stefanov
@momchilstefanov
Hi guys, I have a VS extensions which is setting an environment variable and until recently (before VS 16.2 or 16.2.1) this environment variable was availabe in all devenv child processes. It seems that our package has started loading after the processes are created, the processes hierarchy was changed or something else happened which changed this behavior and breaked the functionality which depends on it. Is it possible to set environment variable in VS package in such a way that it will be available in all or some of the VS child processes and more specifically in the vstest.console process?
Alexander Gayko
@AdmiralSnyder
@MarkusAmshove you can add custom adornments manually into the text editor. i did this in my extension https://marketplace.visualstudio.com/items?itemName=AlexanderGayko.VarAdorner (there's a screenshot) it's up to you what data you put there. I don't know if there's an api to extend the codelens details directly, though (but i have a feeling of having read something in that direction somewhere… might be worth further googling for it)
Ken Domino
@kaby76
I found an answer to a part of the problem I asked about above. Pointed out here in Stackoverflow, one can create classification types at runtime using MEF CreateClassificationType(). This works great and removes a lot of the inflexible, static, redundant code. Now if I only can find the API hook to create an ITaggerProvider so I can set the file extension of a source file, like ".c;.cpp", I'll be able to write a VS extension that could support any programming language using Antlr grammars and some extra tables.
Carlos Quintero
@carlos-quintero
Does anybody know why the setting for Per-Monitor Awareness (PMA) in the Options window of VS 2019 remains disabled on virtual machines of VMWare or Parallels for macOS despite .NET 4.8 is installed and Windows 10 is April 2018 Update or higher? Has anyone been able to enable the checkbox? I have tried different settings in the VMs to no avail
Matthijs ter Woord
@mterwoord
vs is not detecting high-dpi?
Sergey-Vlasov
@Sergey-Vlasov
@carlos-quintero "Optimize rendering for screens with different pixel densities" is enabled in my VMware Workstation 15.1.0, Windows 10 v1903.
Cameron
@cameron314
@kaby76 I'm not sure I understand what you're trying to accomplish. You can create an ITaggerProvider for all content types (e.g. "code" or even "text") and just not return tags from it unless desired; is this enough for your use case?
Ken Domino
@kaby76
@cameron314 I'm creating a tagger for any language with information defined at runtime. I haven't tried removing the EXPORT FileExtensionToContentTypeDefinition field on the provider--I didn't know if it's required, but it seems plausible that it may not. I already make use of ITextBuffer.Properties for a file name, so I can perform the language-dependent tagging once I know that. I'll give this a try. Ty. -Ken
Cameron
@cameron314
@kaby76 The FileExtensionToContentTypeDefinition has nothing to do with the ITaggerProvider. It's used to create a mapping between your custom content type and a file extension. Your ITaggerProvider is currently registered exclusively to this custom content type, but it doesn't have to be. The fact that the content type/file-extension exports are declared within the ITaggerProvider implementation is pure coincidence :-)
Carlos Quintero
@carlos-quintero
@Sergey-Vlasov The problem must be macOS then . It happens with VMWare Fusion and Parallels
ArZei
@ArZei
Has there been a recent change in XAMLeditor Intellisense in version 16.2? We're having issues where on fresh WPF project creation the XAML editor will not recognize the MainWindow type resulting in blue squiggly and error in error list, until a build is performed after which everything is fine.
ArZei
@ArZei
We're a third party language extender and we are seeing this change in behavior in our WPF projects, but not in C#.
ArZei
@ArZei
Looks like someone has reported the same issue, in VB
Abishake968
@Abishake968

Hi ,

Anyone please help me how to create custom scaffolder for ASP.NET Core using extensibility

Alex Lorimer
@aodl
@Abishake968 I haven't written any code gen / scaffolding extensions before, but if I were you I would search the Visual Studio Marketplace for an extension that does the same type of thing. Find one that's open source and take a look at how it has been implemented
Does anyone know how to identify that a project is a VSIX project based just on the ProjectCapability? Or in other words, how can I declare an AppliesToAttribute that applies only to VSIX projects? ... yes, I'm writing an extension to aid with writing extensions :)
Mads Kristensen
@madskristensen
@aodl It doesn't limit itself to VSIX projects only, but you could do that from the generator code itself and not from the registration attribute
Alex Lorimer
@aodl
brilliant thanks @madskristensen
Ken Domino
@kaby76
Does anyone know how one can find out which extension created what "content type"? I got my extension to work with Java, but it only worked once I changed the content type associated with the ITextBuffer (via ChangeContentType) in a listener before it fully opened up in the VS editor. It turns out that the content type for the buffer was defined as "code++.Java". I have no clue where "code++.Java" comes from, an extension or whether it is part of VS itself. As I go forward, I can warn the user and/or present to the user an option to select the content type and services available for the buffer. Unfortunately, IContentType contains only a few strings and nothing to identify the origin.
Maxim Surkov
@modbrin

Hi,
I am developing custom language service and currently having hard time implementing Peek Definition (just regular peeked editor for some file). I have followed PeekF1 example from VSSDK-Extensibility-Samples and it works except the fact that xaml rules for VSProjectSystem break when UserControl xaml is added which I overcame with alternative in c# code. Now I want to add actual editor to the peek window, and I'm stuck with following part, which is in PeekResultPresentation.cs :

public UIElement Create(IPeekSession session, IPeekResultScrollState scrollState)
        {
            _control = new UserControl();
            _control.DataContext = this;
            // RegisterDocument(_peekResult.filepath); // register document if not from current solution
            IWpfTextViewHost editor = CreateEditor(_peekResult.filepath);
            System.Windows.Controls.Grid grid = new System.Windows.Controls.Grid();
            var winFormsHost = new ClippableWindowsFormsHost();

            grid.Children.Add(/* something */);      
            _control.Content = grid;
            return _control;
        }

Could anyone give a hint how to place the editor object into _control or maybe there's another way to perform peek correctly? Is it even necessary to implement PeekItem, PeekResult, etc to just peek file for custom language?

AlexFree
@AlexFree
Hi,
I am developing vs extension and using TreeView controls. I use VSColorTheme.ThemeChanged to detect vs theme changing and inside the event method for all child controls i set foreground and background colors. Everything is ok except the color for TreeViewItem when it is selected and without focus/inactive. I googled a lot of articles without success. Can anybody point me the correct way? Thanks! Here is the image of my code snippet and issue with color: http://prntscr.com/ox124g
alt
intelcentre
@intelcentre
Hi, I'm looking to find/create an extension that decrypts files on load and re-encrypts them on save. Anyone know if there are hooks for extending load/save?