File tree Expand file tree Collapse file tree 2 files changed +17
-15
lines changed
Expand file tree Collapse file tree 2 files changed +17
-15
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { env } from 'vscode';
22import * as path from 'path' ;
33import { QueryHistoryConfig } from './config' ;
44import { LocalQueryInfo } from './query-results' ;
5- import { QueryHistoryInfo } from './query-history-info' ;
5+ import { getRawName , QueryHistoryInfo } from './query-history-info' ;
66import { RemoteQueryHistoryItem } from './remote-queries/remote-query-history-item' ;
77import { pluralize } from './helpers' ;
88import { VariantAnalysisHistoryItem } from './remote-queries/variant-analysis-history-item' ;
@@ -51,20 +51,9 @@ export class HistoryItemLabelProvider {
5151 * @returns the name of the query, unless there is a custom label for this query.
5252 */
5353 getShortLabel ( item : QueryHistoryInfo ) : string {
54- if ( item . userSpecifiedLabel ) {
55- return this . getLabel ( item ) ;
56- } else {
57- switch ( item . t ) {
58- case 'local' :
59- return item . getQueryName ( ) ;
60- case 'remote' :
61- return item . remoteQuery . queryName ;
62- case 'variant-analysis' :
63- return item . variantAnalysis . query . name ;
64- default :
65- assertNever ( item ) ;
66- }
67- }
54+ return item . userSpecifiedLabel
55+ ? this . getLabel ( item )
56+ : getRawName ( item ) ;
6857 }
6958
7059
Original file line number Diff line number Diff line change 11import { RemoteQueryHistoryItem } from './remote-queries/remote-query-history-item' ;
22import { VariantAnalysisHistoryItem } from './remote-queries/variant-analysis-history-item' ;
33import { LocalQueryInfo } from './query-results' ;
4+ import { assertNever } from './pure/helpers-pure' ;
45
56export type QueryHistoryInfo = LocalQueryInfo | RemoteQueryHistoryItem | VariantAnalysisHistoryItem ;
67
8+ export function getRawName ( item : QueryHistoryInfo ) : string {
9+ switch ( item . t ) {
10+ case 'local' :
11+ return item . getQueryName ( ) ;
12+ case 'remote' :
13+ return item . remoteQuery . queryName ;
14+ case 'variant-analysis' :
15+ return item . variantAnalysis . query . name ;
16+ default :
17+ assertNever ( item ) ;
18+ }
19+ }
You can’t perform that action at this time.
0 commit comments