Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
VBAndCs
@VBAndCs
@CyrusNajmabadi the html_5.xsd that vs uses for intellisnse in HTML editor: C:\Program Files\Microsoft Visual Studio\2019\Community\Common7\Packages\Schemas\html
Do you have access to VB.NET compiler source code post Roslyn? Say VB12 ? Can you copy the xml schema complete provider from it?
jgefen
@jgefen
@mrlacey I see, thank you.
Joseph Musser
@jnm2
@VBAndCs What does "post Roslyn" mean? The VB compiler source code is currently contained in Roslyn.
VBAndCs
@VBAndCs
This isn't ported to Roslyn, which I am trying to solve. VB 12 source should code contains that functionality, and it will be easier to build upon it.
Joseph Musser
@jnm2
Ah, pre-Roslyn?
It's probably possible to follow the Roslyn source code and find the Visual Studio API it uses to obtain XML intellisense in VB.
Matthijs ter Woord
@mterwoord
@VBAndCs you're only interested in code highlighting? or also compile-time validation?
VBAndCs
@VBAndCs
to obtain XML intellisense in VB.
there is no such thing. It doesn't work. They didn't include it in Roslyn. We discussed this a year ago dotnet/roslyn#34816
@mterwoord I want auto complete for starters. I already borrowed a copy of the XMLDocComment CompletionProvider to work in XML literals
VBAndCs
@VBAndCs
untitled1
I am modifying this now to get the completion suggestions from the html_5.xsd file
but this is a special purpose for Vazor. VB XML literals still wants to retrieve its xsd based intellisense.
jgefen
@jgefen
Hi, is there a way to get referenced project information (name, path) from an IVsHierarchy object? or using another service?
Ed Dore
@EdDore
@jgefen You can get some info from the VSITEMID_ROOT object, but you'll probably need to use the automation object exposed via the VSHPROPID_ExtObject property. Be aware it's an optional property, so some bare boned project types may not support it.
jgefen
@jgefen
@EdDore Can you point to some tutorial or example?
Ed Dore
@EdDore
@jgefen What sort of project type(s) are you working with, and what exactly are you looking for with respect to name and path? The EnvDTE.Project.Properties collection has various build settings, project file name, etc...
jgefen
@jgefen
@EdDore I have my own implmentations with VSProject system fro the project types and we use the built in capability for the ProjectReference, I want to extarct the name and the path of the reference projects (either absolute or relative)
Christopher Christou
@awschristou
Is it possible to automate publishing Visual Studio extensions into the marketplace?
Joseph Musser
@jnm2
@awschristou Yes, I have a PowerShell script for this
Specifically the part you'll want is
function PublishToMarketplace(
    [Parameter(Mandatory=$true)] [string] $VsixPath,
    [Parameter(Mandatory=$true)] [string] $VsixPublishManifestPath,
    [Parameter(Mandatory=$true)] [string] $VsixMarketplaceAccessToken
) {
    $visualStudioInstallation = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.VisualStudio.Component.VSSDK -property installationPath

    $vsixPublisher = Join-Path $visualStudioInstallation 'VSSDK\VisualStudioIntegration\Tools\Bin\VsixPublisher.exe'
    & $vsixPublisher publish -payload $VsixPath -publishManifest $VsixPublishManifestPath -personalAccessToken $VsixMarketplaceAccessToken
}
Christopher Christou
@awschristou
@jnm2 Thank you very much!
Joseph Musser
@jnm2
Sure! That was a fun evening. I expected it to be harder!
Laurent Kempé
@laurentkempe
@awschristou You might read the way I implemented it for GitDiffMargin with Azure DevOps - https://laurentkempe.com/2019/03/05/Azure-DevOps-for-Visual-Studio-Extensions/
Jakub Suchy
@jakubsuchybio

