File tree Expand file tree Collapse file tree
tests/cases/fourslash/server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,10 +152,11 @@ module ts.server {
152152 }
153153
154154 getQuickInfoAtPosition ( fileName : string , position : number ) : QuickInfo {
155+ var lineCol = this . positionToOneBasedLineCol ( fileName , position ) ;
155156 var args : ServerProtocol . CodeLocationRequestArgs = {
156157 file : fileName ,
157- line : 0 ,
158- col : 1
158+ line : lineCol . line ,
159+ col : lineCol . col
159160 } ;
160161
161162 var request = this . processRequest < ServerProtocol . QuickInfoRequest > ( CommandNames . Quickinfo , args ) ;
@@ -168,10 +169,8 @@ module ts.server {
168169 kind : response . body . kind ,
169170 kindModifiers : response . body . kindModifiers ,
170171 textSpan : ts . createTextSpanFromBounds ( start , end ) ,
171- displayParts : undefined ,
172- documentation : undefined ,
173- documentationString : response . body . documentation ,
174- displayString : response . body . displayString
172+ displayParts : [ { kind : "text" , text : response . body . displayString } ] ,
173+ documentation : [ { kind : "text" , text : response . body . documentation } ]
175174 } ;
176175 }
177176
Original file line number Diff line number Diff line change 1+ /// <reference path="fourslash.ts"/>
2+
3+ ////interface One {
4+ //// commonProperty: number;
5+ //// commonFunction(): number;
6+ //// }
7+ ////
8+ ////interface Two {
9+ //// commonProperty: string
10+ //// commonFunction(): number;
11+ //// }
12+ ////
13+ ////var /*1*/x : One | Two;
14+ ////
15+ ////x./*2*/commonProperty;
16+ ////x./*3*/commonFunction;
17+
18+
19+ goTo . marker ( "1" ) ;
20+ verify . quickInfoIs ( '(var) x: One | Two' ) ;
21+
22+
23+ goTo . marker ( "2" ) ;
24+ verify . quickInfoIs ( '(property) commonProperty: string | number' ) ;
25+
26+ goTo . marker ( "3" ) ;
27+ verify . quickInfoIs ( '(method) commonFunction(): number' ) ;
You can’t perform that action at this time.
0 commit comments