cmp-path icon indicating copy to clipboard operation
cmp-path copied to clipboard

completion includes file extensions in import statements

Open pontus-albert opened this issue 4 years ago • 6 comments

Is it possible to exclude file extensions from the suggestions in the case of import statements in TypeScript?

pontus-albert avatar Sep 01 '21 08:09 pontus-albert

I can implement it but we need consider it.

For example, we need to remove only .ts but .css should keep.

hrsh7th avatar Sep 02 '21 09:09 hrsh7th

I am able to get file paths completed without the file extensions in compe. Initially I thought this was because of another source for dirs, but obviously that was when importing from a dir with an index file. What was really happening was that I got a result for the file from the lsp.

I don't believe I got those results (file kind) from the lsp using the cmp plugin. Is there a difference with what results are shown from the lsp with compe vs cmp?

This is no longer an issue with cmp-path, so you may close it.

pontus-albert avatar Sep 04 '21 20:09 pontus-albert

@pontus-albert Were you able to resolve this issue with extensions? I am having same problem

Tauka avatar Sep 15 '21 11:09 Tauka

@pontus-albert Were you able to resolve this issue with extensions? I am having same problem

I went back to compe. But I find my self wanting to create a custom source, so I will probably install cmp again, and tackle this issue again. Maybe the solution would be a separate source that does not include the file extension, so that you can choose what to complete, just like you could with compe.

pontus-albert avatar Oct 26 '21 14:10 pontus-albert

I'm getting the file path completion from typescript-language-server. So I still can't understand the problem.

hrsh7th avatar Oct 26 '21 15:10 hrsh7th

Installed cmp again yesterday and it worked just like in compe. Don't know what went wrong the first time. The plugin is much improved in general since then too. Great work! Love how extendable it is.

pontus-albert avatar Nov 01 '21 14:11 pontus-albert