Repository navigation
Closed
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Description
File operations: when the user renames, creates or deletes a spec in the explorer, the server fixes what points at it. TypeScript's import-updating rename is the feature people name when they say a server "just works". Part of the LSP epic, Refs #12209 (wave 1, standard features). Only .t27: no code in any other language, not even scratch probes or a loader; see skill only-t27.
Depends on specs/lsp/index.t27 (who uses the module) and specs/lsp/rename.t27 (the use rewrite).
Prior art:
- tsserver:
workspace/willRenameFilesreturns the import edits: https://github.com/typescript-language-server/typescript-language-server - gopls: renaming a package directory updates the importers: https://go.dev/gopls/
- LSP
workspace/willCreateFiles,didCreateFiles,willRenameFiles,didRenameFiles,willDeleteFiles,didDeleteFilesand their file operation filters: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/
Boundary
- specs/lsp/file_ops.t27
User Scenarios
- Given
specs/numeric/gf.t27is renamed tospecs/numeric/golden.t27in the explorer, when the client sendsworkspace/willRenameFiles, then the answer is aWorkspaceEditthat rewrites theuselines in every dependent and themoduleheader if it names the old file. - Given a new empty file
specs/x/new.t27, when the client sendsworkspace/willCreateFiles, then the answer inserts a header: themoduleline, a comment for the purpose and an emptytestblock, matching the name of the file. - Given a spec that 4 others use is deleted, when
willDeleteFilesarrives, then the server returns a message request listing the 4 dependents and the edit that removes theiruselines is offered, never applied silently. - Given a folder is renamed, when the request arrives, then every spec under it is handled as a rename and the edits do not overlap.
- Given the
did*notifications, when they arrive after the operation, then the index and the store reflect the new paths.
Requirements
- FR-001: The module MUST implement all six notifications and requests, with file operation filters (glob
**/*.t27, files and folders) registered in the server capabilities. - FR-002: Rename edits MUST use
documentChangesand a change annotation that needs confirmation, and MUST be computed from the index, not from a text search. - FR-003: The header template for a new file MUST be one constant in the module that
t27cconformance (modulefirst, an English comment, atestblock) accepts; a test compiles the template. - FR-004: Deleting MUST never apply an edit by itself; it offers actions only.
- FR-005: After a
didRenameFilesthe index MUST contain no entry under the old path.
Success Criteria
- At least 20 tests in
specs/lsp/file_ops.t27pass, run on the lab witht27c test-report(exit 0), including the folder rename and the template compile. - A negative control renames a file that nobody uses and asserts the edit is empty.
git diff --name-only masterlists onlyspecs/lsp/file_ops.t27(0 files in other languages).
Metadata
Metadata
Assignees
Labels
area/specs.t27 spec files and conformance.t27 spec files and conformanceenhancementNew feature or requestNew feature or requestspec
Activity
gHashTag commentedon Nov 17, 2026
LSP spec created (typecheck OK, tests pass).