title: How to force the update of the code lenses in vscode
body: <p>I am working on "run code" actions using code lenses in <a href="https://github.com/scalameta/metals" rel="nofollow noreferrer">Metals</a> (Scala Language Server). In our use case, we can provide those code lenses only once the compilation finishes. If the user is not modifying the source file during or after the compilation, vscode won't send a request for code lenses. This can lead to an ugly state of "stale code lenses" from before the compilation.</p>
  
  <p>Digging into the internals of vscode-languageserver-node I have noticed that the CodeLensProvider can emit an onDidChangeCodeLenses event but it is not reflected in the LSP (<a href="https://github.com/microsoft/language-server-protocol/issues/192" rel="nofollow noreferrer">https://github.com/microsoft/language-server-protocol/issues/192</a>), hence I cannot send this event to vscode.</p>
  
  <p>The other thing which would probably force reloading code lenses is the ICodeEditor::setModel method but I am not sure if this can be done directly from the vscode extension, since I cannot get a reference to the code editor.</p>
  
  <p>How can this be done from either the Language Server or vscode extension? Or is there another, preferred way?</p>