unified-language-server icon indicating copy to clipboard operation
unified-language-server copied to clipboard

Smarter file processing

Open wooorm opened this issue 3 years ago • 6 comments

Initial checklist

Problem

workspace/didChangeWatchedFiles means a file or folder changed. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWatchedFiles. Instead of reprocessing every markdown file (https://github.com/unifiedjs/unified-language-server/blob/f222a6552e04c50c4bf6933b0539898ece9c47ff/lib/index.js#L264).

Solution

perhaps we should use cheap hashes to ensure we only perform work when something changed.

Alternatives

n/a

wooorm avatar Jan 07 '22 17:01 wooorm

Problem

workspace/didChangeWatchedFiles means a file or folder changed. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_didChangeWatchedFiles. Instead of reprocessing every markdown file

This doesn’t mean a file has changed. It means a watched file has changed.

How this is used can be seen in remark-vscode: https://github.com/remarkjs/vscode-remark/blob/2f1cb9916651e1cb19ede823f2bf0ffdb3aa8af8/src/extension.js#L27-L32

So if a configuration file changes, all documents are checked again.

remcohaszing avatar Jan 10 '22 11:01 remcohaszing

That is an important caveat that seems like it’s something that should be in a comment next to the function?

wooorm avatar Jan 10 '22 11:01 wooorm

Maybe in the readme for workspace/didChangeWatchedFiles add somethink like:

Clients are expected to watch the remark configuration files.

remcohaszing avatar Jan 10 '22 11:01 remcohaszing

I’m okay on that too, but probably also perhaps a new section (Client?) on how to make a client (because Use should be one basic example, and API should be just about options)

wooorm avatar Jan 10 '22 13:01 wooorm

I think that’s basically what the Language Server features section is.

remcohaszing avatar Jan 10 '22 13:01 remcohaszing

It is the items in that list, and could be that section, but the current wording is different than what I’m looking for. That section currently explains what the code is doing.

I’m looking for a list that explains what requests and notifications, must/should/could be sent, and when, by clients. And a list of things that are sent by the server back to the client, and how the client should respond to that.

wooorm avatar Jan 10 '22 14:01 wooorm

Hi! This was closed. Team: If this was fixed, please add phase/solved. Otherwise, please add one of the no/* labels.

github-actions[bot] avatar Sep 25 '23 13:09 github-actions[bot]