Skip to content

Commit 1edfe70

Browse files
sailroGitHub Enterprise
authored andcommitted
Merge branch 'version-2.0.22' into platform-defines
2 parents bd51a6c + d687665 commit 1edfe70

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

Packages/com.unity.ide.visualstudio/Editor/VisualStudioCodeInstallation.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,8 @@ public static IEnumerable<IVisualStudioInstallation> GetVisualStudioInstallation
176176
#if UNITY_EDITOR_LINUX
177177
private static readonly Regex DesktopFileExecEntry = new Regex(@"Exec=(\S+)", RegexOptions.Singleline | RegexOptions.Compiled);
178178

179-
private static IEnumerable<string> GetXdgCandidates() {
179+
private static IEnumerable<string> GetXdgCandidates()
180+
{
180181
var envdirs = Environment.GetEnvironmentVariable("XDG_DATA_DIRS");
181182
if (string.IsNullOrEmpty(envdirs))
182183
yield break;
@@ -186,14 +187,17 @@ private static IEnumerable<string> GetXdgCandidates() {
186187
{
187188
Match match = null;
188189

189-
try {
190+
try
191+
{
190192
var desktopFile = IOPath.Combine(dir, "applications/code.desktop");
191193
if (!File.Exists(desktopFile))
192194
continue;
193195

194196
var content = File.ReadAllText(desktopFile);
195197
match = DesktopFileExecEntry.Match(content);
196-
} catch {
198+
}
199+
catch
200+
{
197201
// do not fail if we cannot read desktop file
198202
}
199203

0 commit comments

Comments
 (0)