File tree 2 files changed +28
-7
lines changed
tests/cases/fourslash/server
2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -484,18 +484,20 @@ namespace ts.server {
484
484
485
485
private getImplementation ( args : protocol . FileLocationRequestArgs , simplifiedResult : boolean ) : protocol . FileSpan [ ] | ImplementationLocation [ ] {
486
486
const { file, project } = this . getFileAndProject ( args ) ;
487
- const scriptInfo = project . getScriptInfoForNormalizedPath ( file ) ;
488
- const position = this . getPosition ( args , scriptInfo ) ;
487
+ const position = this . getPosition ( args , project . getScriptInfoForNormalizedPath ( file ) ) ;
489
488
const implementations = project . getLanguageService ( ) . getImplementationAtPosition ( file , position ) ;
490
489
if ( ! implementations ) {
491
490
return [ ] ;
492
491
}
493
492
if ( simplifiedResult ) {
494
- return implementations . map ( impl => ( {
495
- file : impl . fileName ,
496
- start : scriptInfo . positionToLineOffset ( impl . textSpan . start ) ,
497
- end : scriptInfo . positionToLineOffset ( ts . textSpanEnd ( impl . textSpan ) )
498
- } ) ) ;
493
+ return implementations . map ( ( { fileName, textSpan } ) => {
494
+ const scriptInfo = project . getScriptInfo ( fileName ) ;
495
+ return {
496
+ file : fileName ,
497
+ start : scriptInfo . positionToLineOffset ( textSpan . start ) ,
498
+ end : scriptInfo . positionToLineOffset ( ts . textSpanEnd ( textSpan ) )
499
+ } ;
500
+ } ) ;
499
501
}
500
502
else {
501
503
return implementations ;
Original file line number Diff line number Diff line change
1
+ /// <reference path='../fourslash.ts'/>
2
+
3
+ // @Filename : /bar.ts
4
+ ////import {Foo} from './foo'
5
+ ////
6
+ ////[|class A implements Foo {
7
+ //// func() {}
8
+ //// }|]
9
+ ////
10
+ ////[|class B implements Foo {
11
+ //// func() {}
12
+ //// }|]
13
+
14
+ // @Filename : /foo.ts
15
+ ////export interface /**/Foo {
16
+ //// func();
17
+ //// }
18
+
19
+ verify . allRangesAppearInImplementationList ( "" ) ;
You can’t perform that action at this time.
0 commit comments