Chat Variable for All Open Editors #15775
Merged
+91
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What it does
This PR adds a new variable contribution that provides access to all currently open files in the workspace. The implementation includes:
openFilesRelative
variable inpackages/workspace/src/browser/workspace-variable-contribution.ts
that returns a comma-separated list of all currently open files as workspace-relative paths_ff
registered inpackages/ai-core/src/browser/theia-variable-contribution.ts
following the established pattern used by the existing_f
variableThe variables resolve to a string format like:
'src/file1.ts', 'src/folder with spaces/file2.ts', 'src/component.tsx'
This enables users to reference all open files in variable substitution contexts, similar to how
_f
/relativeFile
provides access to the current file.How to test
#openFilesRelative
or#_ff
in the chat.Follow-ups
None identified. The implementation follows established patterns and integrates cleanly with the existing variable resolution system.
Breaking changes
Attribution
Review checklist
Reminder for reviewers