Interface ICodeLensRefresher

All Known Subinterfaces:
ISaveContext, IWatchedFilesContext
All Known Implementing Classes:
AbstractSaveContext, XMLTextDocumentService.SaveContext

public interface ICodeLensRefresher
Common API for requesting a workspace/codeLens/refresh to be sent to the client after a batch event.

Implemented by contexts that process batches of events where multiple extensions may independently decide that code lenses need updating:

N-to-1 design: Multiple extensions may call requestCodeLensRefresh() for the same event batch. Only one workspace/codeLens/refresh is sent to the client once all participants finish.

  • Method Summary

    Modifier and Type
    Method
    Description
    default boolean
    Returns true if any extension has requested a code lens refresh for the current event batch.
    default void
    Requests a workspace/codeLens/refresh to be sent to the client once all extensions have finished processing the current event batch.
  • Method Details

    • requestCodeLensRefresh

      default void requestCodeLensRefresh()
      Requests a workspace/codeLens/refresh to be sent to the client once all extensions have finished processing the current event batch.

      Multiple extensions may call this for the same batch; only one refresh is sent. The refresh is only sent if the client declared support for it (workspace.codeLens.refreshSupport in client capabilities).

    • isCodeLensRefreshRequested

      default boolean isCodeLensRefreshRequested()
      Returns true if any extension has requested a code lens refresh for the current event batch.

      Called by the host service after all participants finish to decide whether to send workspace/codeLens/refresh.