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 @@ -484,18 +484,20 @@ namespace ts.server {
484484
485485 private getImplementation ( args : protocol . FileLocationRequestArgs , simplifiedResult : boolean ) : protocol . FileSpan [ ] | ImplementationLocation [ ] {
486486 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 ) ) ;
489488 const implementations = project . getLanguageService ( ) . getImplementationAtPosition ( file , position ) ;
490489 if ( ! implementations ) {
491490 return [ ] ;
492491 }
493492 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+ } ) ;
499501 }
500502 else {
501503 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