Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
bluetarpmedia
@bluetarpmedia
Hi. I've used the 'EnableVSIPLogging' setting to find a context menu that I want to add my command to. It's the "Git History Context Menu" that's available when using the Git scc provider. (Right-click item, View History... to open the History window, then right-click in the tool window to open the menu I'm trying to parent my command to.) I hold Ctrl+Shift before opening this context menu and I get the 'menu data' displayed in the dialog box for what appears to be the correct menu (it has the correct NameLoc text, for example). But when I hook everything up in my vsct, my command doesn't load in that desired context menu. (I can place the command elsewhere just fine.) Any ideas?
sheffer21
@sheffer21

Hi, On a visual studio LSP extension, is there a good way to support multiple content types with different Server\Client capabilities (for each type), on only one server?

@ZoeyR Do you have any idea how to do that?

Ken Domino
@kaby76
Folks, I'm looking for an extension for VS2019, in marketplace.visualstudio.com or as up-to-date source code, that functions as a generic client for LSP in order to test my LSP server implementation on VS2019 IDE. Is there one? Or, is it built directly into VS2019? The links in https://microsoft.github.io/language-server-protocol/implementors/tools/ point to two extensions, one not maintained for two years, and the other just a demo and only for VS2017 preview. The demo source code, at https://github.com/tintoy/dotnet-language-client/tree/master/samples/VisualStudioExtension, is ancient but uses a MS client API for LSP at https://www.nuget.org/packages/Microsoft.VisualStudio.LanguageServer.Client/, which itself is actively being updated.
Bill Baffy
@wbaffy
@alessandrot60 I think what you are doing is the correct solution. I had to do the same for my tool windows and used the example under "Per-monitor awareness" here: https://devblogs.microsoft.com/visualstudio/new-features-for-extension-authors-in-visual-studio-2019-version-16-1/
Jose
@pepone
Hey, what is the correct way to ensure a IVsProject is not Disponsed while processing an event, I getting https://user-images.githubusercontent.com/11429151/65183500-9b950c80-da31-11e9-9a86-f8f7da91c076.png
Alessandro Triglia
@alessandrot60
@wbaffy Thanks for your reply. I had seen that article too but wasn't able to relate it to my situation. The example in the article creates a form and shows it immediately, whereas in my case, I have a class derived from ToolWindowPane and I override the Window property to return the control. The article says, "When using Windows Forms in an extension, you can match the Visual Studio 2017 scaling behaviors by wrapping your form or control creation in a DpiAwareness.EnterDpiScope call." However, the place where one puts the control creation code seems to matter. Just wrapping the control creation in a DpiAwareness.EnterDpiScope call wasn't working for me until I tried to put the control creation in the Window property override.
PSSreeKanth
@PSSreeKanth
Hi, I am trying to convert MPF Based VS package which is using Microsoft.VisualStudio.Shell.Package to
AsyncPackage(Microsoft.VisualStudio.Shell.AsyncPackage). Can anyone share an example/stepbystep guide to do this.
Thanks
Sander Rijken
@srijken
thanks for the link to this channel @madskristensen
I sometimes get a MissingMethodException when trying to access IProjectService.Services. When I debug it and add the code to fetch the IProjectService before the function where it goes wrong, it seems to work. Something weird is going on.
Kaveesh Dashora
@kaveeshd

Hi, We are trying to convert our existing MPFProj based project system to an AsyncPackage. We did a little digging in and found out that our package extends the ProjectPackage and ProjectPackage extends Package. This all is synchronous code. There are other places in MPFProj base which may require changes to support AsyncPackage and follow the async - await pattern. Does anyone have any example where the MPF Project Base has been converted to AsyncPackage? I tried googling for a new version of MPFProj but I did not find it.

I also found the Visual Studio Project System. Is that the way forward? Do we need to migrate our code from MPFProj to Visual Studio Project System?

kandvict
@kandvict
Hi, based on the MS ProjectSystem, I'm able to add a reference between two customized projects say .mxproj
However I don't have a good reference on how to build a browseObjectProperties object that implements the IRule interface, this is needed to track the references and for their deletion, is there a simple example for this scenario?
Ken Domino
@kaby76

@sheffer21
Hi, On a visual studio LSP extension, is there a good way to support multiple content types with different Server\Client capabilities (for each type), on only one server?

