Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename LaunchTarget.kind to not conflict with VSCode separators. #4914

Merged
merged 1 commit into from
Dec 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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`");
});
});