Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Essentially, you'll have to remember the state yourself. Most VS language services keep a state cookie for the beginning of each line that they update on text change.</p> <p>At any point, getting classifications (through either a classifier aggregator or tag aggregator) will always result into a call into the current classifiers/taggers, so it won't be returning any type of cached state (or the "last" classifications returned). The editor doesn't really cache this information, and just acts as a dumb pass-through for the information your classifier provides to the visible lines being formatted.</p> <p>Also, If you do it from a classifier (provided by either an IClassifierProvider or ITaggerProvider), you are setting yourself up for some nasty recursion, especially if your classifier responds to <code>GetClassificationSpans</code> by calling into the aggregator (which then calls back into your classifier for some earlier text, etc.). If your classifier <em>needs</em> to consume other classifications to work correctly (and not its own classifications), the only safe way to write that is to:</p> <ol> <li>Implement your "classifier" as an <code>ITagger&lt;IClassificationTag&gt;</code>, and provide it from an <code>IViewTaggerProvider</code>.</li> <li>Grab an <code>ITagAggregator&lt;IClassificationTag&gt;</code> from an <code>IBufferTagAggregatorFactoryService</code>, but only once.</li> <li>Implement <code>IDisposable</code> on your tagger and dispose the tag aggregator in <code>Dispose()</code>.</li> </ol>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload