Skip to content

Commit 24a2708

Browse files
Merge pull request #13932 from Jxwoon/dev/jasminewoon/removeProjectQueryableSpace
Remove Project Queryable space
2 parents 1ec8a8a + b5197e5 commit 24a2708

File tree

1 file changed

+1
-36
lines changed
  • docs/extensibility/visualstudio.extensibility/project

1 file changed

+1
-36
lines changed

docs/extensibility/visualstudio.extensibility/project/project.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -54,34 +54,19 @@ This overview covers top scenarios for working with the project query API:
5454
- [Action Query to Save a Solution/Project](#action-query-to-save-solutionsprojects)
5555
- [Query to Subscribe to Query Changes](#query-to-subscribe-to-query-changes)
5656
- [Query to Track Query Changes](#query-to-track-query-changes)
57-
- [Events to monitor solution open and close](#events-to-monitor-solution-open-and-close)
5857
- [Action Query to Skip](#action-query-to-skip)
5958

6059
## Access the project query space
6160

6261
You'll need to obtain an instance of the *project query space* object to query the project system. This object has several asynchronous methods that query or update the project system. The term *project query space* and the term *workspace* both mean the same thing and refer to the object that provides access to all the data for a project. `workspace` will be consistently used in this documentation.
6362

64-
There are two approaches to accessing the project query space: **WorkspacesExtensibility** and **ProjectQueryableSpace**.
65-
66-
### Using WorkspacesExtensibility (Recommended)
63+
### Using WorkspacesExtensibility
6764
The `WorkspacesExtensibility` object, built into `Microsoft.VisualStudio.Extensibility`, provides a simple and integrated way to use project query.
6865

6966
```csharp
7067
WorkspacesExtensibility workspace = this.Extensibility.Workspaces();
7168
```
7269

73-
### Using ProjectQueryableSpace
74-
Alternatively, you can use a `ProjectQueryableSpace` object created via a service broker. This approach is useful for scenarios requiring more control or integration with specific services.
75-
76-
```csharp
77-
IServiceBroker serviceBroker = context.Extensibility.ServiceBroker;
78-
ProjectQueryableSpace queryspace = new ProjectQueryableSpace(serviceBroker: serviceBroker, joinableTaskContext: null);
79-
```
80-
81-
In the example above, `context` refers to an instance of `IClientContext` provided by `Microsoft.VisualStudio.Extensibility`. It is used to access contextual information and services related to the current state and environment of the IDE.
82-
83-
For those utilizing the service broker, consult the [Project Query API article for Visual Studio SDK](../../project-visual-studio-sdk.md) for detailed queries.
84-
8570
## Query the project system for a project
8671

8772
The [`WorkspacesExtensibility`](/dotnet/api/microsoft.visualstudio.extensibility.workspacesextensibility) object lets you query for an individual project: if you have the project GUID. There are usually two GUIDs associated with a project, one that represents the project type, and other that uniquely represents the project. You can find the project's unique GUID in the solution file, or from an extension, you can query for the `Guid` property as demonstrated in the next section.
@@ -702,26 +687,6 @@ private class TrackerObserver : IObserver<IQueryTrackUpdates<IFileSnapshot>>
702687
}
703688
```
704689

705-
## Events to monitor solution open and close
706-
707-
The `QueryableSpaceChanged` event can be subscribed to for monitoring when solutions open and close using a workspace created with a service broker. `ProjectQueryableSpaceChangedEventArgs` contains two fields, `SolutionPath` and `QueryableSpaceVersion`. The string `SolutionPath` is the path the solution that opened or null if a solution closed. The int `QueryableSpaceVersion` increments as solutions are opened or closed.
708-
709-
```csharp
710-
private void SubscribeToEvent()
711-
{
712-
IServiceBroker serviceBroker = context.Extensibility.ServiceBroker;
713-
ProjectQueryableSpace workspace = new(serviceBroker: serviceBroker, joinableTaskContext: null);
714-
workspace.QueryableSpaceChanged += EventCalledAsync;
715-
}
716-
717-
private Task EventCalledAsync(ProjectQueryableSpaceChangedEventArgs e)
718-
{
719-
string? solutionPath = e.SolutionPath;
720-
int version = e.QueryableSpaceVersion;
721-
...
722-
}
723-
```
724-
725690
## Action query to skip
726691

727692
`Skip` can be used to skip N results from a query.

0 commit comments

Comments
 (0)