The way I do this for my extensions (having written ones for Java, C++ so far) is to write an IVsTextViewCreationListener with [ContentType("any")][TextViewRole(PredefinedTextViewRoles.Editable)], and in the VsTextViewCreated() method, do a buffer.ChangeContentType(new_content_type,null) so as to mutate the content type to a new content type that you define associated with your LSP client. You would need to get the name of the file associated with the buffer name and/or current content type, and decide appropriately if you want to change the content type. Here you can convert the various types into one content type for your one server. Or, if you have different servers for different content types, declare an ILanguageClient implementation for each content type. In the LSP client ILanguageClient.ActivateAsync(), I spawn a process for the server redirecting stdin and out. The big disadvantage here is that other extensions that use the content type will no longer function. But, this is how I can get clangd working on C++ instead of what is packaged with VS. --Ken

Kaveesh Dashora
@kaveeshd

Hi, We are trying to convert our existing MPFProj based project system to an AsyncPackage. We did a little digging in and found out that our package extends the ProjectPackage and ProjectPackage extends Package. This all is synchronous code. There are other places in MPFProj base which may require changes to support AsyncPackage and follow the async - await pattern. Does anyone have any example where the MPF Project Base has been converted to AsyncPackage? I tried googling for a new version of MPFProj but I did not find it.

I also found the Visual Studio Project System. Is that the way forward? Do we need to migrate our code from MPFProj to Visual Studio Project System?

Robert van der Hulst
@RobertvanderHulst
@kaveeshd We are doing the same. We have looked at the Visual Studio Project System and found that it is quite different. We are now considering to derive our new project system from https://github.com/dotnet/project-system and "patch" the MPF code to make it behave better. Just like C# had a new project system for .Net Core/Standard and its old project system for Windows Forms and WPF.
@kaveeshd You may also want to look at ptvs. They have also moved MPF (SharedProject) code from Synchronous to AsyncPackage. They are on Github
sheffer21
@sheffer21
@kaby76 Hi, thanks for the response. I need to connect multiple content types to one server, but every content type has a different capabilities. Currently the only way I found to do it is to use multiple pipes - 2 pipes from every content type client to the server. Is there a way to it with only one pipe?
Ken Domino
@kaby76
@sheffer21 Yeah, if you are using Microsoft.VisualStudio.LanguageServer.Client, then the implementation requires separate pipes or stdin/out to a server. But, no problem. To handle this, you just need to write a proxy server for the real server, accepting connections and requests and then forwarding them onto the "real" server. In the proxy, you can pretty much do whatever you want--require the same capabilities, filter out requests, etc A proxy I'm writing right now uses StreamJsonRpc. It's a completely separate program, and it's basically for debugging--I can't find a simple program that outputs the JSON conversation.
Steven Kirk
@grokys
in the Avalonia XAML editor, pressing Ctrl+F would pop up the Find dialog instead of the Quick Find dialog embedded in the editor. in addition, Ctrl+.wouldn't work either. I hackily fixed this in AvaloniaUI/AvaloniaVS#116 by implementing IVsFindTarget3 which is an internal VS interface, but this feels very hacky! is there a better way to do this?
69802982-2422ec80-11db-11ea-9f8a-38791f87af46.png
also navigate back/forward doesn't work in the editor there (Ctrl+-) - how would I get this working?
Matt Lacey
@mrlacey
@grokys I'd been looking for something related (to navigation) previously and while it's also marked internal, this is the best information I could find https://github.com/MicrosoftDocs/visualstudio-docs/blob/master/docs/extensibility/internals/document-windows.md#document-window-implementation
Steven Kirk
@grokys
IVsBackForwardNavigation - how did i miss that!? thanks @mrlacey
Sander Rijken
@srijken
I sometimes get a MissingMethodException when trying to access IProjectService.Services. When I debug it and add the code to fetch the IProjectService before the function where it goes wrong, it seems to work. What's the trick here? And is using projectService.Services.ThreadingPolicy.VerifyOnUIThread(); the best way to verify that we're on the main UI thread?
Joe Petrakovich
@joepetrakovich_twitter
has anyone gotten CefSharp to open within a tool window?
there so many conditions around getting it to work and even after following all their advice for the gotchas, i'm still having no luck. basic FileNotFound exceptions for the CefSharp dlls.
im wondering if it's VS 2019 related
Sergey-Vlasov
@Sergey-Vlasov
@joepetrakovich_twitter I use CefSharp for https://vlasovstudio.com/html11/ Just included all CefSharp and Chromium files in VSIX.
Joe Petrakovich
@joepetrakovich_twitter
@Sergey-Vlasov with .vsixmanifest Assets?
i keep getting System.IO.FileNotFoundException: 'Could not load file or assembly 'CefSharp.WinForms, and im guessing it's because the VSIX isn't including all the DLLs from my project references. i'm not sure how to include them all.
Joe Petrakovich
@joepetrakovich_twitter
im getting closer actually.. manually copying all the cefsharp files into the project as Content and setting IncludeInVsix and CopyToOutputDirectory in my csproj.
Joe Petrakovich
@joepetrakovich_twitter
it works woo! thanks @Sergey-Vlasov
Joe Petrakovich
@joepetrakovich_twitter
Are we allowed to add menu items to existing groups on the code context window? I'd like to place a menu item right below "View Call Hierarchy" but it's not clear how i'd do that. If I use IDM_VS_CXTX_CODEWIN, it puts it at the very bottom.
Joe Petrakovich
@joepetrakovich_twitter
i found some existing groups with the "IDG VS CXTX *" prefix that look like they might be the one I want to add to but i couldn't figure out how to access them.
iitaiy
@iitaiy
Hi, I'm using LSP to support AutoCompletion for visual studio. How do I add detail and extra information for the autocompletion?
I tried to add Documentation and Detail for the CompletionItem but it doesn't work.
In addition I tried to implement TextDocumentCompletionResolveName but it never called.
Does this feature supported by visual studio?
Thanks in advance
iitaiy
@iitaiy

