Skip to content

Conversation

@Tyriar
Copy link
Member

@Tyriar Tyriar commented Jan 1, 2026

Part of #285577

@Tyriar Tyriar added this to the December / January 2026 milestone Jan 1, 2026
@Tyriar Tyriar self-assigned this Jan 1, 2026
Copilot AI review requested due to automatic review settings January 1, 2026 16:19
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds support for the executable bit in the file system API and uses it to filter terminal command completions on Unix-like systems. When completing the first word of a terminal command (the command position), only executable files are now shown as suggestions, improving the relevance of completions.

Key changes:

  • Added FilePermission.Executable enum value and corresponding executable field to file stat interfaces
  • Updated the disk file system provider to detect executable permissions from Unix file mode bits
  • Modified terminal completion service to filter non-executable files when completing commands on Unix systems

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/vs/platform/files/common/files.ts Added Executable enum value to FilePermission and executable field to IBaseFileStat and IFileStatWithMetadata interfaces
src/vs/platform/files/common/fileService.ts Updated toFileStat to extract executable permission from stat permissions
src/vs/platform/files/node/diskFileSystemProvider.ts Implemented detection of executable permission by checking Unix file mode bits (S_IXUSR, S_IXGRP, S_IXOTH)
src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionService.ts Added command position detection and executable file filtering logic for Unix systems
src/vs/workbench/api/common/extHostNotebook.ts Added executable field to file stats returned from notebook save operations
src/vs/workbench/test/common/workbenchTestServices.ts Updated createFileStat test helper to include executable: false
src/vs/workbench/test/browser/workbenchTestServices.ts Added executable: false to test file stat mock
src/vs/workbench/services/workingCopy/test/browser/storedFileWorkingCopy.test.ts Added executable: false to test file stat
src/vs/workbench/services/workingCopy/common/storedFileWorkingCopy.ts Added executable: false to file stats created in working copy operations
src/vs/workbench/services/textfile/common/textFileEditorModel.ts Added executable: false to file stats in text file editor model
src/vs/workbench/services/history/test/browser/historyService.test.ts Added executable: false to test file stat
src/vs/workbench/services/editor/test/browser/editorService.test.ts Added executable: false to test file stat
src/vs/workbench/contrib/chat/test/electron-browser/tools/builtinTools/fetchPageTool.test.ts Added executable: false to test file stat

@Tyriar Tyriar marked this pull request as ready for review January 1, 2026 17:01
@Tyriar Tyriar enabled auto-merge January 1, 2026 17:01
@Tyriar Tyriar disabled auto-merge January 1, 2026 17:01
@Tyriar Tyriar requested a review from bpasero January 1, 2026 17:01
@Tyriar
Copy link
Member Author

Tyriar commented Jan 1, 2026

@bpasero could you review since I touch a bunch of file service stuff?

Copy link
Member

@bpasero bpasero left a comment

Choose a reason for hiding this comment

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

Looks good to me generally, but any chance we could add a test for this to the src/vs/platform/files/test/node/diskFileService.integrationTest.ts suite?. I could think of running it only on POSIX and tampering with the mode on a temporary file and then checking if the relevant executable flag is coming back properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants