-
Notifications
You must be signed in to change notification settings - Fork 685
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4038 from JoeRobich/handle-live-share
Do not start OmniSharp server in Live Share scenarios
- Loading branch information
Showing
3 changed files
with
77 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as vscode from 'vscode'; | ||
import { assert } from "chai"; | ||
import { resourcesToLaunchTargets, vsls, vslsTarget } from "../../src/omnisharp/launcher"; | ||
|
||
const chai = require('chai'); | ||
chai.use(require('chai-arrays')); | ||
chai.use(require('chai-fs')); | ||
|
||
suite(`launcher:`, () => { | ||
|
||
test(`Returns the LiveShare launch target when processing vsls resources`, () => { | ||
const testResources: vscode.Uri[] = [ | ||
vscode.Uri.parse(`${vsls}:/test.sln`), | ||
vscode.Uri.parse(`${vsls}:/test/test.csproj`), | ||
vscode.Uri.parse(`${vsls}:/test/Program.cs`), | ||
]; | ||
|
||
const launchTargets = resourcesToLaunchTargets(testResources); | ||
|
||
const liveShareTarget = launchTargets.find(target => target === vslsTarget); | ||
assert.exists(liveShareTarget, "Launch targets was not the Visual Studio Live Share target."); | ||
}); | ||
|
||
test(`Does not return the LiveShare launch target when processing local resources`, () => { | ||
const testResources: vscode.Uri[] = [ | ||
vscode.Uri.parse(`/test.sln`), | ||
vscode.Uri.parse(`/test/test.csproj`), | ||
vscode.Uri.parse(`/test/Program.cs`), | ||
]; | ||
|
||
const launchTargets = resourcesToLaunchTargets(testResources); | ||
|
||
const liveShareTarget = launchTargets.find(target => target === vslsTarget); | ||
assert.notExists(liveShareTarget, "Launch targets contained the Visual Studio Live Share target."); | ||
}); | ||
}); |