Unverified Commit 0d50604a authored by Taha Tesser's avatar Taha Tesser Committed by GitHub

[reland] Adding vscode path installed via snap (#81989)

parent 38840b41
...@@ -239,6 +239,7 @@ class VsCode { ...@@ -239,6 +239,7 @@ class VsCode {
// Linux: // Linux:
// /usr/share/code/bin/code // /usr/share/code/bin/code
// /snap/code/current
// /usr/share/code-insiders/bin/code-insiders // /usr/share/code-insiders/bin/code-insiders
// Linux Extensions: // Linux Extensions:
// $HOME/.vscode/extensions // $HOME/.vscode/extensions
...@@ -246,6 +247,7 @@ class VsCode { ...@@ -246,6 +247,7 @@ class VsCode {
static List<VsCode> _installedLinux(FileSystem fileSystem, Platform platform) { static List<VsCode> _installedLinux(FileSystem fileSystem, Platform platform) {
return _findInstalled(<VsCodeInstallLocation>[ return _findInstalled(<VsCodeInstallLocation>[
const VsCodeInstallLocation('/usr/share/code', '.vscode'), const VsCodeInstallLocation('/usr/share/code', '.vscode'),
const VsCodeInstallLocation('/snap/code/current', '.vscode'),
const VsCodeInstallLocation( const VsCodeInstallLocation(
'/usr/share/code-insiders', '/usr/share/code-insiders',
'.vscode-insiders', '.vscode-insiders',
......
...@@ -41,6 +41,19 @@ void main() { ...@@ -41,6 +41,19 @@ void main() {
expect(vsCode.version, Version.unknown); expect(vsCode.version, Version.unknown);
}); });
testWithoutContext('can locate VS Code installed via Snap', () {
final FileSystem fileSystem = MemoryFileSystem.test();
const String home = '/home/me';
final Platform platform = FakePlatform(operatingSystem: 'linux', environment: <String, String>{'HOME': home});
fileSystem.directory(fileSystem.path.join('/snap/code/current/', '.vscode')).createSync(recursive: true);
final FakeProcessManager processManager = FakeProcessManager.list(<FakeCommand>[]);
final List<VsCode> installed = VsCode.allInstalled(fileSystem, platform, processManager);
expect(installed.length, 1);
});
testWithoutContext('can locate installations on macOS', () { testWithoutContext('can locate installations on macOS', () {
final FileSystem fileSystem = MemoryFileSystem.test(); final FileSystem fileSystem = MemoryFileSystem.test();
const String home = '/home/me'; const String home = '/home/me';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment