Skip to content

Conversation

@MichaReiser
Copy link
Member

@MichaReiser MichaReiser commented Apr 6, 2025

Summary

The priority latency-sensitive is reserved for actions that need to run immediately because they would otherwise block the user's action. An example of this is a format request. VS code blocks the editor until the save action is complete. That's why formatting a document is very sensitive to delays and it's important that we always have a worker thread available to run a format request immediately. Another example are code completions, where it's important that they appear immediately when the user types.

On the other hand, showing diagnostics, hover, or inlay hints has high priority but users are used that the editor takes a few ms to compute the overlay.
Computing this information can also be expensive (e.g. find all references), blocking the worker for quiet some time (a few 100ms). That's why it's important
that those requests don't clog the sensitive worker threads.

@MichaReiser MichaReiser added server Related to the LSP server ty Multi-file analysis & type inference labels Apr 6, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2025

mypy_primer results

No ecosystem changes detected ✅

@MichaReiser MichaReiser force-pushed the micha/lsp-not-sensitive branch from 9add38f to 536cd15 Compare April 6, 2025 08:05
@MichaReiser MichaReiser requested review from dhruvmanila and removed request for AlexWaygood, carljm, dcreager and sharkdp April 6, 2025 08:05
@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2025

ruff-ecosystem results

Linter (stable)

✅ ecosystem check detected no linter changes.

Linter (preview)

✅ ecosystem check detected no linter changes.

@MichaReiser MichaReiser force-pushed the micha/lsp-not-sensitive branch from 536cd15 to 537548f Compare April 6, 2025 08:25
Copy link
Member

@dhruvmanila dhruvmanila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense

@MichaReiser MichaReiser merged commit cb7f56f into main Apr 8, 2025
23 checks passed
@MichaReiser MichaReiser deleted the micha/lsp-not-sensitive branch April 8, 2025 06:33
dcreager added a commit that referenced this pull request Apr 9, 2025
* origin/main:
  [red-knot] Default `python-platform` to current platform (#17183)
  [red-knot] Add new 'unreachable code' test case (#17306)
  [red-knot] mypy_primer: Run on `async-utils` (#17303)
  [red-knot] Add custom `__setattr__` support (#16748)
  [red-knot] Add `__init__` arguments check when doing `try_call` on a class literal (#16512)
  [`flake8-pie`] Avoid false positive for multiple assignment with `auto()` (`PIE796`) (#17274)
  [syntax-errors] Async comprehension in sync comprehension (#17177)
  [`airflow`] Expand module path check to individual symbols (`AIR302`) (#17278)
  [syntax-errors] Check annotations in annotated assignments (#17283)
  [syntax-errors] Extend annotation checks to `await` (#17282)
  [red-knot] Add support for `assert_never` (#17287)
  [`flake8-pytest-style`] Avoid false positive for legacy form of `pytest.raises` (`PT011`) (#17231)
  [red-knot] Do not show types for literal expressions on hover (#17290)
  [red-knot] Fix dead-code clippy warning (#17291)
  [red-knot] Reachability analysis (#17199)
  [red-knot] Don't use latency-sensitive for handlers (#17227)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

server Related to the LSP server ty Multi-file analysis & type inference

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants