VS2022 Extension: How to monitor build output window and modify text

Ben Medina 0 Reputation points
2023-05-16T18:52:13.2166667+00:00

I'd like to write a VS2022 extension that monitors the text in the Build output window pane and replaces the text of certain file paths. It is straightforward to get from the DTE to the Build output window pane through existing documentation, like this:

https://learn.microsoft.com/en-us/dotnet/api/envdte.outputwindowpane?view=visualstudiosdk-2022

However, once I have the TextDocument related to the build output, how do I monitor the document for changes? There are no methods on that class related to observing changes.

Thanks for the help in advance!

Visual Studio Extensions
Visual Studio Extensions
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Extensions: A program or program module that adds functionality to or extends the effectiveness of a program.
171 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anna Xiu-MSFT 25,626 Reputation points Microsoft Vendor
    2023-05-17T09:34:24.5633333+00:00

    Hi @Ben Medina, 

    Welcome to Microsoft Q&A! 

    Maybe you can try the TextChanged event. 

    Sincerely,

    Anna


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.