Closed verkholantsev closed 6 years ago
Hi! Thank you for such an amazing plugin. It makes TypeScript development in vim so much productive.
Looks like I've found and issue, please take a look at details.
Two files in project: a.ts and b.ts.
a.ts
b.ts
// a.ts const a = () => { console.log('a'); } export default a; // b.ts import a from './a'; a();
a()
C-]
:TsuDefinition
Vim will open a.ts on const a = () => { ... } line
const a = () => { ... }
Vim does nothing
If we add debug output to tsuquyomi#gotoDefinition (source) we will see this response from tsserver:
tsuquyomi#gotoDefinition
[ { file: '/Users/averkholantcev/tmp/tsuquyomi-issue/a.ts', end: { offset: 38, line: 1 }, start: { offset: 11, line: 1 }, }, { file: '/Users/averkholantcev/tmp/tsuquyomi-issue/a.ts', end: { offset: 8, line: 1 }, start: { offset: 7, line: 1 }, }, ];
In current implementation tsuquyomi#gotoDefinition will do nothing if length of results is not equal 1.
Do you think that it would be reasonable to change behaviour to take last element from the list if length is greater than 1?
Closed issue because PR was merged
Hi! Thank you for such an amazing plugin. It makes TypeScript development in vim so much productive.
Looks like I've found and issue, please take a look at details.
Setup
Two files in project:
a.ts
andb.ts
.Steps to reproduce
a()
inb.ts
C-]
(or type:TsuDefinition
)Expected behaviour
Vim will open
a.ts
onconst a = () => { ... }
lineActual behaviour
Vim does nothing
Reason
If we add debug output to
tsuquyomi#gotoDefinition
(source) we will see this response from tsserver:In current implementation
tsuquyomi#gotoDefinition
will do nothing if length of results is not equal 1.Do you think that it would be reasonable to change behaviour to take last element from the list if length is greater than 1?