Hi guys, I'm lost. I'm trying to get some services inside InitializeAsync, but I always get null :(. For example

            var vsActivityLog = await package.GetServiceAsync(typeof(IVsActivityLog)) as IVsActivityLog;
            var textDocumentFactoryService = await package.GetServiceAsync(typeof(ITextDocumentFactoryService2)) as ITextDocumentFactoryService2;

for both I always get null :(.
The weirdest thing is that for few times ITextDocumentFactoryService2 worked, but it stopped for some reason which I can't figure out.

For more context I published it on github: https://github.com/jakubsuchybio/translation-vs-extension I really don't know how to figure this.
Yann Duran
@yannduran

@jakubsuchybio most services have a SSomeServiceName service and an associated ISomeServiceName interface. You'll usually see typeof(SSomeServiceName) as the parameter in GetService/GetServiceAsync, which is then cast to ISomeServiceName.

In your case the call should be await GetServiceAsync(typeof(SVsActivityLog)) as IVsActivityLog.

Note that the service name and the interface name don't always match. One example is the _DTE service being cast to DTE2.

Jakub Suchy
@jakubsuchybio
Where can I find the service implementation names for their corresponding interfaces? I tried Object Browser inside the DLLs in which the interfaces are, but I can only see the interfaces and not the implementations. Specifically I would need implementations for these: ITextDocumentFactoryService, IContentTypeRegistryService, ITextStructureNavigatorSelectorService
However I will try that SName for IName interfaces
Yann Duran
@yannduran
I don't know of any one place to look. I suggest googling getservice SomeServiceName to see how it's used
Matt Lacey
@mrlacey
@jakubsuchybio this si from some of my code
var activityLog = await package.GetServiceAsync(typeof(SVsActivityLog)) as IVsActivityLog;
I tend to search GitHub for examples of how to lookup the use of services. What is returned by Google (or Bing) tends to be out of date. What I find in GitHub has a much higher chance of being a fully working example. (Or at least worked once.)
Jakub Suchy
@jakubsuchybio
SVsActivityLog works, but actually I don't need that service I just happened to find it on some example and I tried to verify if it would work. It didn't with IVsActivityLog interface but it does work with SVsActivityLog.
Yes I search the github also, but there are just no examples of these services. And if there are some, they have huge dependencies with manual assembly loading of some VS extensibility dlls which I find really "hacky" way to do this.
Matt Lacey
@mrlacey
I've been experimenting with the Marketplace API but am finding that the install and ratingcount numbers don't match what's shown in the marketplace. Does anyone ( @madskristensen ?) know the official status of the API (https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery) or why the values may be different?
Matthijs ter Woord
@mterwoord
Is it possible to extend the wpf/xaml property window?
Matt Lacey
@mrlacey
@mterwoord I've not come across a way. What are you hoping/trying to do?
Matthijs ter Woord
@mterwoord
make a splitter between the property name and the value
stupid MS refuses to do so
afbeelding.png
hmm, the property grid doesn't live in vs, but in the xdes... process
Matthijs ter Woord
@mterwoord
@mrlacey Understand what I'm after?
Matt Lacey
@mrlacey
@mterwoord There's no public way to get at that. You could do it by reflection but that is likely to be very flakey. The code for the properties window isn't there but it might be worth raising an issue on the WPF repository. (https://github.com/dotnet/wpf) It can be really annoying to have to resize the window to see all the text
Matthijs ter Woord
@mterwoord
there's no way to see all text..
Matthijs ter Woord
@mterwoord
I'm able to inject custom templates/styles into the designer process, but cant find which styles to override. Dn't have time to chase that..
Laurent Kempé
@laurentkempe
Hi, do you know a way to know on which version of Visual Studio your extension is installed? The report from the Visual Studio marketplace is very light. I am thinking of removing support of VS 2012 on my extension but I would like to know how many users would be impacted! Thanks
Jim Wright
@keyoti
You can do it by sending data to Google Analytics for example. I can tell you that my extensions had extremely few 2012 users, less than 1%, so I dropped it. Even 2015 is low at 4%. What really surprised me is that it appears that only about 50% of users are auto-updating, I can still see a lot using the older versions of the extension.