locked
Hidden Regions / Outlining not updated correctly RRS feed

  • Question

  • Hi everyone,

    my custom languageservice implements outlining / hidden regions. Basically, they are displayed correctly most of the time. However, if I press enter at the _exact_ location where a code-region starts, the "old" region is kept and moved down by one line. A new (correct) region is created by the parser which accomodates for the newline. In short, I have one additional region - the old one, which is not correct. Please notice that my parser returns the correct number of regions - the additional one is somehow "kept alive" although it should be removed.

    The below image shall illustrate what I mean. The first version of the function is correct. The second version as well, it shows where the outlining begins, marked with a red arrow. The third version shows the faulty result. One arrow marks the cursor (where a newline was inserted), the other one marks the faulty hidden region, which is _not_ returned by my parser, and shouldn't be there.

    Example Screenshots

    Any ideas what's going wrong here? I looked at various examples and could find anything that I'm doing differently.

    Thanks a lot,
    Max



    • Edited by f_max Tuesday, June 18, 2013 1:26 PM
    Tuesday, June 11, 2013 12:25 PM

Answers

  • Max,

    I have gone straight to our product group and found a developer directly connected to the editor and language service development.  He looked at your post here in this forum, and had the following to say:

    "I've looked at it this but the problem seems to be in their implementation of the outlining service.

    Exactly what it is, however, I can't say without looking at their implementation.

    The obvious point of failure is, inserting a new line, the file is getting reparsed and an outlining region is getting added without removing the old one.

    If they are using the Dev9 (older VS APIs), then they should look at calls to IVsHiddenTextSession.AddHiddenRegions and IVsHiddenRegion.Invalidate().

    If they are using the Dev10 APIs, then they need to look at the implementation of their IOutliningRegionTag tagger & make sure it is raising the appropriate tags changed event.

    Without knowing how they manage their hidden regions, though, I can't even speculate on the root cause of the problem."

    If you would like to create a support case with CTS and share your source, we can give you a more targeted analysis that takes your specific implementation into consideration.

    You can start from the following link to open a support case:

    https://support.microsoft.com/oas/default.aspx?gprid=1117&st=1&wfxredirect=1&sd=gn

    Scot


    Developer Support Engineer

    • Marked as answer by f_max Monday, June 24, 2013 9:20 AM
    Thursday, June 20, 2013 10:15 PM

All replies

  • Hi Max,

    I am trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
     
    Thank you for your understanding and support.

    Best regards,


    Ego [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, June 13, 2013 2:27 AM
  • Max,

    I have gone straight to our product group and found a developer directly connected to the editor and language service development.  He looked at your post here in this forum, and had the following to say:

    "I've looked at it this but the problem seems to be in their implementation of the outlining service.

    Exactly what it is, however, I can't say without looking at their implementation.

    The obvious point of failure is, inserting a new line, the file is getting reparsed and an outlining region is getting added without removing the old one.

    If they are using the Dev9 (older VS APIs), then they should look at calls to IVsHiddenTextSession.AddHiddenRegions and IVsHiddenRegion.Invalidate().

    If they are using the Dev10 APIs, then they need to look at the implementation of their IOutliningRegionTag tagger & make sure it is raising the appropriate tags changed event.

    Without knowing how they manage their hidden regions, though, I can't even speculate on the root cause of the problem."

    If you would like to create a support case with CTS and share your source, we can give you a more targeted analysis that takes your specific implementation into consideration.

    You can start from the following link to open a support case:

    https://support.microsoft.com/oas/default.aspx?gprid=1117&st=1&wfxredirect=1&sd=gn

    Scot


    Developer Support Engineer

    • Marked as answer by f_max Monday, June 24, 2013 9:20 AM
    Thursday, June 20, 2013 10:15 PM
  • Thanks for the response. I was able to solve the problem by calling IVsHiddenRegion.Invalidate() on "old" hidden regions.
    Monday, June 24, 2013 9:20 AM