Support refreshing single files in diagnostic pull · Issue #1669 · microsoft/vscode-languageserver-node · GitHub
Skip to content

Support refreshing single files in diagnostic pull #1669

Open

Description

@rchiodo

In this code here, workspace diagnostics is repolling every 2 seconds:

This makes Pylance continuously do analysis. At least for items that don't seem to save the fact that there are no errors. (Previous result ids don't exist for files that aren't open, but workspace mode asks for all files).

I'm not sure if the polling is as design (might be) but missing the previous result id seems like a bug?

For example, in the issue where we found this:
microsoft/pylance-release#7499

The user has a single file open.

Our result contains all files though. The next poll request only has a previous result id for the file that's open. If all previous results were passed, we would mark the next request as unchanged, but we can't because of the missing result ids for the unopened files.

Activity

  1. dbaeumer commented on Aug 19, 2025

    @dbaeumer
    Member

    Rich Chiodo (@rchiodo) the idea of workspace pull is that you as long as possible keep the request open (don't return a response and stream results on file changes into the request). Are you closing the request after every pull?

  2. rchiodo commented on Aug 19, 2025

    @rchiodo
    ContributorAuthor

    Oh, we just return as soon as we have all of the results. So, we should be using partial results?

    That seems like push mode instead of pull.

  3. dbaeumer commented on Aug 22, 2025

    @dbaeumer
    Member

    That seems like push mode instead of pull.

    It is a long running pull. There is no indication on the client side to when trigger a new pull. That is why it is implemented that way.

  4. rchiodo commented on Aug 22, 2025

    @rchiodo
    ContributorAuthor

    The refresh request indicates to the client that a new pull is required? I guess we could just use the spots where we ask for a refresh to instead send more progress, but for workspace diagnostics, we'll essentially have the same logic we have for push mode.

  5. dbaeumer commented on Aug 28, 2025

    @dbaeumer
    Member

    The difference to the old model is that the file and workspace pull are coordinated.

    I am open for a feature that only pulls once and then waits for a refresh.

  6. rchiodo commented on Aug 28, 2025

    @rchiodo
    ContributorAuthor

    I've reimplemented our workspace diagnostics to use the partial results model and it seems better. We don't reanalyze everything on the refresh. Instead, we just send changes as they happen.

    So, I'm not sure how it could be better. Maybe if there was a way to say 'refresh this file'? We know which ones need to have analysis redone, but maybe that's not the same for all language servers.

  7. parsa2000200 commented on Sep 2, 2025

    @parsa2000200

    In this code here, workspace diagnostics is repolling every 2 seconds:

    This makes Pylance continuously do analysis. At least for items that don't seem to save the fact that there are no errors. (Previous result ids don't exist for files that aren't open, but workspace mode asks for all files).

    I'm not sure if the polling is as design (might be) but missing the previous result id seems like a bug?

    For example, in the issue where we found this:
    microsoft/pylance-release#7499

    The user has a single file open.

    Our result contains all files though. The next poll request only has a previous result id for the file that's open. If all previous results were passed, we would mark the next request as unchanged, but we can't because of the missing result ids for the unopened files.

  8. changed the title [-]Workspace diagnostics continually poll[/-] [+]Support refreshing single files in diagnostic pull[/+] on Dec 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions