neoclide / coc-tsserver

Tsserver extension for coc.nvim that provide rich features like VSCode for javascript & typescript
MIT License
1.06k stars 68 forks source link

"Move to a new file" action works weird #428

Closed dr0bz closed 1 year ago

dr0bz commented 1 year ago

Precondition: I have a file feature.ts with a class in it:

export default class Feature {

}

What i want to do is to refactor: rename class and the file to Component and component.ts respectively. Class renaming works pretty well, but renaming the file - NOT.

The issue:

Steps to reproduce:

The Result:

I end up with

My expectation:

CocCommand workspace.renameCurrentFile - works as expected. Am i missing the purpose of 'Move to a new file' function?

fannheyward commented 1 year ago

The Move to a new file code action is came from tsserver, which didn't prompt you for a new file name.

Same behavior in VSCode, this is tsserver's limit.

dr0bz commented 1 year ago

Thanks for clarification. Then :CocCommand workspace.renameCurrentFile is the only way i can achieve it.