Skip to content

Commit

Permalink
Merge pull request #4914 from JoeRobich/fix-quick-pick
Browse files Browse the repository at this point in the history
Rename LaunchTarget.kind to not conflict with VSCode separators.
  • Loading branch information
JoeRobich authored Dec 4, 2021
2 parents 8d8e9cc + 2510007 commit 5103f49
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
18 changes: 9 additions & 9 deletions src/omnisharp/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ export interface LaunchTarget {
description: string;
directory: string;
target: string;
kind: LaunchTargetKind;
workspaceKind: LaunchTargetKind;
}

export const vslsTarget: LaunchTarget = {
label: "VSLS",
description: "Visual Studio Live Share",
directory: "",
target: "",
kind: LaunchTargetKind.LiveShare
workspaceKind: LaunchTargetKind.LiveShare
};

/** Live share scheme */
Expand Down Expand Up @@ -144,7 +144,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: vscode.workspace.asRelativePath(dirname),
target: resource.fsPath,
directory: path.dirname(resource.fsPath),
kind: LaunchTargetKind.Solution
workspaceKind: LaunchTargetKind.Solution
});
}
// Add project.json files
Expand All @@ -156,7 +156,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: vscode.workspace.asRelativePath(dirname),
target: dirname,
directory: dirname,
kind: LaunchTargetKind.ProjectJson
workspaceKind: LaunchTargetKind.ProjectJson
});
}
// Add .csproj files
Expand All @@ -170,7 +170,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: vscode.workspace.asRelativePath(dirname),
target: dirname,
directory: dirname,
kind: LaunchTargetKind.Project
workspaceKind: LaunchTargetKind.Project
});
}
else {
Expand Down Expand Up @@ -198,7 +198,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: 'All contained projects',
target: folderPath,
directory: folderPath,
kind: LaunchTargetKind.Folder
workspaceKind: LaunchTargetKind.Folder
});
}

Expand All @@ -209,7 +209,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: path.basename(folderPath),
target: folderPath,
directory: folderPath,
kind: LaunchTargetKind.Csx
workspaceKind: LaunchTargetKind.Csx
});
}

Expand All @@ -220,7 +220,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: path.basename(folderPath),
target: folderPath,
directory: folderPath,
kind: LaunchTargetKind.Cake
workspaceKind: LaunchTargetKind.Cake
});
}

Expand All @@ -230,7 +230,7 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
description: '',
target: folderPath,
directory: folderPath,
kind: LaunchTargetKind.Folder
workspaceKind: LaunchTargetKind.Folder
});
}
});
Expand Down
4 changes: 2 additions & 2 deletions src/omnisharp/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export class OmniSharpServer {
return;
}

if (launchTarget.kind === LaunchTargetKind.LiveShare) {
if (launchTarget.workspaceKind === LaunchTargetKind.LiveShare) {
this.eventStream.post(new ObservableEvents.OmnisharpServerMessage("During Live Share sessions language services are provided by the Live Share server."));
return;
}
Expand Down Expand Up @@ -562,7 +562,7 @@ export class OmniSharpServer {
// To maintain previous behavior when there are mulitple targets available,
// launch with first Solution or Folder target.
const firstFolderOrSolutionTarget = launchTargets
.find(target => target.kind == LaunchTargetKind.Folder || target.kind == LaunchTargetKind.Solution);
.find(target => target.workspaceKind == LaunchTargetKind.Folder || target.workspaceKind == LaunchTargetKind.Solution);
if (firstFolderOrSolutionTarget) {
return this.restart(firstFolderOrSolutionTarget);
}
Expand Down
4 changes: 2 additions & 2 deletions test/integrationTests/launcher.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ suite(`launcher:`, () => {

const launchTargets = resourcesAndFolderMapToLaunchTargets(testResources, workspaceFolders, folderMap);

const solutionTarget = launchTargets.find(target => target.kind === LaunchTargetKind.Solution && target.label === "test.sln");
const solutionTarget = launchTargets.find(target => target.workspaceKind === LaunchTargetKind.Solution && target.label === "test.sln");
assert.exists(solutionTarget, "Launch targets did not include `/test.sln`");

const projectTarget = launchTargets.find(target => target.kind === LaunchTargetKind.Project && target.label === "test.csproj");
const projectTarget = launchTargets.find(target => target.workspaceKind === LaunchTargetKind.Project && target.label === "test.csproj");
assert.exists(projectTarget, "Launch targets did not include `/test/test.csproj`");
});
});

0 comments on commit 5103f49

Please sign in to comment.