Format source to make it consistent

This commit is contained in:
Joey Robichaud 2020-04-20 14:58:52 -07:00
Родитель 506e534d1b
Коммит a8ba6b5394
90 изменённых файлов: 460 добавлений и 487 удалений

Просмотреть файл

@ -18,14 +18,14 @@ require('./tasks/coverageTasks');
// Disable warning about wanting an async function
// tslint:disable-next-line
gulp.task('generateOptionsSchema', () : Promise<void> => {
gulp.task('generateOptionsSchema', (): Promise<void> => {
optionsSchemaGenerator.GenerateOptionsSchema();
return Promise.resolve();
});
// Disable warning about wanting an async function
// tslint:disable-next-line
gulp.task('updatePackageDependencies', () : Promise<void> => {
gulp.task('updatePackageDependencies', (): Promise<void> => {
return packageDependencyUpdater.updatePackageDependencies();
});

Просмотреть файл

@ -6,8 +6,8 @@
import { Advisor } from "./features/diagnosticsProvider";
import { EventStream } from "./EventStream";
export default interface CSharpExtensionExports {
export default interface CSharpExtensionExports {
initializationFinished: () => Promise<void>;
getAdvisor: () => Promise<Advisor>;
eventStream: EventStream;
}
}

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { Subject , Subscription } from "rxjs";
import { Subject, Subscription } from "rxjs";
import { BaseEvent } from "./omnisharp/loggingEvents";
export class EventStream {

Просмотреть файл

@ -60,8 +60,7 @@ export async function execChildProcess(command: string, workingDirectory: string
export async function getUnixChildProcessIds(pid: number): Promise<number[]> {
return new Promise<number[]>((resolve, reject) => {
let ps = cp.exec('ps -A -o ppid,pid', (error, stdout, stderr) =>
{
let ps = cp.exec('ps -A -o ppid,pid', (error, stdout, stderr) => {
if (error) {
return reject(error);
}

Просмотреть файл

@ -35,8 +35,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
const solutionPathOrFolder: string = this.server.getSolutionPathOrFolder();
// Make sure folder, folder.uri, and solutionPathOrFolder are defined.
if (!solutionPathOrFolder)
{
if (!solutionPathOrFolder) {
return Promise.resolve(false);
}
@ -45,8 +44,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
return fs.lstat(solutionPathOrFolder).then(stat => {
return stat.isFile();
}).then(isFile => {
if (isFile)
{
if (isFile) {
serverFolder = path.dirname(solutionPathOrFolder);
}
@ -73,9 +71,8 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
return [];
}
try
{
let hasWorkspaceMatches : boolean = await this.checkWorkspaceInformationMatchesWorkspaceFolder(folder);
try {
let hasWorkspaceMatches: boolean = await this.checkWorkspaceInformationMatchesWorkspaceFolder(folder);
if (!hasWorkspaceMatches) {
vscode.window.showErrorMessage(`Cannot create .NET debug configurations. The active C# project is not within folder '${folder.uri.fsPath}'.`);
return [];
@ -86,8 +83,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
const generator = new AssetGenerator(info, folder);
if (generator.hasExecutableProjects()) {
if (!await generator.selectStartupProject())
{
if (!await generator.selectStartupProject()) {
return [];
}
@ -95,7 +91,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
await fs.ensureDir(generator.vscodeFolder);
// Add a tasks.json
const buildOperations : AssetOperations = await getBuildOperations(generator);
const buildOperations: AssetOperations = await getBuildOperations(generator);
await addTasksJsonIfNecessary(generator, buildOperations);
const programLaunchType = generator.computeProgramLaunchType();
@ -153,14 +149,12 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
*/
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
if (!config.type)
{
if (!config.type) {
// If the config doesn't look functional force VSCode to open a configuration file https://github.com/Microsoft/vscode/issues/54213
return null;
}
if (config.request === "launch")
{
if (config.request === "launch") {
if (!config.cwd && !config.pipeTransport) {
config.cwd = "${workspaceFolder}";
}

Просмотреть файл

@ -5,13 +5,11 @@
import * as fs from 'fs-extra';
export class ParsedEnvironmentFile
{
export class ParsedEnvironmentFile {
public Env: { [key: string]: any };
public Warning: string | null;
private constructor(env: { [key: string]: any }, warning: string | null)
{
private constructor(env: { [key: string]: any }, warning: string | null) {
this.Env = env;
this.Warning = warning;
}
@ -24,7 +22,7 @@ export class ParsedEnvironmentFile
public static CreateFromContent(content: string, envFile: string, initialEnv: { [key: string]: any } | undefined): ParsedEnvironmentFile {
// Remove UTF-8 BOM if present
if(content.charAt(0) === '\uFEFF') {
if (content.charAt(0) === '\uFEFF') {
content = content.substr(1);
}
@ -60,7 +58,7 @@ export class ParsedEnvironmentFile
// show error message if single lines cannot get parsed
let warning: string = null;
if(parseErrors.length !== 0) {
if (parseErrors.length !== 0) {
warning = "Ignoring non-parseable lines in envFile " + envFile + ": ";
parseErrors.forEach(function (value, idx, array) {
warning += "\"" + value + "\"" + ((idx !== array.length - 1) ? ", " : ".");

Просмотреть файл

@ -75,7 +75,7 @@ async function completeDebuggerInstall(platformInformation: PlatformInformation,
});
}
function showInstallErrorMessage(eventStream : EventStream) {
function showInstallErrorMessage(eventStream: EventStream) {
eventStream.post(new DebuggerNotInstalledFailure());
vscode.window.showErrorMessage("An error occurred during installation of the .NET Core Debugger. The C# extension may need to be reinstalled.");
}
@ -125,8 +125,7 @@ export async function getAdapterExecutionCommand(platformInfo: PlatformInformati
// install.Lock does not exist, need to wait for packages to finish downloading.
let installLock = false;
let debuggerPackage = getRuntimeDependencyPackageWithId("Debugger", packageJSON, platformInfo, extensionPath);
if (debuggerPackage && debuggerPackage.installPath)
{
if (debuggerPackage && debuggerPackage.installPath) {
installLock = await common.installFileExists(debuggerPackage.installPath, common.InstallFileType.Lock);
}

Просмотреть файл

@ -29,13 +29,13 @@ export namespace DebuggerEventsProtocol {
}
// Decodes a packet received from the debugger into an event
export function decodePacket(packet: Buffer) : DebuggerEvent {
export function decodePacket(packet: Buffer): DebuggerEvent {
// Verify the message ends in a newline
if (packet[packet.length-1] != 10 /*\n*/) {
if (packet[packet.length - 1] != 10 /*\n*/) {
throw new Error("Unexpected message received from debugger.");
}
const message = packet.toString('utf-8', 0, packet.length-1);
const message = packet.toString('utf-8', 0, packet.length - 1);
return JSON.parse(message);
}
}

Просмотреть файл

@ -11,8 +11,7 @@ import { execChildProcess } from './../common';
const MINIMUM_SUPPORTED_DOTNET_CLI: string = '1.0.0';
export class DotnetInfo
{
export class DotnetInfo {
public Version: string;
public OsVersion: string;
public RuntimeId: string;
@ -23,8 +22,7 @@ export class DotNetCliError extends Error {
public ErrorString: string; // the string to log for this error
}
export class CoreClrDebugUtil
{
export class CoreClrDebugUtil {
private _extensionDir: string = '';
private _debugAdapterDir: string = '';
private _installCompleteFilePath: string = '';
@ -36,8 +34,7 @@ export class CoreClrDebugUtil
}
public extensionDir(): string {
if (this._extensionDir === '')
{
if (this._extensionDir === '') {
throw new Error('Failed to set extension directory');
}
return this._extensionDir;
@ -51,14 +48,13 @@ export class CoreClrDebugUtil
}
public installCompleteFilePath(): string {
if (this._installCompleteFilePath === '')
{
if (this._installCompleteFilePath === '') {
throw new Error('Failed to set install complete file path');
}
return this._installCompleteFilePath;
}
public static async writeEmptyFile(path: string) : Promise<void> {
public static async writeEmptyFile(path: string): Promise<void> {
return new Promise<void>((resolve, reject) => {
fs.writeFile(path, '', (err) => {
if (err) {
@ -78,8 +74,7 @@ export class CoreClrDebugUtil
// is new enough for us.
// Returns: a promise that returns a DotnetInfo class
// Throws: An DotNetCliError() from the return promise if either dotnet does not exist or is too old.
public async checkDotNetCli(): Promise<DotnetInfo>
{
public async checkDotNetCli(): Promise<DotnetInfo> {
let dotnetInfo = new DotnetInfo();
return execChildProcess('dotnet --info', process.cwd())
@ -103,8 +98,7 @@ export class CoreClrDebugUtil
throw dotnetError;
}).then(() => {
// succesfully spawned 'dotnet --info', check the Version
if (semver.lt(dotnetInfo.Version, MINIMUM_SUPPORTED_DOTNET_CLI))
{
if (semver.lt(dotnetInfo.Version, MINIMUM_SUPPORTED_DOTNET_CLI)) {
let dotnetError = new DotNetCliError();
dotnetError.ErrorMessage = 'The .NET Core SDK located on the path is too old. .NET Core debugging will not be enabled. The minimum supported version is ' + MINIMUM_SUPPORTED_DOTNET_CLI + '.';
dotnetError.ErrorString = "dotnet cli is too old";
@ -115,13 +109,13 @@ export class CoreClrDebugUtil
});
}
public static isMacOSSupported() : boolean {
public static isMacOSSupported(): boolean {
// .NET Core 2.0 requires macOS 10.12 (Sierra), which is Darwin 16.0+
// Darwin version chart: https://en.wikipedia.org/wiki/Darwin_(operating_system)
return semver.gte(os.release(), "16.0.0");
}
public static existsSync(path: string) : boolean {
public static existsSync(path: string): boolean {
try {
fs.accessSync(path, fs.constants.F_OK);
return true;
@ -134,7 +128,7 @@ export class CoreClrDebugUtil
}
}
public static getPlatformExeExtension() : string {
public static getPlatformExeExtension(): string {
if (process.platform === 'win32') {
return '.exe';
}

Просмотреть файл

@ -3,7 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Sample Request: https://api.nuget.org/v3-flatcontainer/FluentAssertions/index.json
// Sample Request: https://api.nuget.org/v3-flatcontainer/FluentAssertions/index.json
export default interface NuGetFlatContainerPackageResponse {
versions: string[];

Просмотреть файл

@ -4,11 +4,11 @@
*--------------------------------------------------------------------------------------------*/
// Sample Request: https://api.nuget.org/v3/index.json
export default interface NuGetIndexResponse {
export default interface NuGetIndexResponse {
resources: NuGetResource[];
}
}
interface NuGetResource {
interface NuGetResource {
'@type': string;
'@id': string;
}
}

Просмотреть файл

@ -5,6 +5,6 @@
// Sample Query: https://api-v2v3search-0.nuget.org/autocomplete
export default interface NuGetSearchAutocompleteServiceResponse {
export default interface NuGetSearchAutocompleteServiceResponse {
data: string[];
}

Просмотреть файл

@ -5,7 +5,7 @@
let Subscriber: (message: string) => void;
export function SubscribeToAllLoggers(subscriber: (message:string) => void) {
export function SubscribeToAllLoggers(subscriber: (message: string) => void) {
Subscriber = subscriber;
}

Просмотреть файл

@ -92,11 +92,11 @@ export async function activate(context: vscode.ExtensionContext): Promise<CSharp
let errorMessageObserver = new ErrorMessageObserver(vscode);
eventStream.subscribe(errorMessageObserver.post);
let omnisharpStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE+2));
let omnisharpStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE + 2));
let omnisharpStatusBarObserver = new OmnisharpStatusBarObserver(omnisharpStatusBar);
eventStream.subscribe(omnisharpStatusBarObserver.post);
let projectStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE+1));
let projectStatusBar = new StatusBarItemAdapter(vscode.window.createStatusBarItem(vscode.StatusBarAlignment.Left, Number.MIN_VALUE + 1));
let projectStatusBarObserver = new ProjectStatusBarObserver(projectStatusBar);
eventStream.subscribe(projectStatusBarObserver.post);
@ -151,7 +151,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<CSharp
eventStream.subscribe(telemetryObserver.post);
let networkSettingsProvider = vscodeNetworkSettingsProvider(vscode);
let installDependencies: IInstallDependencies = async(dependencies: AbsolutePathPackage[]) => downloadAndInstallPackages(dependencies, networkSettingsProvider, eventStream, isValidDownload);
let installDependencies: IInstallDependencies = async (dependencies: AbsolutePathPackage[]) => downloadAndInstallPackages(dependencies, networkSettingsProvider, eventStream, isValidDownload);
let runtimeDependenciesExist = await ensureRuntimeDependencies(extension, eventStream, platformInfo, installDependencies);
// activate language services

Просмотреть файл

@ -10,17 +10,14 @@ import { DiagnosticStatus } from '../omnisharp/protocol';
export class BackgroundWorkStatusBarObserver extends BaseStatusBarItemObserver {
public post = (event: BaseEvent) => {
if(event.type === EventType.ProjectDiagnosticStatus)
{
if (event.type === EventType.ProjectDiagnosticStatus) {
let asProjectEvent = <OmnisharpProjectDiagnosticStatus>event;
if(asProjectEvent.message.Status === DiagnosticStatus.Processing)
{
if (asProjectEvent.message.Status === DiagnosticStatus.Processing) {
let projectFile = asProjectEvent.message.ProjectFilePath.replace(/^.*[\\\/]/, '');
this.SetAndShowStatusBar(`$(sync~spin) Analyzing ${projectFile}`, 'o.showOutput', null, `Analyzing ${projectFile}`);
}
else
{
else {
this.ResetAndHideStatusBar();
}
}

Просмотреть файл

@ -24,7 +24,7 @@ export class ErrorMessageObserver {
this.handleDotNetTestDebugStartFailure(<DotNetTestDebugStartFailure>event);
break;
case EventType.IntegrityCheckFailure:
this.handleIntegrityCheckFailure(<IntegrityCheckFailure> event);
this.handleIntegrityCheckFailure(<IntegrityCheckFailure>event);
}
}
@ -39,7 +39,7 @@ export class ErrorMessageObserver {
}
private handleDotnetTestRunFailure(event: DotNetTestRunFailure) {
showErrorMessage(this.vscode,`Failed to run test because ${event.message}.`);
showErrorMessage(this.vscode, `Failed to run test because ${event.message}.`);
}
private handleDotNetTestDebugStartFailure(event: DotNetTestDebugStartFailure) {

Просмотреть файл

@ -8,11 +8,11 @@ import { Options } from "../omnisharp/options";
import ShowInformationMessage from "./utils/ShowInformationMessage";
import { Observable } from "rxjs";
import Disposable from "../Disposable";
import { filter} from 'rxjs/operators';
import { filter } from 'rxjs/operators';
function ConfigChangeObservable(optionObservable: Observable<Options>): Observable<Options> {
let options: Options;
return optionObservable.pipe( filter(newOptions => {
return optionObservable.pipe(filter(newOptions => {
let changed = (options && hasChanged(options, newOptions));
options = newOptions;
return changed;

Просмотреть файл

@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import { Options } from "../omnisharp/options";
import { Subscription , Observable } from "rxjs";
import { Subscription, Observable } from "rxjs";
export default class OptionProvider {
private options: Options;
private subscription: Subscription;

Просмотреть файл

@ -3,10 +3,10 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import {debounceTime} from 'rxjs/operators';
import { debounceTime } from 'rxjs/operators';
import { vscode } from '../vscodeAdapter';
import { BaseEvent, OmnisharpServerMsBuildProjectDiagnostics } from "../omnisharp/loggingEvents";
import { Scheduler , Subject } from 'rxjs';
import { Scheduler, Subject } from 'rxjs';
import showWarningMessage from './utils/ShowWarningMessage';
import { EventType } from '../omnisharp/EventType';

Просмотреть файл

@ -22,17 +22,17 @@ type RemapParameterType<M extends keyof RemapApi> = GetRemapType<NonNullable<Rem
export class LanguageMiddlewareFeature implements IDisposable {
private readonly _middlewares: LanguageMiddleware[];
private _registration : IDisposable;
private _registration: IDisposable;
constructor() {
this._middlewares = [];
}
public dispose() : void {
public dispose(): void {
this._registration.dispose();
}
public register() : void {
public register(): void {
this._registration = vscode.commands.registerCommand(
'omnisharp.registerLanguageMiddleware', (middleware: LanguageMiddleware) => {
this._middlewares.push(middleware);
@ -51,7 +51,7 @@ export class LanguageMiddlewareFeature implements IDisposable {
for (const middleware of languageMiddlewares) {
// Commit a type crime because we know better than the compiler
const method = <(p: P, c:vscode.CancellationToken)=>vscode.ProviderResult<P>>middleware[remapType];
const method = <(p: P, c: vscode.CancellationToken) => vscode.ProviderResult<P>>middleware[remapType];
if (!method) {
continue;
}

Просмотреть файл

@ -327,13 +327,12 @@ function launchNix(launchPath: string, cwd: string, args: string[]): LaunchResul
};
}
function launchNixMono(launchPath: string, cwd: string, args: string[], environment: NodeJS.ProcessEnv, useDebugger:boolean): LaunchResult {
function launchNixMono(launchPath: string, cwd: string, args: string[], environment: NodeJS.ProcessEnv, useDebugger: boolean): LaunchResult {
let argsCopy = args.slice(0); // create copy of details args
argsCopy.unshift(launchPath);
argsCopy.unshift("--assembly-loader=strict");
if (useDebugger)
{
if (useDebugger) {
argsCopy.unshift("--debug");
argsCopy.unshift("--debugger-agent=transport=dt_socket,server=y,address=127.0.0.1:55555");
}

Просмотреть файл

@ -88,244 +88,244 @@ export class TestExecutionCountReport implements BaseEvent {
}
export class OmnisharpServerOnError implements BaseEvent {
type=EventType.OmnisharpServerOnError;
type = EventType.OmnisharpServerOnError;
constructor(public errorMessage: protocol.ErrorMessage) { }
}
export class OmnisharpProjectDiagnosticStatus implements BaseEvent {
type=EventType.ProjectDiagnosticStatus;
type = EventType.ProjectDiagnosticStatus;
constructor(public message: protocol.ProjectDiagnosticStatus) { }
}
export class OmnisharpServerMsBuildProjectDiagnostics implements BaseEvent {
type=EventType.OmnisharpServerMsBuildProjectDiagnostics;
type = EventType.OmnisharpServerMsBuildProjectDiagnostics;
constructor(public diagnostics: protocol.MSBuildProjectDiagnostics) { }
}
export class OmnisharpServerUnresolvedDependencies implements BaseEvent {
type=EventType.OmnisharpServerUnresolvedDependencies;
type = EventType.OmnisharpServerUnresolvedDependencies;
constructor(public unresolvedDependencies: protocol.UnresolvedDependenciesMessage) { }
}
export class OmnisharpServerEnqueueRequest implements BaseEvent {
type=EventType.OmnisharpServerEnqueueRequest;
type = EventType.OmnisharpServerEnqueueRequest;
constructor(public name: string, public command: string) { }
}
export class OmnisharpServerDequeueRequest implements BaseEvent {
type=EventType.OmnisharpServerDequeueRequest;
type = EventType.OmnisharpServerDequeueRequest;
constructor(public name: string, public command: string, public id: number) { }
}
export class OmnisharpServerProcessRequestStart implements BaseEvent {
type=EventType.OmnisharpServerProcessRequestStart;
type = EventType.OmnisharpServerProcessRequestStart;
constructor(public name: string) { }
}
export class OmnisharpEventPacketReceived implements BaseEvent {
type=EventType.OmnisharpEventPacketReceived;
type = EventType.OmnisharpEventPacketReceived;
constructor(public logLevel: string, public name: string, public message: string) { }
}
export class OmnisharpServerOnServerError implements BaseEvent {
type=EventType.OmnisharpServerOnServerError;
type = EventType.OmnisharpServerOnServerError;
constructor(public err: any) { }
}
export class OmnisharpOnMultipleLaunchTargets implements BaseEvent {
type=EventType.OmnisharpOnMultipleLaunchTargets;
type = EventType.OmnisharpOnMultipleLaunchTargets;
constructor(public targets: LaunchTarget[]) { }
}
export class ProjectConfiguration implements BaseEvent{
export class ProjectConfiguration implements BaseEvent {
type = EventType.ProjectConfigurationReceived;
constructor(public projectConfiguration: protocol.ProjectConfigurationMessage){}
constructor(public projectConfiguration: protocol.ProjectConfigurationMessage) { }
}
export class WorkspaceInformationUpdated implements BaseEvent {
type=EventType.WorkspaceInformationUpdated;
type = EventType.WorkspaceInformationUpdated;
constructor(public info: protocol.WorkspaceInformationResponse) { }
}
export class EventWithMessage implements BaseEvent {
type=EventType.EventWithMessage;
type = EventType.EventWithMessage;
constructor(public message: string) { }
}
export class DownloadStart implements BaseEvent {
type=EventType.DownloadStart;
type = EventType.DownloadStart;
constructor(public packageDescription: string) { }
}
export class DownloadFallBack implements BaseEvent {
type=EventType.DownloadFallBack;
type = EventType.DownloadFallBack;
constructor(public fallbackUrl: string) { }
}
export class DownloadSizeObtained implements BaseEvent {
type=EventType.DownloadSizeObtained;
type = EventType.DownloadSizeObtained;
constructor(public packageSize: number) { }
}
export class ZipError implements BaseEvent {
type=EventType.ZipError;
type = EventType.ZipError;
constructor(public message: string) { }
}
export class ReportDotNetTestResults implements BaseEvent {
type=EventType.ReportDotNetTestResults;
type = EventType.ReportDotNetTestResults;
constructor(public results: protocol.V2.DotNetTestResult[]) { }
}
export class DotNetTestRunStart implements BaseEvent {
type=EventType.DotNetTestRunStart;
type = EventType.DotNetTestRunStart;
constructor(public testMethod: string) { }
}
export class DotNetTestDebugStart implements BaseEvent {
type=EventType.DotNetTestDebugStart;
type = EventType.DotNetTestDebugStart;
constructor(public testMethod: string) { }
}
export class DotNetTestDebugProcessStart implements BaseEvent {
type=EventType.DotNetTestDebugProcessStart;
type = EventType.DotNetTestDebugProcessStart;
constructor(public targetProcessId: number) { }
}
export class DotNetTestsInClassRunStart implements BaseEvent {
type=EventType.DotNetTestsInClassRunStart;
type = EventType.DotNetTestsInClassRunStart;
constructor(public className: string) { }
}
export class DotNetTestsInClassDebugStart implements BaseEvent {
type=EventType.DotNetTestsInClassDebugStart;
type = EventType.DotNetTestsInClassDebugStart;
constructor(public className: string) { }
}
export class DocumentSynchronizationFailure implements BaseEvent {
type=EventType.DocumentSynchronizationFailure;
type = EventType.DocumentSynchronizationFailure;
constructor(public documentPath: string, public errorMessage: string) { }
}
export class OpenURL {
type=EventType.OpenURL;
type = EventType.OpenURL;
constructor(public url: string) { }
}
export class IntegrityCheckFailure {
type=EventType.IntegrityCheckFailure;
constructor(public packageDescription: string, public url: string, public retry: boolean){ }
type = EventType.IntegrityCheckFailure;
constructor(public packageDescription: string, public url: string, public retry: boolean) { }
}
export class IntegrityCheckSuccess {
type=EventType.IntegrityCheckSuccess;
type = EventType.IntegrityCheckSuccess;
constructor() { }
}
export class RazorPluginPathSpecified implements BaseEvent {
type=EventType.RazorPluginPathSpecified;
constructor(public path: string) {}
type = EventType.RazorPluginPathSpecified;
constructor(public path: string) { }
}
export class RazorPluginPathDoesNotExist implements BaseEvent {
type=EventType.RazorPluginPathDoesNotExist;
constructor(public path: string) {}
type = EventType.RazorPluginPathDoesNotExist;
constructor(public path: string) { }
}
export class DebuggerPrerequisiteFailure extends EventWithMessage {
type = EventType.DebuggerPrerequisiteFailure;
}
}
export class DebuggerPrerequisiteWarning extends EventWithMessage {
type = EventType.DebuggerPrerequisiteWarning;
}
}
export class CommandDotNetRestoreProgress extends EventWithMessage {
type = EventType.CommandDotNetRestoreProgress;
}
}
export class CommandDotNetRestoreSucceeded extends EventWithMessage {
type = EventType.CommandDotNetRestoreSucceeded;
}
}
export class CommandDotNetRestoreFailed extends EventWithMessage {
type = EventType.CommandDotNetRestoreFailed;
}
}
export class DownloadSuccess extends EventWithMessage {
type = EventType.DownloadSuccess;
}
}
export class DownloadFailure extends EventWithMessage {
type = EventType.DownloadFailure;
}
}
export class OmnisharpServerOnStdErr extends EventWithMessage {
type = EventType.OmnisharpServerOnStdErr;
}
}
export class OmnisharpServerMessage extends EventWithMessage {
type = EventType.OmnisharpServerMessage;
}
}
export class OmnisharpServerVerboseMessage extends EventWithMessage {
type = EventType.OmnisharpServerVerboseMessage;
}
}
export class DotNetTestMessage extends EventWithMessage {
type = EventType.DotNetTestMessage;
}
}
export class DotNetTestRunFailure extends EventWithMessage {
type = EventType.DotNetTestRunFailure;
}
}
export class DotNetTestDebugWarning extends EventWithMessage {
type = EventType.DotNetTestDebugWarning;
}
}
export class DotNetTestDebugStartFailure extends EventWithMessage {
type = EventType.DotNetTestDebugStartFailure;
}
}
export class RazorDevModeActive implements BaseEvent {
type = EventType.RazorDevModeActive;
}
}
export class ProjectModified implements BaseEvent {
type = EventType.ProjectModified;
}
}
export class ActivationFailure implements BaseEvent {
type = EventType.ActivationFailure;
}
}
export class ShowOmniSharpChannel implements BaseEvent {
type = EventType.ShowOmniSharpChannel;
}
}
export class DebuggerNotInstalledFailure implements BaseEvent {
type = EventType.DebuggerNotInstalledFailure;
}
}
export class CommandDotNetRestoreStart implements BaseEvent {
type = EventType.CommandDotNetRestoreStart;
}
}
export class InstallationSuccess implements BaseEvent {
type = EventType.InstallationSuccess;
}
}
export class OmnisharpServerProcessRequestComplete implements BaseEvent {
type = EventType.OmnisharpServerProcessRequestComplete;
}
}
export class ProjectJsonDeprecatedWarning implements BaseEvent {
type = EventType.ProjectJsonDeprecatedWarning;
}
}
export class OmnisharpOnBeforeServerStart implements BaseEvent {
type = EventType.OmnisharpOnBeforeServerStart;
}
}
export class OmnisharpOnBeforeServerInstall implements BaseEvent {
type = EventType.OmnisharpOnBeforeServerInstall;
}
}
export class ActiveTextEditorChanged implements BaseEvent {
type = EventType.ActiveTextEditorChanged;
}
}
export class OmnisharpServerOnStop implements BaseEvent {
type = EventType.OmnisharpServerOnStop;
}
}
export class OmnisharpServerOnStart implements BaseEvent {
type = EventType.OmnisharpServerOnStart;
}
}
export class LatestBuildDownloadStart implements BaseEvent {
type = EventType.LatestBuildDownloadStart;
}
}
export class OmnisharpRestart implements BaseEvent {
type = EventType.OmnisharpRestart;
}
}
export class DotNetTestDebugComplete implements BaseEvent {
type = EventType.DotNetTestDebugComplete;
}
}
export class DownloadValidation implements BaseEvent {
type = EventType.DownloadValidation;
}
}

Просмотреть файл

@ -26,7 +26,7 @@ import * as ObservableEvents from './loggingEvents';
import { EventStream } from '../EventStream';
import { NetworkSettingsProvider } from '../NetworkSettings';
import { Subject } from 'rxjs';
import {debounceTime} from 'rxjs/operators';
import { debounceTime } from 'rxjs/operators';
import CompositeDisposable from '../CompositeDisposable';
import Disposable from '../Disposable';
import OptionProvider from '../observers/OptionProvider';
@ -333,8 +333,7 @@ export class OmniSharpServer {
args.push('--debug');
}
for (let i = 0; i < options.excludePaths.length; i++)
{
for (let i = 0; i < options.excludePaths.length; i++) {
args.push(`FileOptions:SystemExcludeSearchPatterns:${i}=${options.excludePaths[i]}`);
}
@ -390,7 +389,7 @@ export class OmniSharpServer {
}
}
private onProjectConfigurationReceived(listener: (e: protocol.ProjectConfigurationMessage) => void){
private onProjectConfigurationReceived(listener: (e: protocol.ProjectConfigurationMessage) => void) {
return this._addListener(Events.ProjectConfiguration, listener);
}

Просмотреть файл

@ -5,7 +5,7 @@
import { isAbsolute, resolve } from "path";
export class AbsolutePath{
export class AbsolutePath {
constructor(public value: string) {
if (!isAbsolute(value)) {
throw new Error("The path must be absolute");

Просмотреть файл

@ -7,7 +7,7 @@ import { Package } from "./Package";
import { IPackage } from "./IPackage";
import { AbsolutePath } from "./AbsolutePath";
export class AbsolutePathPackage implements IPackage{
export class AbsolutePathPackage implements IPackage {
constructor(public id: string,
public description: string,
public url: string,

Просмотреть файл

@ -5,7 +5,7 @@
import { IPackage } from "./IPackage";
export interface Package extends IPackage{
export interface Package extends IPackage {
installPath?: string;
binaries: string[];
installTestPath?: string;

Просмотреть файл

@ -9,8 +9,7 @@ import { getNotInstalledPackagesForPlatform } from "./PackageFilterer";
import { Package } from "./Package";
export async function getAbsolutePathPackagesToInstall(packages: Package[], platformInfo: PlatformInformation, extensionPath: string): Promise<AbsolutePathPackage[]> {
if (packages && packages.length>0)
{
if (packages && packages.length > 0) {
let absolutePathPackages = packages.map(pkg => AbsolutePathPackage.getAbsolutePathPackage(pkg, extensionPath));
return getNotInstalledPackagesForPlatform(absolutePathPackages, platformInfo);
}

Просмотреть файл

@ -28,7 +28,7 @@ export function isValidDownload(buffer: Buffer, integrity: string, eventStream:
return true;
}
export function getBufferIntegrityHash(buffer: Buffer) : string {
export function getBufferIntegrityHash(buffer: Buffer): string {
let hash = crypto.createHash('sha256');
hash.update(buffer);
let value = hash.digest('hex').toUpperCase();

Просмотреть файл

@ -78,7 +78,7 @@ export class LinuxDistribution {
public static FromReleaseInfo(releaseInfo: string, eol: string = os.EOL): LinuxDistribution {
let name = unknown;
let version = unknown;
let idLike : string[] = null;
let idLike: string[] = null;
const lines = releaseInfo.split(eol);
for (let line of lines) {
@ -118,8 +118,7 @@ export class PlatformInformation {
public constructor(
public platform: string,
public architecture: string,
public distribution: LinuxDistribution = null)
{
public distribution: LinuxDistribution = null) {
}
public isWindows(): boolean {

Просмотреть файл

@ -8,15 +8,15 @@ import * as vscode from 'vscode';
export class StatusBarItemAdapter implements vscodeAdapter.StatusBarItem {
get alignment(): vscodeAdapter.StatusBarAlignment{
get alignment(): vscodeAdapter.StatusBarAlignment {
return this.statusBarItem.alignment;
}
get priority(): number{
get priority(): number {
return this.statusBarItem.priority;
}
get text(): string{
get text(): string {
return this.statusBarItem.text;
}
@ -24,15 +24,15 @@ export class StatusBarItemAdapter implements vscodeAdapter.StatusBarItem {
this.statusBarItem.text = value;
}
get tooltip(): string{
get tooltip(): string {
return this.statusBarItem.tooltip;
}
set tooltip(value: string){
set tooltip(value: string) {
this.statusBarItem.tooltip = value;
}
get color(): string{
get color(): string {
return this.statusBarItem.color as string;
}
@ -40,7 +40,7 @@ export class StatusBarItemAdapter implements vscodeAdapter.StatusBarItem {
this.statusBarItem.color = value;
}
get command(): string{
get command(): string {
return this.statusBarItem.command;
}

Просмотреть файл

@ -85,7 +85,7 @@ function ReplaceReferences(definitions: any, objects: any) {
return objects;
}
function mergeReferences(baseDefinitions: any, additionalDefinitions: any) : void {
function mergeReferences(baseDefinitions: any, additionalDefinitions: any): void {
for (let key in additionalDefinitions) {
if (baseDefinitions[key]) {
throw `Error: '${key}' defined in multiple schema files.`;

Просмотреть файл

@ -6,10 +6,10 @@
const removeBomBuffer = require("remove-bom-buffer");
const removeBomString = require("strip-bom");
export function removeBOMFromBuffer(buffer: Buffer): Buffer{
return <Buffer> removeBomBuffer(buffer);
export function removeBOMFromBuffer(buffer: Buffer): Buffer {
return <Buffer>removeBomBuffer(buffer);
}
export function removeBOMFromString(line: string): string{
export function removeBOMFromString(line: string): string {
return removeBomString(line.trim());
}

Просмотреть файл

@ -9,7 +9,7 @@ import { SpawnOptions, spawn } from "child_process";
import { nodePath, rootPath } from "./projectPaths";
const { join } = require("async-child-process");
export default async function spawnNode(args?: string[], options?: SpawnOptions): Promise<{code: string; signal: string;}> {
export default async function spawnNode(args?: string[], options?: SpawnOptions): Promise<{ code: string; signal: string; }> {
if (!options) {
options = {
env: {}

Просмотреть файл

@ -2,7 +2,7 @@
* Copyright (C) Microsoft Corporation. All rights reserved.
*--------------------------------------------------------*/
import shelljs = require("async-shelljs");
import shelljs = require("async-shelljs");
import path = require('path');
const fs = require('async-file');
@ -64,7 +64,7 @@ export default class CoverageWritingTestRunner {
let remappedResult = JSON.parse(await fs.readTextFile(remappedCoverageJsonPath));
let finalResult = <{[details: string] : { path: string }}>{};
let finalResult = <{ [details: string]: { path: string } }>{};
for (let key in remappedResult) {
if (remappedResult[key].path) {
@ -94,4 +94,4 @@ export default class CoverageWritingTestRunner {
}
}
}
}
}

Просмотреть файл

@ -60,7 +60,7 @@ suite(`CodeLensProvider: ${testAssetWorkspace.description}`, function () {
});
});
suite(`CodeLensProvider options: ${testAssetWorkspace.description}`, function() {
suite(`CodeLensProvider options: ${testAssetWorkspace.description}`, function () {
let fileUri: vscode.Uri;
suiteSetup(async function () {
@ -70,8 +70,7 @@ suite(`CodeLensProvider options: ${testAssetWorkspace.description}`, function()
if (vscode.workspace.workspaceFolders[0].uri.fsPath.split(path.sep).pop() !== 'slnWithCsproj') {
this.skip();
}
else
{
else {
await activateCSharpExtension();
await testAssetWorkspace.restore();

Просмотреть файл

@ -13,7 +13,7 @@ import { activateCSharpExtension, isRazorWorkspace } from "./integrationHelpers"
suite(`${OmniSharpCompletionItemProvider.name}: Returns the completion items`, () => {
let fileUri: vscode.Uri;
suiteSetup(async function() {
suiteSetup(async function () {
// These tests don't run on the BasicRazorApp2_1 solution
if (isRazorWorkspace(vscode.workspace)) {
this.skip();

Просмотреть файл

@ -32,7 +32,7 @@ suite(`${CSharpDefinitionProvider.name}: ${testAssetWorkspace.description}`, ()
await testAssetWorkspace.cleanupWorkspace();
});
test("Returns the definition", async() => {
test("Returns the definition", async () => {
let definitionList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeDefinitionProvider", fileUri, new vscode.Position(10, 31)));
expect(definitionList.length).to.be.equal(1);
expect(definitionList[0]).to.exist;
@ -40,7 +40,7 @@ suite(`${CSharpDefinitionProvider.name}: ${testAssetWorkspace.description}`, ()
});
// Skipping due to https://github.com/OmniSharp/omnisharp-vscode/issues/3458
test.skip("Returns the definition from Metadata", async() => {
test.skip("Returns the definition from Metadata", async () => {
let definitionList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeDefinitionProvider", fileUri, new vscode.Position(10, 25)));
expect(definitionList.length).to.be.equal(1);
expect(definitionList[0]).to.exist;

Просмотреть файл

@ -57,18 +57,18 @@ suite(`DiagnosticProvider: ${testAssetWorkspace.description}`, function () {
});
test("Razor shouldn't give diagnostics for virtual files", async () => {
await pollDoesNotHappen(() => vscode.languages.getDiagnostics(), 5 * 1000, 500, function(res) {
await pollDoesNotHappen(() => vscode.languages.getDiagnostics(), 5 * 1000, 500, function (res) {
const virtual = res.find(r => r[0].fsPath === virtualRazorFileUri.fsPath);
if(!virtual) {
if (!virtual) {
return false;
}
const diagnosticsList = virtual[1];
if(diagnosticsList.some(diag => diag.code == 'CS0103')) {
if (diagnosticsList.some(diag => diag.code == 'CS0103')) {
return true;
}
else{
else {
return false;
}
});

Просмотреть файл

@ -13,7 +13,7 @@ import { activateCSharpExtension, isRazorWorkspace } from './integrationHelpers'
suite(`${CSharpImplementationProvider.name}: ${testAssetWorkspace.description}`, () => {
let fileUri: vscode.Uri;
suiteSetup(async function() {
suiteSetup(async function () {
// These tests don't run on the BasicRazorApp2_1 solution
if (isRazorWorkspace(vscode.workspace)) {
this.skip();
@ -32,7 +32,7 @@ suite(`${CSharpImplementationProvider.name}: ${testAssetWorkspace.description}`,
await testAssetWorkspace.cleanupWorkspace();
});
test("Returns the implementation", async() => {
test("Returns the implementation", async () => {
let implementationList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeImplementationProvider", fileUri, new vscode.Position(4, 22)));
expect(implementationList.length).to.be.equal(2);
});

Просмотреть файл

@ -36,7 +36,7 @@ suite(`${LanguageMiddlewareFeature.name}: ${testAssetWorkspace.description}`, ()
await testAssetWorkspace.cleanupWorkspace();
});
test("Returns the remapped workspaceEdit", async() => {
test("Returns the remapped workspaceEdit", async () => {
// Avoid flakiness with renames.
await new Promise(r => setTimeout(r, 2000));
@ -52,7 +52,7 @@ suite(`${LanguageMiddlewareFeature.name}: ${testAssetWorkspace.description}`, ()
expect(entries[0][0].path).to.be.equal(remappedFileUri.path);
});
test("Returns the remapped references", async() => {
test("Returns the remapped references", async () => {
let references = <vscode.Location[]>(await vscode.commands.executeCommand(
"vscode.executeReferenceProvider",
fileUri,
@ -61,7 +61,7 @@ suite(`${LanguageMiddlewareFeature.name}: ${testAssetWorkspace.description}`, ()
expect(references[0].uri.path).to.be.equal(remappedFileUri.path);
});
test("Returns the remapped definition", async() => {
test("Returns the remapped definition", async () => {
let definitions = <vscode.Location[]>(await vscode.commands.executeCommand(
"vscode.executeDefinitionProvider",
fileUri,
@ -70,7 +70,7 @@ suite(`${LanguageMiddlewareFeature.name}: ${testAssetWorkspace.description}`, ()
expect(definitions[0].uri.path).to.be.equal(remappedFileUri.path);
});
test("Returns the remapped implementations", async() => {
test("Returns the remapped implementations", async () => {
let implementations = <vscode.Location[]>(await vscode.commands.executeCommand(
"vscode.executeImplementationProvider",
fileUri,
@ -85,8 +85,7 @@ async function registerLanguageMiddleware() {
await vscode.commands.executeCommand<void>('omnisharp.registerLanguageMiddleware', middleware);
}
class TestLanguageMiddleware implements LanguageMiddleware
{
class TestLanguageMiddleware implements LanguageMiddleware {
public readonly language = 'MyLang';
private readonly remappedFileUri: vscode.Uri;
private readonly fileToRemapUri: vscode.Uri;

Просмотреть файл

@ -19,13 +19,11 @@ const chai = require('chai');
chai.use(require('chai-arrays'));
chai.use(require('chai-fs'));
function listenEvents<T extends BaseEvent>(stream: EventStream, type: EventType): T[]
{
function listenEvents<T extends BaseEvent>(stream: EventStream, type: EventType): T[] {
let results: T[] = [];
stream.subscribe((event: BaseEvent) => {
if(event.type === type)
{
if (event.type === type) {
results.push(<T>event);
}
});
@ -72,11 +70,11 @@ suite(`ReAnalyze: ${testAssetWorkspace.description}`, function () {
await vscode.commands.executeCommand('o.reanalyze.currentProject', interfaceImplUri);
await poll(() => diagnosticStatusEvents, 15*1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) !== undefined);
await poll(() => diagnosticStatusEvents, 15 * 1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) !== undefined);
await assertWithPoll(
() => vscode.languages.getDiagnostics(interfaceImplUri),
15*1000,
15 * 1000,
500,
res => expect(res.find(x => x.message.includes("CS0246"))));
});
@ -86,8 +84,8 @@ suite(`ReAnalyze: ${testAssetWorkspace.description}`, function () {
await vscode.commands.executeCommand('o.reanalyze.currentProject', interfaceImplUri);
await poll(() => diagnosticStatusEvents, 15*1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Processing) != undefined);
await poll(() => diagnosticStatusEvents, 15*1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) != undefined);
await poll(() => diagnosticStatusEvents, 15 * 1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Processing) != undefined);
await poll(() => diagnosticStatusEvents, 15 * 1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) != undefined);
});
test("When re-analyze of all projects is executed then eventually get notified about them.", async function () {
@ -95,7 +93,7 @@ suite(`ReAnalyze: ${testAssetWorkspace.description}`, function () {
await vscode.commands.executeCommand('o.reanalyze.allProjects', interfaceImplUri);
await poll(() => diagnosticStatusEvents, 15*1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Processing) != undefined);
await poll(() => diagnosticStatusEvents, 15*1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) != undefined);
await poll(() => diagnosticStatusEvents, 15 * 1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Processing) != undefined);
await poll(() => diagnosticStatusEvents, 15 * 1000, 500, r => r.find(x => x.message.Status === DiagnosticStatus.Ready) != undefined);
});
});

Просмотреть файл

@ -32,7 +32,7 @@ suite(`${OmnisharpReferenceProvider.name}: ${testAssetWorkspace.description}`, (
await testAssetWorkspace.cleanupWorkspace();
});
test("Returns the reference without declaration", async() => {
test("Returns the reference without declaration", async () => {
let referenceList = <vscode.Location[]>(await vscode.commands.executeCommand("vscode.executeReferenceProvider", fileUri, new vscode.Position(6, 22)));
expect(referenceList.length).to.be.equal(1);
expect(referenceList[0].range.start.line).to.be.equal(13);

Просмотреть файл

@ -6,4 +6,4 @@
import { IGetDotnetInfo } from "../../../src/constants/IGetDotnetInfo";
export const fakeDotnetInfo = "myDotnetInfo";
export const FakeGetDotnetInfo: IGetDotnetInfo = async() => Promise.resolve(fakeDotnetInfo);
export const FakeGetDotnetInfo: IGetDotnetInfo = async () => Promise.resolve(fakeDotnetInfo);

Просмотреть файл

@ -29,7 +29,7 @@ suite(`${installRuntimeDependencies.name}`, () => {
setup(() => {
eventStream = new EventStream();
eventBus = new TestEventBus(eventStream);
installDependencies = async() => Promise.resolve(true);
installDependencies = async () => Promise.resolve(true);
});
suite("When all the dependencies already exist", () => {
@ -44,7 +44,7 @@ suite(`${installRuntimeDependencies.name}`, () => {
expect(installed).to.be.true;
});
test("Doesn't log anything to the eventStream", async() => {
test("Doesn't log anything to the eventStream", async () => {
let packageJSON = {
runtimeDependencies: {}
};
@ -55,8 +55,8 @@ suite(`${installRuntimeDependencies.name}`, () => {
});
suite("When there is a dependency to install", () => {
let packageToInstall : Package= {
id:"myPackage",
let packageToInstall: Package = {
id: "myPackage",
description: "somePackage",
installPath: "installPath",
binaries: [],
@ -73,7 +73,7 @@ suite(`${installRuntimeDependencies.name}`, () => {
test("Calls installDependencies with the absolute path package and returns true after successful installation", async () => {
let inputPackage: AbsolutePathPackage[];
installDependencies = async(packages) => {
installDependencies = async (packages) => {
inputPackage = packages;
return Promise.resolve(true);
};
@ -85,7 +85,7 @@ suite(`${installRuntimeDependencies.name}`, () => {
});
test("Returns false when installDependencies returns false", async () => {
installDependencies = async() => Promise.resolve(false);
installDependencies = async () => Promise.resolve(false);
let installed = await installRuntimeDependencies(packageJSON, extensionPath, installDependencies, eventStream, platformInfo);
expect(installed).to.be.false;
});

Просмотреть файл

@ -11,7 +11,7 @@ import { CreateTmpDir, TmpAsset } from "../../src/CreateTmpAsset";
import * as util from '../../src/common';
import * as path from 'path';
import MockHttpsServer from "./testAssets/MockHttpsServer";
import {expect} from 'chai';
import { expect } from 'chai';
import TestZip from "./testAssets/TestZip";
import { createTestFile } from "./testAssets/TestFile";
import { PackageInstallation, LogPlatformInfo, DownloadStart, DownloadSizeObtained, DownloadProgress, DownloadSuccess, InstallationStart, InstallationSuccess, PackageInstallStart } from "../../src/omnisharp/loggingEvents";
@ -20,7 +20,7 @@ import { testPackageJSON } from "./testAssets/testAssets";
suite('OmnisharpDownloader', () => {
const networkSettingsProvider = () => new NetworkSettings(undefined, false);
let eventStream : EventStream;
let eventStream: EventStream;
const installPath = "somePath";
let platformInfo = new PlatformInformation("win32", "x86");
let downloader: OmnisharpDownloader;
@ -46,7 +46,7 @@ suite('OmnisharpDownloader', () => {
}, testZip.buffer);
});
test('Returns false if request is made for a version that doesnot exist on the server', async() => {
test('Returns false if request is made for a version that doesnot exist on the server', async () => {
expect(await downloader.DownloadAndInstallOmnisharp("1.00000001.0000", server.baseUrl, installPath)).to.be.false;
});

Просмотреть файл

@ -20,7 +20,7 @@ import * as util from '../../src/common';
suite(OmnisharpManager.name, () => {
let server: MockHttpsServer;
const eventStream = new EventStream();
let manager : OmnisharpManager;
let manager: OmnisharpManager;
const defaultVersion = "0.1.2";
const testVersion = "1.2.3";
const latestVersion = "2.3.4";

Просмотреть файл

@ -20,7 +20,7 @@ suite("GetOmnisharpPackage : Output package depends on the input package and oth
version = "0.0.0";
installPath = "testPath";
let packageJSON = testPackageJSON;
inputPackages = <Package[]> (packageJSON.runtimeDependencies);
inputPackages = <Package[]>(packageJSON.runtimeDependencies);
should();
});
@ -32,7 +32,7 @@ suite("GetOmnisharpPackage : Output package depends on the input package and oth
test('Throws exception if version is null', () => {
let testPackage = inputPackages.find(element => (element.platformId && element.platformId == "os-architecture"));
let fn = function () { SetBinaryAndGetPackage(testPackage, serverUrl, null, installPath);};
let fn = function () { SetBinaryAndGetPackage(testPackage, serverUrl, null, installPath); };
expect(fn).to.throw('Invalid version');
});
@ -100,7 +100,7 @@ suite('GetPackagesFromVersion : Gets the experimental omnisharp packages from a
const serverUrl = "http://serverUrl";
const installPath = "testPath";
let inputPackages : any;
let inputPackages: any;
suiteSetup(() => {
inputPackages = <Package[]>(testPackageJSON.runtimeDependencies);

Просмотреть файл

@ -18,39 +18,39 @@ suite(`${getNotInstalledPackagesForPlatform.name}`, () => {
const packages = <Package[]>[
{
"description": "Platfrom1-Architecture1 uninstalled package",
"platforms": [ "platform1" ],
"architectures": [ "architecture1" ],
"platforms": ["platform1"],
"architectures": ["architecture1"],
"installPath": "path1"
},
{
//already installed package
"description": "Platfrom1-Architecture1 installed package",
"platforms": [ "platform1" ],
"architectures": [ "architecture1" ],
"platforms": ["platform1"],
"architectures": ["architecture1"],
"installPath": "path5"
},
{
"description": "Platfrom2-Architecture2 uninstalled package",
"platforms": [ "platform2" ],
"architectures": [ "architecture2" ],
"platforms": ["platform2"],
"architectures": ["architecture2"],
"installPath": "path2"
},
{
"description": "Platfrom1-Architecture2 uninstalled package",
"platforms": [ "platform1" ],
"architectures": [ "architecture2" ],
"platforms": ["platform1"],
"architectures": ["architecture2"],
"installPath": "path3"
},
{
"description": "Platfrom2-Architecture1 uninstalled package",
"platforms": [ "platform2" ],
"architectures": [ "architecture1" ],
"platforms": ["platform2"],
"architectures": ["architecture1"],
"installPath": "path4"
},
{
"description": "Platfrom1-Architecture2 uninstalled package",
"platforms": [ "platform1" ],
"architectures": [ "architecture2" ],
"platforms": ["platform1"],
"architectures": ["architecture2"],
"installPath": "path3"
},
];

Просмотреть файл

@ -11,7 +11,7 @@ suite("ParsedEnvironmentFile", () => {
test("Add single variable", () => {
const content = `MyName=VALUE`;
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
expect(result.Warning).to.be.null;
@ -20,7 +20,7 @@ suite("ParsedEnvironmentFile", () => {
test("Handle quoted values", () => {
const content = `MyName="VALUE"`;
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
expect(result.Warning).to.be.null;
@ -29,7 +29,7 @@ suite("ParsedEnvironmentFile", () => {
test("Handle BOM", () => {
const content = "\uFEFFMyName=VALUE";
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
expect(result.Warning).to.be.null;
@ -42,7 +42,7 @@ MyName1=Value1
MyName2=Value2
`;
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
expect(result.Warning).to.be.null;
@ -56,7 +56,7 @@ MyName1=Value1
MyName2=Value2
`;
const initialEnv : { [key: string]: any } = {
const initialEnv: { [key: string]: any } = {
"MyName1": "Value7",
"ThisShouldNotChange": "StillHere"
};
@ -74,7 +74,7 @@ MyName1=Value1
# This is a comment in the middle of the file
MyName2=Value2
`;
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
expect(result.Warning).to.be.null;
@ -89,7 +89,7 @@ MyName1=Value1
MyName2=Value2
`;
const fakeConfig : { [key: string]: any } = {};
const fakeConfig: { [key: string]: any } = {};
const result = ParsedEnvironmentFile.CreateFromContent(content, "TestEnvFileName", fakeConfig["env"]);
result.Warning.should.startWith("Ignoring non-parseable lines in envFile TestEnvFileName");

Просмотреть файл

@ -71,28 +71,28 @@ suite("Common", () => {
suite("isSubfolderOf", () => {
test("same paths", () => {
let subfolder: string = ["C:", "temp", "VS", "dotnetProject"].join(path.sep);
let folder: string= ["C:", "temp", "VS", "dotnetProject"].join(path.sep);
let folder: string = ["C:", "temp", "VS", "dotnetProject"].join(path.sep);
expect(isSubfolderOf(subfolder, folder)).to.be.true;
});
test("correct subfolder", () => {
let subfolder: string = ["C:", "temp", "VS"].join(path.sep);
let folder: string= ["C:", "temp", "VS", "dotnetProject"].join(path.sep);
let folder: string = ["C:", "temp", "VS", "dotnetProject"].join(path.sep);
expect(isSubfolderOf(subfolder, folder)).to.be.true;
});
test("longer subfolder", () => {
let subfolder: string = ["C:", "temp", "VS", "a", "b", "c"].join(path.sep);
let folder: string= ["C:", "temp", "VS"].join(path.sep);
let folder: string = ["C:", "temp", "VS"].join(path.sep);
expect(isSubfolderOf(subfolder, folder)).to.be.false;
});
test("Different drive", () => {
let subfolder: string = ["C:", "temp", "VS"].join(path.sep);
let folder: string= ["E:", "temp", "VS"].join(path.sep);
let folder: string = ["E:", "temp", "VS"].join(path.sep);
expect(isSubfolderOf(subfolder, folder)).to.be.false;
});

Просмотреть файл

@ -57,7 +57,7 @@ suite(`${reportIssue.name}`, () => {
};
};
vscode.env.clipboard.writeText = (body:string) => {
vscode.env.clipboard.writeText = (body: string) => {
issueBody = body;
return undefined;
};

Просмотреть файл

@ -70,7 +70,7 @@ suite(`${DotNetTestLoggerObserver.name}`, () => {
suite(`${ReportDotNetTestResults.name}`, () => {
let event = new ReportDotNetTestResults(
[
getDotNetTestResults("foo", "failed", "assertion failed", "stacktrace1" , ["message1", "message2"], ["errorMessage1"]),
getDotNetTestResults("foo", "failed", "assertion failed", "stacktrace1", ["message1", "message2"], ["errorMessage1"]),
getDotNetTestResults("failinator", "failed", "error occurred", "stacktrace2", [], []),
getDotNetTestResults("bar", "skipped", "", "", ["message3", "message4"], []),
getDotNetTestResults("passinator", "passed", "", "", [], []),
@ -121,7 +121,7 @@ function getDotNetTestResults(methodname: string, outcome: string, errorMessage:
Outcome: outcome,
ErrorMessage: errorMessage,
ErrorStackTrace: errorStackTrace,
StandardOutput : stdoutMessages,
StandardOutput: stdoutMessages,
StandardError: stdErrorMessages
};
}

Просмотреть файл

@ -6,8 +6,8 @@
import { InformationMessageObserver } from '../../../src/observers/InformationMessageObserver';
import { use as chaiUse, expect, should } from 'chai';
import { getUnresolvedDependenices, updateConfig, getVSCodeWithConfig } from '../testAssets/Fakes';
import {from as observableFrom } from 'rxjs';
import {timeout} from 'rxjs/operators';
import { from as observableFrom } from 'rxjs';
import { timeout } from 'rxjs/operators';
chaiUse(require('chai-as-promised'));
chaiUse(require('chai-string'));

Просмотреть файл

@ -23,7 +23,7 @@ suite(`${OmniSharpMonoResolver.name}`, () => {
const requiredMonoVersion = "6.4.0";
const higherMonoVersion = "6.6.0";
const getMono = (version: string) => async(env: NodeJS.ProcessEnv) => {
const getMono = (version: string) => async (env: NodeJS.ProcessEnv) => {
getMonoCalled = true;
environment = env;
return Promise.resolve(version);

Просмотреть файл

@ -11,10 +11,10 @@ const ServerMock = require("mock-http-server");
export default class MockHttpsServer {
constructor(private server: any, public readonly baseUrl: string){
constructor(private server: any, public readonly baseUrl: string) {
}
public addRequestHandler(method: string, path: string, reply_status: number, reply_headers?: any, reply_body?: any){
public addRequestHandler(method: string, path: string, reply_status: number, reply_headers?: any, reply_body?: any) {
this.server.on({
method,
path,
@ -26,11 +26,11 @@ export default class MockHttpsServer {
});
}
public async start(){
public async start() {
return new Promise(resolve => this.server.start(resolve));
}
public async stop(){
public async stop() {
return new Promise((resolve, reject) => this.server.stop(resolve));
}

Просмотреть файл

@ -11,16 +11,16 @@ export default class TestEventBus {
private eventBus: Array<BaseEvent>;
private disposable: IDisposable;
constructor(eventStream: EventStream){
constructor(eventStream: EventStream) {
this.eventBus = [];
this.disposable = new Disposable(eventStream.subscribe(event => this.eventBus.push(event)));
}
public getEvents(): Array<BaseEvent>{
public getEvents(): Array<BaseEvent> {
return this.eventBus;
}
public dispose(){
public dispose() {
this.disposable.dispose();
}
}

Просмотреть файл

@ -8,7 +8,7 @@ export interface TestFile {
path: string;
}
export function createTestFile(content: string, path: string): TestFile{
export function createTestFile(content: string, path: string): TestFile {
return {
content,
path

Просмотреть файл

@ -7,18 +7,18 @@ import * as archiver from 'archiver';
import { TestFile } from './TestFile';
export default class TestZip {
constructor(private readonly _buffer: Buffer, private readonly _files : TestFile[]){
constructor(private readonly _buffer: Buffer, private readonly _files: TestFile[]) {
}
get buffer(): Buffer{
get buffer(): Buffer {
return this._buffer;
}
get size(): number{
get size(): number {
return this._buffer.length;
}
get files(): TestFile[]{
get files(): TestFile[] {
return this._files;
}

2
typings/vscode-extension-telemetry.d.ts поставляемый
Просмотреть файл

@ -5,7 +5,7 @@
declare module 'vscode-extension-telemetry' {
export default class TelemetryReporter {
constructor(extensionId: string,extensionVersion: string, key: string);
constructor(extensionId: string, extensionVersion: string, key: string);
sendTelemetryEvent(eventName: string, properties?: { [key: string]: string }, measures?: { [key: string]: number }): void;
}
}