vsixcommunity / docs Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
@madskristensen
Was I supposed to do something to add the merged pull request to the menus in default.html under the _layouts folder?
Still does not show up on the VSIX Cookbook web site.
I'd like to request documentation that explains how my extension UI can match the VS Theme for a more consistent look and feel. Not just the Window Background and Foreground, but also controls like Buttons and TextBoxes.
I would like a detailed document that documents (hopefully) all of the color options with an sample image of what the setting changes within the IDE.
My goal of this issue is to help people new to making Visual Studio themes understand and learn what each specific color option that is possible to be set easier.
For my theme, I needed transparency which sadly the theme designer for VS2022 lacked the ability to set a specific transparency value for all of the colors (excluding the document editor text) to be partially transparent which would be helpful for those who use ClaudiaIDE to expand a specific background image throughout the entire IDE.
For example I want to recolor this part but do not know where to look:
cc: @madskristensen
@madskristensen, @Rickrat, @bluetarpmedia, @shaneharper, and @martinjw:
Is it possible using the VsixCommunity/Community.VisualStudio.Toolkit to have checkboxes like the other Tools Options menus currently display, instead of a bool field? Also, I have multi-level menus that look like the other Code Style menus, but how do you get the options to be listed in each indented menu structure? Currently they all show up in the first option listed, not under each indented menu as expected. The following code is from my LinqLanguageEditor2022 Project, that I am working on to create documentation/walkthrough on how to create a Language Extension Editor to be add to the VSIX Cookbook, I have most of the project working correctly, but want to make sure I am using as much of the VsixCommunity/Community.VisualStudio.Toolkit as possible for the walkthroughs. Once I have the project correct, I will then create the walkthrough for the Editor using the Toolkit and upload it for @madskristensen review and release to the VSIX Cookbook.
Sample Package lines: (**Can this be shortened? **)
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqAdvancedOptions), Constants.LinqLanguageName, "", "Advanced", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", "Code Style", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\General", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\Formatting", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\Formatting\Indentation", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\Formatting\New lines", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\Formatting\Spacing", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqCodeStyleOptions), Constants.LinqLanguageName, "", @"Code Style\Formatting\Wrapping", null, 0)]
[ProvideLanguageEditorOptionPage(typeof(Options.LinqOptionsProvider.LinqIntelliSenseOptions), Constants.LinqLanguageName, "", "IntelliSense", null, 0)]
Sample OptionsProvider lines:
[ComVisible(true)]
public class LinqAdvancedOptions : BaseOptionPage<Options.LinqAdvancedOptions> { }
[ComVisible(true)]
public class LinqCodeStyleOptions : BaseOptionPage<Options.LinqCodeStyleOptions> { }
[ComVisible(true)]
public class LinqIntelliSenseOptions : BaseOptionPage<Options.LinqIntelliSenseOptions> { }
Sample Options Settings:
Note: There is one class for each of the above listed BaseOptionPage's.
(These do not show up under each indented option but under the first option as a list.)
public class LinqCodeStyleOptions : BaseOptionModel<LinqCodeStyleOptions>
{
[Category(@"General")]
[DisplayName("Automatically format when typing")]
[Description("Automatically format when typing.")]
[DefaultValue(true)]
public bool AutoFormatWhenTyping { get; set; } = true;
[Category(@"General")]
[DisplayName("Automatically format statement on ;")]
[Description("Automatically format statement on ;.")]
[DefaultValue(true)]
public bool AutoFormatStatementOn { get; set; } = true;
[Category(@"General")]
[DisplayName("Automatically format statement on }")]
[Description("Automatically format statement on }.")]
[DefaultValue(true)]
public bool AutoFormatBlockOn { get; set; } = true;
[Category(@"General")]
[DisplayName("Automatically format on return")]
[Description("Automatically format on return.")]
[DefaultValue(true)]
public bool AutoFormatOnReturn { get; set; } = true;
[Category("Indentation")]
[DisplayName("Indent block contents")]
[Description("Indent block contents.")]
[DefaultValue(true)]
public bool IndentBlockContents { get; set; } = true;
[Category("Indentation")]
[DisplayName("Indent open and close braces")]
[Description("Indent open and close braces.")]
[DefaultValue(true)]
public bool IndentOpenCloseBraces { get; set; } = true;
[Category("Indentation")]
[DisplayName("Indent case contents")]
[Description("Indent case contents.")]
[DefaultValue(true)]
public bool IndentCaseContents { get; set; } = true;
[Category("Indentation")]
[DisplayName("Indent case contents (when block)")]
[Description("Indent case contents (when block).")]
[DefaultValue(true)]
public bool IndentCaseContentsInBlock { get; set; } = true;
[Category("Indentation")]
[DisplayName("Indent case labels")]
[Description("Indent caselabels.")]
[DefaultValue(true)]
public bool IndentCaseLabels { get; set; } = true;
[Category("New Lines")]
[DisplayName("Place open brace on new line for types")]
[Description("Place open brace on new line for types.")]
[DefaultValue(true)]
public bool OpenBraceOnNewLineForTypes { get; set; } = true;
[Category("New Lines")]
[DisplayName("Place open brace on new line for methods and local functions")]
[Description("Place open brace on new line for methods and local functions.")]
[DefaultValue(true)]
public bool OpenBraceOnNewLineForMethods { get; set; } = true;
[Category("Spacing")]
[DisplayName("Insert space between method name and its opening parenthesis")]
[Description("Insert space between method name and its opening parenthesis.")]
[DefaultValue(true)]
public bool InsertSpaceBetweenMethodNameOpenParenthesis { get; set; } = true;
[Category("Spacing")]
[DisplayName("Insert space within parameter list parentheses")]
[Description("Insert space within parameter list parentheses.")]
[DefaultValue(true)]
public bool InsertSpaceInParameterlistParentheses { get; set; } = true;
[Category("Wrapping")]
[DisplayName("Leave block on single line")]
[Description("Leave block on single line.")]
[DefaultValue(true)]
public bool LeaveBlockOnSingleLine { get; set; } = true;
[Category("Wrapping")]
[DisplayName("Leave statements and member declarations on the same line")]
[Description("Leave statements and member declarations on the same line.")]
[DefaultValue(true)]
public bool LeaveStatementMemberDeclareOnSameLine { get; set; } = true;
}
@madskristensen; Please provide some code samples for the events used in the ToolKit. I tried to create some from the code in the ToolKit on GitHub, but nothing is working correctly, or the events fire five times per action. Specifically, Editor document opened/created, and Editor document closed/destroyed.
Right now the topics under Walkthroughs are focused on things like commands, tool windows, options, notifications. I'd suggest renaming this category to something like Extending the UI, and then using Walkthroughs for functional scenarios like:
A follow-up from here: VsixCommunity/Community.VisualStudio.Toolkit#267 (comment)
Some possible topics to cover:
publish.json
manifest file (there's already good docs on this here, so maybe all we need to do is provide a link to that page.The rest of the docs talk about using the templates, but the 'get the tools' don't have that step to include them.
from my experience, I think it would be cool to highlight the following topics:
I implemented both features in the different VSIXes, but it was painful :)
Second topic relates with https://github.com/MicrosoftDocs/visualstudio-docs/issues/6509
Thanks you!
@madskristensen; After you merged my changes. I look at the results in the Cookbook and the formatting is off. I am submitting a Pull Request: Fix MD formatting for convert to HTML page in cookbook. #24 with better MD formatting that should fix these issues.
Double Word (should):
Title says it all. So I'll use this space to say thank you for the cookbook and and the videos and the samples, they helped a lot!
Regarding
(twd as IDisposable).Dispose();
from the Threaded Wait Dialog example:
The compiler outputs:
warning CS8602: Dereference of a possibly null reference.
What should be done to get rid of that warning?
Until I saw the example code it had never occurred to me that there could be a need to call Dispose for the object returned by ThreadedWaitDialogHelper.CreateInstance(IVsThreadedWaitDialogFactory). Could a comment be added to the example explaining the need for it? Perhaps the best place to mention it would be in the documentation for CreateInstance.
Could you add some documentation on creating Connected Services?
Now there is no understanding of how to translate an existing connected service to 2022. And all the previous documentation is outdated long ago.
I am including Leslie Richardson and Mads
Kristensen in this question since they are the best resource
for Extending Visual Studio 2022.
Hi Leslie, my name is Danny McNaught
I have been a developer for over 25 years, but this is the first time I am
creating an Editor Extension for Visual Studio. So, when I offered to contribute
to Mads Kristensen’s VSIX Cookbook; a complete
‘Walkthrough’ on how to include a Language Editor in a Visual Studio 2022
Extension. I found documentation that sends you everywhere but the right place.
I can create the Editor Extension using the LanguageFactory using Mads examples
and it works great. The issue that I am finding is that the current available
MEF documentation
dated 11/06/2021 does not provide any examples/walkthroughs on how to add syntax
coloring (CSharp file like code coloring) using MEF, there are examples for
legacy language services using IScanner, Colorizer… But they do not provide
information on using the IScanner or Colorizer in MEF. The Legacy Language
Services documentation also states:
Then on top of that when you follow the Managed Extensibility Framework
(MEF) and to the Next
steps
section the included link for: For more information and code examples, see
Managed Extensibility Framework
This link takes you to GitHub where the Readme.md states:
This project has been migrated from CodePlex and isn't actively maintained.
It's provided for archival purposes only.
You can find the original wiki home page
here.
If you're looking for the current MEF code base, you should go to
CoreFx.
This CoreFx link then takes you to another broken GitHub page that states:
Going forward, the .NET team is using
https://github.com/dotnet/runtime to
develop the code and issues formerly in this repository.
Please see the following for more context:
Now that we are at the currently supported GitHub site, but remember I wanted
information on MEF and Visual Studio 2022. I was dropped at the root of the
dotnet/runtime site.
I am still using these documents no closer than I was to getting the CSharp
syntax highlighting I am wanting for the walkthrough in the VSIX Cookbook.
The walkthrough: VSIXLinqLanguageEditor2022 (Sample code is located
here)
Once I get the code to work as expected then
I will create the documentation on how to do it
for the VSIX Cookbook). I have tried many things, so the sample project has a lot of
extra stuff that would be removed once I get it working correctly. (i.e.
LinqEditorLightBulb.cs, etc.)
The Walkthrough I am creating for the VSIX Cookbook is as follows:
Visual Studio 2022 Extension
Language Editor using the LanguageFactory from the
Community.VisualStudio.Toolkit.LanguageBase.
ToolWindow allows you to select a line of LINQ code from your open CSharp
file, select a method that contains a LINQ query, or open a .linq file.
The ToolWindow command then opens your selection in a new Editor window
where you can modify/test it and get and display query results from the LINQ
query inside of Visual Studio. (Note: Currently works using LinqPad’s
“LPRun7-x64.exe, and LINQPad.Runtime.dll”)
The new Editor window with the file extension .linq instead of .cs contains
you code. This still works as expected and allows you to get the results of
the query in the ToolWindow or a Dump Window based on Options settings for
the linq Text Editor.
What does not work is the code syntax colorization of the code.
Test.cs file looks like this:
So, if I select the private static void method above and click the
button the new editor will
display the private static void method and the ToolWindow will display the
results.
)
But the new editor window does not have any syntax colorization.
NOTE: I have noticed that if I take a CSharp (.cs) file in the solution copy
it back in the solution and rename the extension to (.linq) all the
colorization remains, but only if my sample extension is installed. This does not work if I open a .linq file or create
the .linq file from the selection with or without the extension installed.
How to you get CSharp style colorization to work in MEF and Visual Studio
2022 Editor extension?
Can you use IScanner and IVsColorizer in a MEF Extension? If so, how do you,
[Import] [Export] IScanner and IVsColorizer in your MEF package?
Do you currently have documentation on using MEF package to colorize your code?
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.