Skip to content

Commit

Permalink
Added vscode-insiders path installed via snap (#137117)
Browse files Browse the repository at this point in the history
Closes  #137116

<b>Before</b>
VS Code Insiders installed via Snap isn't detected.

<b>After</b>
```sh
[�] VS Code (version 1.84.0-insider)
    � VS Code at /snap/code-insiders/current/usr/share/code-insiders
    � Flutter extension version 3.75.20231002
```
  • Loading branch information
KristijanZic authored Dec 1, 2023
1 parent 7d9010c commit cf71a55
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions packages/flutter_tools/lib/src/vscode/vscode.dart
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ class VsCode {
// /usr/share/code/bin/code
// /snap/code/current/usr/share/code
// /usr/share/code-insiders/bin/code-insiders
// /snap/code-insiders/current/usr/share/code-insiders
// Linux Extensions:
// $HOME/.vscode/extensions
// $HOME/.vscode-insiders/extensions
Expand All @@ -251,6 +252,10 @@ class VsCode {
'/usr/share/code-insiders',
'.vscode-insiders',
),
const VsCodeInstallLocation(
'/snap/code-insiders/current/usr/share/code-insiders',
'.vscode-insiders',
),
], fileSystem, platform);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,12 @@ void main() {
final Platform platform = FakePlatform(environment: <String, String>{'HOME': home});

fileSystem.directory(fileSystem.path.join('/snap/code/current/usr/share/code', '.vscode')).createSync(recursive: true);
fileSystem.directory(fileSystem.path.join('/snap/code-insiders/current/usr/share/code-insiders', '.vscode-insiders')).createSync(recursive: true);

final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[]);

final List<VsCode> installed = VsCode.allInstalled(fileSystem, platform, processManager);
expect(installed.length, 1);
expect(installed.length, 2);
});

testWithoutContext('can locate installations on macOS', () {
Expand Down

0 comments on commit cf71a55

Please sign in to comment.