Hi, I'm using LSP to support AutoCompletion for visual studio. How do I add detail and extra information for the autocompletion?
I tried to add Documentation and Detail for the CompletionItem but it doesn't work.
In addition I tried to implement TextDocumentCompletionResolveName but it never called.
Does this feature supported by visual studio?
Thanks in advance

I found the problem. I changed the ResolveProvider in the capabilities to true.
But, for some reason VS take the completion tooltip from the CompletionItem.Detail property and not from CompletionItem.Documentation property.
Am I missing something?

Milan Mikuš
@Mylan719
Is there same kind of event I can register in VS when user changes references for a project?
Steven Kirk
@grokys
This message was deleted
Ed Dore
@EdDore

@joepetrakovich_twitter

From C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VSSDK\VisualStudioIntegration\Common\Inc\ShellCmdDef.vsct

  <Button guid="guidVSStd2K" id="cmdidContextMenuViewCallHierarchy" priority="0x0000" type="Button">
    <Icon guid="guidCallHierarchyButtons" id="1"/>
    <CommandFlag>DynamicVisibility</CommandFlag>
    <CommandFlag>DefaultInvisible</CommandFlag>
    <CommandFlag>DefaultDisabled</CommandFlag>
    <Strings>
      <ButtonText>View Call &amp;Hierarchy</ButtonText>
      <MenuText>View Call &amp;Hierarchy</MenuText>
      <ToolTipText>View Call Hierarchy</ToolTipText>
      <CommandName>View Call Hierarchy</CommandName>
    </Strings>
  </Button>

From C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VSSDK\VisualStudioIntegration\Common\Inc\SharedCmdPlace.vsct

<CommandPlacement guid="guidVSStd2K" id="cmdidContextMenuViewCallHierarchy" priority="0x0500">
  <Parent guid="guidSHLMainMenu" id="IDG_VS_CLASSVIEW_NAVIGATION"/>
</CommandPlacement>

From C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VSSDK\VisualStudioIntegration\Common\Inc\ShellCmdPlace.vsct

<CommandPlacement guid="guidVSStd2K" id="cmdidContextMenuViewCallHierarchy" priority="0x500">
  <Parent guid="guidSHLMainMenu" id="IDG_VS_OBJBROWSER_NAVIGATION"/>
</CommandPlacement>

<CommandPlacement guid="guidVSStd2K" id="cmdidContextMenuViewCallHierarchy" priority="0x0500">
  <Parent guid="guidSHLMainMenu" id="IDG_VS_CODEWIN_NAVIGATETOLOCATION"/>
</CommandPlacement>

So I'd hazard a guess that you could add your command to the above mentioned IDG_VS_CODEWIN_NAVIGATETOLOCATION group, with a priority of 0x501, should put your command just after the "View Call Hierarchy" command.

