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 удалений

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

@ -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,8 +71,7 @@ export class CSharpConfigurationProvider implements vscode.DebugConfigurationPro
return [];
}
try
{
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}'.`);
@ -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 [];
}
@ -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;
}

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

@ -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);
}

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

@ -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,8 +48,7 @@ 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;
@ -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";

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

@ -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();
}
}

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

@ -332,8 +332,7 @@ function launchNixMono(launchPath: string, cwd: string, args: string[], environm
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");
}

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

@ -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]}`);
}

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

@ -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);
}

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

@ -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 {

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

@ -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();

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

@ -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);
}
});