Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Add middleware to intercept textDocument/publishDiagnostics #322
It is currently not possible for a client to inspect the contents of the
referenced this pull request
Mar 18, 2018
@rcjsuen thanks for the PR. There is one thing I am not sure of how we should do it: the middleware API currently uses VS Code API types only. With this PR it will surface LSP types. Although this allows to intercept the notification as early as possible I would nevertheless change the types to VS Code API types. In the implementation that means we first convert the LSP data into VS Code data and then call the middleware.
@dbaeumer Hi Dirk, thanks for the review.
Should I still use
publishDiagnostics?: NextSignature<PublishDiagnosticsParams, void>;
publishDiagnostics?: NextSignature<Uri, VDiagnostic, void>;
But this won't compile because
Or should I instead write a new function like the following and just introduce a new
handleDiagnostics?: (this: void, uri: Uri, diagnostic: VDiagnostics, next: HandleDiagnosticsSignature) => void;