![]() A threshold between events is used for notification simplification and duplicate reduction. Files matching the "ExcludedItems" setting will not produce file notification events. ExportFileContextActionProviderAttribute exports the type IWorkspaceProviderFactory.Ī workspace listens to file change notifications and provides the IFileWatcherService via GetFileWatcherService.IFileContextActionProvider creates instances of IFileContextAction.IFileContextAction executes some behavior based on a FileContext.Instead, the IFileContextAction must cast the argument to another type as necessary for the scenario.įor information on the types supplied by Visual Studio, see the respective scenario's documentation. IFileContextActionProgressUpdate is an empty interface, and invoking IProgress.Report(IFileContextActionProgressUpdate) might throw NotImplementedException. The ExecuteAsync method is passed IProgress, but the argument shouldn't be used as that type. Two of its most common cases are building and debugging. IFileContextAction is flexible in its usage. While a FileContext itself is just data about some file(s), an IFileContextAction is a way to express and act on that data. BuildContextTypes defines build context types that Open Folder will consume. ![]() GetFileContextsAsync is used for consumers to get file contexts.ExportFileContextProviderAttribute exports a file context provider.IFileContextProvider and IFileContextProvider create the file context.These actions make many build context type requests. Examples include opening an editor tab and opening a Solution Explorer context menu. ![]() Some UI interactions are synchronous and rely on a high volume of FileContext requests. Any consumers still referencing that FileContext can then requery for a new FileContext.īe cautious of other ways your FileContext might be expensive to compute. For example, if a build context is provided for some file but an on-disk change invalidates that context, then the original producer can invoke the event. The provider can fire an event on the FileContext to notify consumers of updates. Consumers might request a context and perform some short-term action based on the context, while others might request a context and maintain a long lived reference.Ĭhanges might happen to files that cause a file context to become outdated. The IWorkspace instance acts as the middle-man between the consumer and providers through the GetFileContextsAsync method. Providers that support some subset of the request context types will be queried. At any time, a component can asynchronously request for some set of context types. Lifecycles for a FileContext are non-deterministic. For more information, see the other topics related to these scenarios. The most common scenarios for file contexts are related to build, debug, and language services. A given file or folder may be associated with any number of file contexts. ![]() Once defined, a file context can be associated with any number of files or folders in the workspace. A file context provider is exported with metadata that identifies which file context Guids it may produce data for. A workspace uses this Guid later to match it up with extensions that consume the data through the Context property. A file context by itself does not perform any action, but rather provides data that another extension can then act on.Įach FileContext has a Guid associated with it that identifies the type of data it carries. in order to accumulate the insights they need to define a file context. These extensions might look for patterns in folders or files, read MSBuild files and makefiles, detect package dependencies, etc. Applies to: Visual Studio Visual Studio for Mac Visual Studio CodeĪll insights into Open Folder workspaces are produced by "file context providers" that implement the IFileContextProvider interface. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |