@@ -15,6 +15,8 @@ export interface PathTableState {
1515 selectedPathNode : undefined | Keys . PathNode ;
1616}
1717
18+ type InterpretedResultsColumn = InterpretedResultsSortColumn | 'file-position' ;
19+
1820export class PathTable extends React . Component < PathTableProps , PathTableState > {
1921 constructor ( props : PathTableProps ) {
2022 super ( props ) ;
@@ -54,16 +56,21 @@ export class PathTable extends React.Component<PathTableProps, PathTableState> {
5456 }
5557 }
5658
57- toggleSortStateForColumn ( column : InterpretedResultsSortColumn ) : void {
59+ getNextSortState ( column : InterpretedResultsColumn ) : InterpretedResultsSortState | undefined {
60+ if ( column === 'file-position' ) {
61+ return undefined ;
62+ }
5863 const oldSortState = this . props . resultSet . sortState ;
5964 const prevDirection = oldSortState && oldSortState . sortBy === column ? oldSortState . sortDirection : undefined ;
6065 const nextDirection = nextSortDirection ( prevDirection ) ;
61- const sortState : InterpretedResultsSortState | undefined =
62- nextDirection === undefined ? undefined :
63- { sortBy : column , sortDirection : nextDirection } ;
66+ return nextDirection === undefined ? undefined :
67+ { sortBy : column , sortDirection : nextDirection } ;
68+ }
69+
70+ toggleSortStateForColumn ( column : InterpretedResultsSortColumn | 'file-position' ) : void {
6471 vscode . postMessage ( {
6572 t : 'changeInterpretedSort' ,
66- sortState,
73+ sortState : this . getNextSortState ( column ) ,
6774 } ) ;
6875 }
6976
@@ -74,7 +81,7 @@ export class PathTable extends React.Component<PathTableProps, PathTableState> {
7481 < tr >
7582 < th colSpan = { 2 } > </ th >
7683 < th className = { this . sortClass ( 'alert-message' ) + ' vscode-codeql__alert-message-cell' } colSpan = { 2 } onClick = { ( ) => this . toggleSortStateForColumn ( 'alert-message' ) } > Message</ th >
77- < th className = { this . sortClass ( 'file-position' ) + ' vscode-codeql__location-cell'} onClick = { ( ) => this . toggleSortStateForColumn ( 'file-position' ) } > Location</ th >
84+ < th className = { 'sort-none vscode-codeql__location-cell'} onClick = { ( ) => this . toggleSortStateForColumn ( 'file-position' ) } > Location</ th >
7885 </ tr >
7986 </ thead > ;
8087
0 commit comments