Shimmy
@weitzhandler
image.png
image.png
image.png
Hi and thanks for these can't-live-without tools.
I'm here to notify that that screenshots in the various extensions in the extension marketplace are broken
Joe Petrakovich
@joepetrakovich_twitter
@EdDore yep IDG_VS_CODEWIN_NAVIGATETOLOCATION was it. thanks. @Sergey-Vlasov pointed out the Command Explorer extension to me on stackoverflow which lead me to it. i also had my priority wrong.
Mads Kristensen
@madskristensen
Come work on the Visual Studio extensibility team as a software engineer. Check it out here: https://careers.microsoft.com/i/us/en/job/749217/Senior-Software-Engineer
Abishake968
@Abishake968
Hi,
How to avoid UI Unresponsiveness for custom extension
ChristianRiepingEco
@ChristianRiepingEco
Hello, I have the problem that the method GetTags from the class of InstructionTagger isn`t calling over a TagAggregator which is available in the class of CheckboxTagger
namespace HilafExtensionsVisualStudio {

    [Export(typeof(IViewTaggerProvider))]
    [ContentType("code")]
    [TagType(typeof(IntraTextAdornmentTag))]
    internal sealed class CheckboxTaggerProvider : IViewTaggerProvider {

        [Import]
        internal IBufferTagAggregatorFactoryService tagAggregatorFactoryService { get; private set; }

        public ITagger<T> CreateTagger<T>(ITextView textView, ITextBuffer buffer) where T : ITag {
            if (textView == null) {
                throw new ArgumentNullException(nameof(textView));
            }
            else if (buffer == null) {
                throw new ArgumentNullException(nameof(buffer));
            }

            return buffer.Properties.GetOrCreateSingletonProperty("CheckboxTagger", () => new CheckboxTagger(textView, buffer, tagAggregatorFactoryService)) as ITagger<T>;
        }
    }
}
namespace HilafExtensionsVisualStudio {

    internal class CheckboxTagger : ITagger<IntraTextAdornmentTag> {

        private readonly ITagAggregator<InstructionTag> tagAggregatorInstructionTag;

        public CheckboxTagger(ITextView textView, ITextBuffer textBuffer, IBufferTagAggregatorFactoryService tagAggregatorFactoryService) {
            tagAggregatorInstructionTag = tagAggregatorFactoryService.CreateTagAggregator<InstructionTag>(textBuffer);
        }

        public event EventHandler<SnapshotSpanEventArgs> TagsChanged;

        public IEnumerable<ITagSpan<IntraTextAdornmentTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
            var temp = tagAggregatorInstructionTag.GetTags(spans);

            if (spans == null || spans.Count == 0)
                yield break;
        }        
    }
}
namespace HilafExtensionsVisualStudio {

    [Export(typeof(ITaggerProvider))]
    [ContentType("code")]
    [TagType(typeof(InstructionTag))]    
    internal sealed class InstructionTaggerProvider : ITaggerProvider {

        public ITagger<T> CreateTagger<T>(ITextBuffer buffer) where T : ITag {
            if (buffer == null) {
                throw new ArgumentNullException(nameof(buffer));
            }

            return buffer.Properties.GetOrCreateSingletonProperty("InstructionTagger", () => new InstructionTagger(buffer)) as ITagger<T>;
        }
    }
}
namespace HilafExtensionsVisualStudio {

    internal class InstructionTag : ITag {

    }

    internal sealed class InstructionTagger : ITagger<InstructionTag> {

        ITextBuffer textBuffer;

        public InstructionTagger(ITextBuffer buffer) {
            textBuffer = buffer;
        }

        public IEnumerable<ITagSpan<InstructionTag>> GetTags(NormalizedSnapshotSpanCollection spans) {
            if (spans == null || spans.Count == 0)
                yield break;
        }

        public event EventHandler<SnapshotSpanEventArgs> TagsChanged;
    }
}
Robert van der Hulst
@RobertvanderHulst
For our custom .Net development language we have added some debugger support. We are customizing the locals window and call stack and the display of the type names.
We now want to add some windows during debugging, similar to the locals window, to display global application state. We can retrieve this state in the Watch window already, but don't really have an idea how to send an expression to the debugger from another custom window, so we can display its results.
Does anybody have experience with this or does anybody have some (open source) that I can study to get started with this ?
Robert van der Hulst
@RobertvanderHulst
To add to my previous question: I know that I can evaluate expressions with dte and the Debugger object, but I would like to use the managed debugging API (IDkmClr..) when possible.