Skip to content

Dynamic registration of file operations is ignored, although fileOperations.dynamicRegistration is announced #2251

Done

Description

@lagergren

What happens

LSP4IJ announces workspace.fileOperations.dynamicRegistration: true (ClientCapabilitiesFactory, line 88). But a server that registers file operations dynamically never gets them. LSP4IJ doesn't send workspace/didCreateFiles, didRenameFiles, didDeleteFiles or willRenameFiles to it, so the server never learns of created, renamed or deleted files, and a rename doesn't apply the server's edits.

Cause

LanguageServerWrapper.registerCapability handles these registrations:

  • workspace/didChangeWorkspaceFolders;
  • workspace/didChangeWatchedFiles;
  • workspace/textDocumentContent;
  • workspace/executeCommand;
  • text document features, through LSPClientFeatures.getCapabilityRegistry.

It has no branch for the file operation methods: workspace/willCreateFiles, didCreateFiles, willRenameFiles, didRenameFiles, willDeleteFiles and didDeleteFiles. Their FileOperationRegistrationOptions are dropped, and LSP4IJ only uses the file operation filters of the server's static capabilities.

Fix

Register the filters of a dynamic file operation registration next to the static ones, and remove them on unregisterCapability, for the operations that LSP4IJ supports. That's willCreate and willDelete only once those are announced. Otherwise, announce dynamicRegistration: false. Test it with a mock server that registers workspace/didRenameFiles dynamically, and check that a rename is sent to it.

Activity

  1. added
    bug
    on Nov 25, 2026
  2. added this to the 0.30.2 milestone on Nov 25, 2026
  3. added a commit that references this issue on Nov 26, 2026
    ef32b1f
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

    bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions