11import * as vscode from 'vscode' ;
22import { DocumentSymbol } from 'vscode-languageclient' ;
3+ import { CodeObjectInfo } from '../codeObject' ;
34import { DocumentInfoProvider , ParameterInfo } from '../documentInfoProvider' ;
45import { SymbolProvider , SymbolTree } from './symbolProvider' ;
56import { Token } from './tokens' ;
@@ -13,16 +14,9 @@ export interface SymbolInfo {
1314 documentUri : vscode . Uri ;
1415}
1516
16- export interface CodeObjectInfo {
17- id : string ;
18- get ids ( ) : string [ ] ;
19- get idsWithType ( ) : string [ ] ;
20- }
21-
22- export interface CodeObjectLocationInfo extends CodeObjectInfo {
17+ export interface CodeObjectLocationInfo extends CodeObjectInfo {
2318 range : vscode . Range ;
2419 documentUri : vscode . Uri ;
25-
2620}
2721
2822export class EndpointInfo implements CodeObjectLocationInfo {
@@ -31,13 +25,20 @@ export class EndpointInfo implements CodeObjectLocationInfo {
3125 public method : string ,
3226 public path : string ,
3327 public range : vscode . Range ,
34- public documentUri : vscode . Uri ) { }
35- get idsWithType ( ) {
36- return [ 'endpoint:' + this . id ] ;
37- }
38- get ids ( ) {
39- return [ this . id ] ;
40- }
28+ public documentUri : vscode . Uri ,
29+ ) { }
30+
31+ get displayName ( ) : string {
32+ return this . method ;
33+ }
34+
35+ get idsWithType ( ) {
36+ return [ 'endpoint:' + this . id ] ;
37+ }
38+
39+ get ids ( ) {
40+ return [ this . id ] ;
41+ }
4142}
4243
4344export class SpanLocationInfo implements CodeObjectLocationInfo {
@@ -47,7 +48,12 @@ export class SpanLocationInfo implements CodeObjectLocationInfo {
4748 public aliases : string [ ] ,
4849 public duplicates : SpanLocationInfo [ ] ,
4950 public range : vscode . Range ,
50- public documentUri : vscode . Uri ) { }
51+ public documentUri : vscode . Uri ,
52+ ) { }
53+
54+ get displayName ( ) : string {
55+ return this . name ;
56+ }
5157
5258 get idsWithType ( ) {
5359 return this . ids . map ( x => 'span:' + x ) ;
@@ -65,7 +71,7 @@ export interface IMethodExtractor {
6571 extractMethods (
6672 document : vscode . TextDocument ,
6773 docSymbols : DocumentSymbol [ ] ,
68- tokens : Token [ ]
74+ tokens : Token [ ] ,
6975 ) : Promise < SymbolInfo [ ] > ;
7076}
7177
0 commit comments