Formatting, naming consistency.

This commit is contained in:
Jason Reed
2020-02-13 08:04:28 -05:00
parent 256890fd6c
commit 5c90e5fd19
7 changed files with 15 additions and 15 deletions

View File

@@ -117,7 +117,7 @@ export enum SortDirection {
export interface RawResultsSortState {
columnIndex: number;
direction: SortDirection;
sortDirection: SortDirection;
}
export type InterpretedResultsSortColumn =

View File

@@ -113,7 +113,7 @@ export class CompletedQuery implements QueryWithResults {
sortState
};
await server.sortBqrs(this.query.resultsPaths.resultsPath, sortedResultSetInfo.resultsPath, resultSetName, [sortState.columnIndex], [sortState.direction]);
await server.sortBqrs(this.query.resultsPaths.resultsPath, sortedResultSetInfo.resultsPath, resultSetName, [sortState.columnIndex], [sortState.sortDirection]);
this.sortedResultsInfo.set(resultSetName, sortedResultSetInfo);
}

View File

@@ -54,7 +54,7 @@ export class RawTable extends React.Component<RawTableProps, {}> {
<th key={-1}><b>#</b></th>,
...resultSet.schema.columns.map((col, index) => {
const displayName = col.name || `[${index}]`;
const sortDirection = this.props.sortState && index === this.props.sortState.columnIndex ? this.props.sortState.direction : undefined;
const sortDirection = this.props.sortState && index === this.props.sortState.columnIndex ? this.props.sortState.sortDirection : undefined;
return <th className={"sort-" + (sortDirection !== undefined ? SortDirection[sortDirection] : "none")} key={index} onClick={() => this.toggleSortStateForColumn(index)}><b>{displayName}</b></th>;
})
]
@@ -69,11 +69,11 @@ export class RawTable extends React.Component<RawTableProps, {}> {
private toggleSortStateForColumn(index: number) {
const sortState = this.props.sortState;
const prevDirection = sortState && sortState.columnIndex === index ? sortState.direction : undefined;
const prevDirection = sortState && sortState.columnIndex === index ? sortState.sortDirection : undefined;
const nextDirection = nextSortDirection(prevDirection);
const nextSortState = nextDirection === undefined ? undefined : {
columnIndex: index,
direction: nextDirection
sortDirection: nextDirection
};
vscode.postMessage({
t: 'changeSort',

View File

@@ -10,7 +10,7 @@ describe('launching with a minimal workspace', async () => {
it('should not activate the extension at first', () => {
assert(ext!.isActive === false);
});
it('should activate the extension when a .ql file is opened', async function () {
it('should activate the extension when a .ql file is opened', async function() {
const folders = vscode.workspace.workspaceFolders;
assert(folders && folders.length === 1);
const folderPath = folders![0].uri.fsPath;

View File

@@ -14,7 +14,7 @@ describe("archive filesystem provider", () => {
});
});
describe('source archive uri encoding', function () {
describe('source archive uri encoding', function() {
const testCases: { name: string, input: ZipFileReference }[] = [
{
name: 'mixed case and unicode',
@@ -30,7 +30,7 @@ describe('source archive uri encoding', function () {
}
];
for (const testCase of testCases) {
it(`should work round trip with ${testCase.name}`, function () {
it(`should work round trip with ${testCase.name}`, function() {
const output = decodeSourceArchiveUri(encodeSourceArchiveUri(testCase.input));
expect(output).to.eql(testCase.input);
});

View File

@@ -151,8 +151,8 @@ describe("Release version ordering", () => {
patchVersion,
prereleaseVersion,
rawString: `${majorVersion}.${minorVersion}.${patchVersion}` +
prereleaseVersion ? `-${prereleaseVersion}` : "" +
buildMetadata ? `+${buildMetadata}` : ""
prereleaseVersion ? `-${prereleaseVersion}` : "" +
buildMetadata ? `+${buildMetadata}` : ""
};
}

View File

@@ -4,7 +4,7 @@ import * as tmp from "tmp";
import { window, ViewColumn, Uri } from "vscode";
import { fileUriToWebviewUri, webviewUriToFileUri } from '../../interface';
describe('webview uri conversion', function () {
describe('webview uri conversion', function() {
const fileSuffix = '.bqrs';
function setupWebview(filePrefix: string) {
@@ -21,7 +21,7 @@ describe('webview uri conversion', function () {
]
}
);
after(function () {
after(function() {
panel.dispose();
tmpFile.removeCallback();
});
@@ -34,15 +34,15 @@ describe('webview uri conversion', function () {
panel
}
}
it('should correctly round trip from filesystem to webview and back', function () {
it('should correctly round trip from filesystem to webview and back', function() {
const { fileUriOnDisk, panel } = setupWebview('');
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);
const reconstructedFileUri = webviewUriToFileUri(webviewUri);
expect(reconstructedFileUri.toString(true)).to.equal(fileUriOnDisk.toString(true));
});
it("does not double-encode # in URIs", function () {
it("does not double-encode # in URIs", function() {
const { fileUriOnDisk, panel } = setupWebview('#');
const webviewUri = fileUriToWebviewUri(panel, fileUriOnDisk);
const parsedUri = Uri.parse(webviewUri);