Skip to content
Discussion options

You must be logged in to vote

Hey @jiashengguo,

to not interrupt the normal document lifecycle, it would make sense to basically do the following:

  1. Register a onBuildPhase listener on your document builder instance for the Validated state (i.e. so that the callback runs after a document has been validated)
  2. Look in the references of your document for unresolved references (i.e. those reference with their error not being undefined)
  3. Create a new workspace edit for all missing elements and send them to the client using the workspace/applyEdit LSP endpoint available on the services.lsp.Connection object.

Note that I would not recommend building such an automated solution due to false positives. Let's take the following fo…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jiashengguo
Comment options

Answer selected by jiashengguo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants