Update links in README files to new learn docs

This commit is contained in:
Gordon Hogenson 2023-05-23 10:21:09 -07:00
Родитель a899c96539
Коммит 028941bb1d
6 изменённых файлов: 18 добавлений и 18 удалений

Просмотреть файл

@ -111,9 +111,9 @@ If we want the extension to be localized for different languages, we can later a
The Comment Remover extension is leveraging four of Visual Studio services:
- `DTE2`, available as `DTE` through [AsyncServiceProvider](https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualstudio.shell.asyncserviceprovider);
- `DTE2`, available as `DTE` through [AsyncServiceProvider](https://learn.microsoft.com/dotnet/api/microsoft.visualstudio.shell.asyncserviceprovider);
- `IVsTextManager`, available as `SVsTextManager` through `AsyncServiceProvider`;
- `IBufferTagAggregatorFactoryService`, available through [MEF](https://docs.microsoft.com/en-us/visualstudio/extensibility/managed-extensibility-framework-in-the-editor);
- `IBufferTagAggregatorFactoryService`, available through [MEF](https://learn.microsoft.com/visualstudio/extensibility/managed-extensibility-framework-in-the-editor);
- `IVsEditorAdaptersFactoryService`, available through `MEF`.
In a VisualStudio.Extensibility command, we can consume such services using .NET dependency injection by simply adding them to the command's constructor:

Просмотреть файл

@ -33,11 +33,11 @@ The `CommandConfiguration` property defines information about the command that a
The command is placed in `Extensions` top menu and uses `OfficeWebExtension` icon moniker.
The `VisibleWhen` property defines when the command is visible in the `Extensions` menu. You can refer to [Activation Constraints](../inside-the-sdk/activation-constraints.md/) to learn about different options that you can use to determine command visibility and state. In this case, the command is enabled anytime there is an active editor in the IDE.
The `VisibleWhen` property defines when the command is visible in the `Extensions` menu. You can refer to [Activation Constraints](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/inside-the-sdk/activation-constraints) to learn about different options that you can use to determine command visibility and state. In this case, the command is enabled anytime there is an active editor in the IDE.
## Getting the active editor view
Once user executes the command, SDK will route execution to `ExecuteCommandAsync` method. `IClientContext` instance contains information about the state of IDE at the time of command execution and can be used in conjuction with `VisualStudioExtensibility` object.
Once user executes the command, SDK will route execution to `ExecuteCommandAsync` method. `IClientContext` instance contains information about the state of IDE at the time of command execution and can be used in conjunction with `VisualStudioExtensibility` object.
In our example, we utilize `GetActiveTextViewAsync` method to get the active text view at the time of command execution which includes information about document being open, version of the document and the selection.
@ -62,7 +62,7 @@ await this.Extensibility.Editor().MutateAsync(
## Logging errors
Each extension part including command sets is assigned a `TraceSource` instance that can be utilized to log diagnostic errors. Please see [Logging](../inside-the-sdk/logging.md) section for more information.
Each extension part including command sets is assigned a `TraceSource` instance that can be utilized to log diagnostic errors. Please see [Logging](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/inside-the-sdk/logging) section for more information.
## Usage

Просмотреть файл

@ -30,7 +30,7 @@ Different to previous samples, this extension implements its own class that inhe
There are 2 interesting points in the implementation of `MarkdownLinterExtension`:
* `ResourceManager` property points to the resource dictionary that contains localized entries that would be used for creating an output window pane.
* `InitializeServices` method is used to add local services to the dependency injection graph. As noted in [local services section](../inside-the-sdk/extension-anatomy.md/#local-extension-services), the extension utilizes a scoped `MarkdownDiagnosticsService` as the service instance injects `VisualStudioExtensibility` object.
* `InitializeServices` method is used to add local services to the dependency injection graph. As noted in [local services section](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/inside-the-sdk/extension-anatomy#local-extension-services), the extension utilizes a scoped `MarkdownDiagnosticsService` as the service instance injects `VisualStudioExtensibility` object.
## MarkdownDiagnosticsService local service

Просмотреть файл

@ -6,11 +6,11 @@ date: 2022-08-01
# Walkthrough: Output Window Sample Extension
This extension demonstrates the most basic usage of the [Output Window API](./../../../docs/new-extensibility-model/extension-guides/outputWindow/outputWindow.md)
This extension demonstrates the most basic usage of the [Output Window API](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/output-window/output-window)
## Summary
This extension adds a [command](./../../../docs/new-extensibility-model/extension-guides/command/command.md) to the Tools menu called "Test the Output Window". When invoked, the command will print `"This is a test of the output window."` to the Output pane in a Channel called "MyOutputWindow" (look for the Channel name in the "Show output from:" dropdown in the Output pane).
This extension adds a [command](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/command/command) to the Tools menu called "Test the Output Window". When invoked, the command will print `"This is a test of the output window."` to the Output pane in a Channel called "MyOutputWindow" (look for the Channel name in the "Show output from:" dropdown in the Output pane).
## TestOutputWindowCommand
@ -20,22 +20,22 @@ This extension adds a [command](./../../../docs/new-extensibility-model/extensio
The `GetOutputWindowAsync()` method creates an Output Window Channel by calling `Extensibility.Views().Output.GetChannelAsync()`. `GetChannelAsync()` takes the name of a resource from the ResourceManager set up in the [`Extension` class](#extension-class).
See [Getting an Output Window Channel](./../../../docs/new-extensibility-model/extension-guides/outputWindow/outputWindow.md#getting-an-output-window-channel) for more information.
See [Getting an Output Window Channel](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/output-window/output-window#get-an-output-window-channel) for more information.
### Writing to the Output Window
In the `ExecuteCommandAsync()` method, the `Writer` property of the `OutputWindow` instance is used to write a message to the Output pane in the IDE.
See [Writing to the Output Window](./../../../docs/new-extensibility-model/extension-guides/outputWindow/outputWindow.md#writing-to-the-output-window) for more information.
See [Writing to the Output Window](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/output-window/output-window#write-to-the-output-window) for more information.
## Extension Class
As described in the [Output Window Display Name Resource ID requirements](./../../../docs/new-extensibility-model/extension-guides/outputWindow/outputWindow.md#display-name-resource-id-requirements), the current version of the Output Window API requires that the display name for the Output Window Channel be stored in a [Resource File](https://docs.microsoft.com/en-us/dotnet/core/extensions/resources) (such as a [`.resx`](https://docs.microsoft.com/en-us/dotnet/core/extensions/resources) resource file.)
As described in the [Output Window Display Name Resource ID requirements](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/output-window/output-window#display-name-resource-id-requirements), the current version of the Output Window API requires that the display name for the Output Window Channel be stored in a [Resource File](https://learn.microsoft.com/dotnet/core/extensions/resources) (such as a [`.resx`](https://learn.microsoft.com/dotnet/core/extensions/resources) resource file.)
In order for the call to `OutputExtensibility.GetChannelAsync()` to find the diaplay name, the resource file must be associated with the [`Extension` Instance](../../inside-the-sdk/extension-anatomy.md#extension-instance) by overriding the `ResourceManager` property.
In order for the call to `OutputExtensibility.GetChannelAsync()` to find the display name, the resource file must be associated with the [`Extension` Instance](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/inside-the-sdk/extension-anatomy#extension-instance) by overriding the `ResourceManager` property.
[`OutputWindowSampleExtension.cs`](OutputWindowSampleExtension.cs) demonstrates this functionality.
## Resources File
The [`Strings.resx`](Strings.resx) file is a [Resource File](https://docs.microsoft.com/en-us/dotnet/core/extensions/resources) that contains the display name of the Output Window Channel for this extension.
The [`Strings.resx`](Strings.resx) file is a [Resource File](https://learn.microsoft.com/dotnet/core/extensions/resources) that contains the display name of the Output Window Channel for this extension.

Просмотреть файл

@ -8,7 +8,7 @@ The extension is composed of two projects: `RegexMatchDebugVisualizer`, the actu
## Creating the extension
The extension project is created as described in the [tutorial document](../../../docs/new-extensibility-model/getting-started/create-your-first-extension.md). You can also reference the [debugger visualizers guide](../../../docs/new-extensibility-model/extension-guides/debuggerVisualizers/debuggerVisualizers.md) for additional information.
The extension project is created as described in the [tutorial document](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/get-started/create-your-first-extension). You can also reference the [debugger visualizers guide](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/debugger-visualizer/debugger-visualizers) for additional information.
## The `Match` visualizer
@ -41,7 +41,7 @@ var regexMatch = await visualizerTarget.ObjectSource.RequestDataAsync<RegexMatch
### Adding the remote user control
We now have to create the `RegexMatchVisualizerUserControl` [class](./RegexMatchDebugVisualizer/RegexMatch/RegexMatchVisualizerUserControl.cs) and its associated [XAML file](./RegexMatchDebugVisualizer/RegexMatch/RegexMatchVisualizerUserControl.xaml). This process is described in the [Remote UI documentation](../../../docs/new-extensibility-model/inside-the-sdk/remote-ui.md).
We now have to create the `RegexMatchVisualizerUserControl` [class](./RegexMatchDebugVisualizer/RegexMatch/RegexMatchVisualizerUserControl.cs) and its associated [XAML file](./RegexMatchDebugVisualizer/RegexMatch/RegexMatchVisualizerUserControl.xaml). This process is described in the [Remote UI documentation](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/inside-the-sdk/remote-ui).
Every time we create a remote user control like `RegexMatchVisualizerUserControl` we need to configure the corresponding XAML file as embedded resource. In this case, since the XAML file is in a subfolder, we also need to use `LogicalName` to make sure the name of the resource matches the full name of the remote user control class. This is all done in the `.csproj` file:
@ -140,7 +140,7 @@ In most cases, having the extension project depend on the visualizer object sour
## The `MatchCollection` visualizer
Now that the `Match` visualizer is complete, we can add a second visualizer for the [`MatchCollection`](https://learn.microsoft.com/en-us/dotnet/api/system.text.regularexpressions.matchcollection) class. The process is exactly the same: create a new [`DebuggerVisualizerProvider`](./RegexMatchDebugVisualizer/RegexMatchCollection/RegexMatchCollectionDebuggerVisualizerProvider.cs) and its [remote user control](./RegexMatchDebugVisualizer/RegexMatchCollection/RegexMatchCollectionVisualizerUserControl.cs). Also, add a new [`VisualizerObjectSource`](./RegexMatchObjectSource/RegexMatchCollectionObjectSource.cs) to the visualizer object source library.
Now that the `Match` visualizer is complete, we can add a second visualizer for the [`MatchCollection`](https://learn.microsoft.com/dotnet/api/system.text.regularexpressions.matchcollection) class. The process is exactly the same: create a new [`DebuggerVisualizerProvider`](./RegexMatchDebugVisualizer/RegexMatchCollection/RegexMatchCollectionDebuggerVisualizerProvider.cs) and its [remote user control](./RegexMatchDebugVisualizer/RegexMatchCollection/RegexMatchCollectionVisualizerUserControl.cs). Also, add a new [`VisualizerObjectSource`](./RegexMatchObjectSource/RegexMatchCollectionObjectSource.cs) to the visualizer object source library.
Each call to `RequestDataAsync` is allowed only 5 seconds to complete before throwing a timeout exception. Since the `MatchCollection` could contain many entries, the visualizer object source uses the `TransferData` method instead of `GetData`: `TransferData` accepts a parameter which allows the visualizer to query the collection entries one by one:

Просмотреть файл

@ -6,7 +6,7 @@ date: 2022-1-20
# Walkthrough: VS Project Query API Extension
This extension demonstrates the most basic usage of the VS Project Query API into commands that query information and updates to the project system.
This extension demonstrates the most basic usage of the [VS Project Query API](https://learn.microsoft.com/visualstudio/extensibility/visualstudio.extensibility/project/project) into commands that query information and updates to the project system.
## Overview
@ -53,7 +53,7 @@ await this.Extensibility.Workspaces().UpdateProjectsAsync(
There are various patterns to query information about the project system, such as querying by project, name, and id.
For the following examples, we will be querying information about [Output Groups](https://learn.microsoft.com/en-us/dotnet/api/envdte.outputgroups?view=visualstudiosdk-2022), a group of built files for the project or the outputs for a project.
For the following examples, we will be querying information about [Output Groups](https://learn.microsoft.com/dotnet/api/envdte.outputgroups?view=visualstudiosdk-2022), a group of built files for the project or the outputs for a project.
### Querying By Project