kristijanhusak/vim-js-file-import

redundant choices

Closed this issue · 4 comments

const HeaderContainer = props => <Header {...props} />;

after placing a cursor on Header and pressing <leader>if I get the following:

Select file to import:
1) /home/linux/Documents/projects/projectName/src/components/Header/Header.jsx
2) Header.jsx - File
3 Enter path to file or package ...

Choosing either 1 or 2 gives the correct import Header from './Header';
I'm wondering if such thing can be automated and why this is happening in the first place?

What do you get as output when you type :echo tagfiles() in vim?

The actual output is: ['/home/linux/Documents/projects/react-way-of-samurai/tags']
PS. in the example above I used fake path (projectName -> react-way-of-samurai)

I just pushed a fix. Issue is that your tags file is not in your currently working directory, and thus it doesn't properly exclude certain matches. Should be fixed now.

That was fast !! I appreciate it. I tested it and it's working as I hoped.