denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.06k stars 5.14k forks source link

refactor(lsp): cleanup partially locking methods #23723

Closed nayeemrmn closed 1 week ago

nayeemrmn commented 1 week ago

Implementations of LanguageServer::{initialize,did_open,did_save}() are completely moved to their Inner::_() counterparts. Inner::{did_change_workspace_folders,did_change_configuration}() are inlined in their LanguageServer::_() counterparts so the behaviour is easier to track.

Also client.publish_diagnostics() can be used without OutsideLockClient, since it's a notification not a request.

I added a Performance::measure_scope() utility which auto-measures on drop to support early returns in did_save(). Let's try it out.