-
Notifications
You must be signed in to change notification settings - Fork 683
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added the changes for structured documentation * Integration Test Running * Add new test files next to the csproj, not in the root of the workspace * Make it possible for tests to await restore * Enable tests to wait for the omnisharp request queue to be empty * Wait for queue empty in hover test * Added conditions for each field individually * Changes for parameter as an object * Changed to DocumentationItem * Extracted Documentation helper as a function in a separate file * Removed unused variable
- Loading branch information
Showing
10 changed files
with
215 additions
and
43 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
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
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,83 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import * as fs from 'async-file'; | ||
import * as vscode from 'vscode'; | ||
|
||
import poll from './poll'; | ||
import { should, expect } from 'chai'; | ||
import testAssetWorkspace from './testAssets/testAssetWorkspace'; | ||
import { RequestQueueCollection } from '../../src/omnisharp/requestQueue'; | ||
import { OmniSharpServer } from '../../src/omnisharp/server'; | ||
import { omnisharp } from '../../src/omnisharp/extension'; | ||
|
||
const chai = require('chai'); | ||
chai.use(require('chai-arrays')); | ||
chai.use(require('chai-fs')); | ||
|
||
suite(`Tasks generation: ${testAssetWorkspace.description}`, function() { | ||
suiteSetup(async function() { | ||
should(); | ||
|
||
let csharpExtension = vscode.extensions.getExtension("ms-vscode.csharp"); | ||
if (!csharpExtension.isActive) { | ||
await csharpExtension.activate(); | ||
} | ||
|
||
await testAssetWorkspace.cleanupWorkspace(); | ||
|
||
await csharpExtension.exports.initializationFinished; | ||
|
||
await vscode.commands.executeCommand("dotnet.generateAssets"); | ||
|
||
await poll(async () => await fs.exists(testAssetWorkspace.launchJsonPath), 10000, 100); | ||
|
||
}); | ||
|
||
|
||
test("Hover returns structured documentation with proper newlines", async function () { | ||
|
||
let program = | ||
`using System; | ||
namespace Test | ||
{ | ||
class testissue | ||
{ | ||
///<summary>Checks if object is tagged with the tag.</summary> | ||
/// <param name="gameObject">The game object.</param> | ||
/// <param name="tagName">Name of the tag.</param> | ||
/// <returns>Returns <c> true</c> if object is tagged with tag.</returns> | ||
public static bool Compare(int gameObject,string tagName) | ||
{ | ||
return true; | ||
} | ||
} | ||
}`; | ||
let fileUri = await testAssetWorkspace.projects[0].addFileWithContents("test1.cs", program); | ||
|
||
await omnisharp.waitForEmptyEventQueue(); | ||
|
||
await vscode.commands.executeCommand("vscode.open", fileUri); | ||
|
||
let c = await vscode.commands.executeCommand("vscode.executeHoverProvider", fileUri,new vscode.Position(10,29)); | ||
|
||
let answer:string = | ||
`Checks if object is tagged with the tag. | ||
Parameters: | ||
\t\tgameObject: The game object. | ||
\t\ttagName: Name of the tag. | ||
Returns trueif object is tagged with tag.`; | ||
expect(c[0].contents[0].value).to.equal(answer); | ||
}); | ||
|
||
teardown(async() => | ||
{ | ||
await testAssetWorkspace.cleanupWorkspace(); | ||
}) | ||
}); |
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
Oops, something went wrong.