Skip to content

add support for refactor command #172

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 6, 2017
Merged

add support for refactor command #172

merged 2 commits into from
Aug 6, 2017

Conversation

ananthakumaran
Copy link
Owner

@josteink
Copy link
Collaborator

Looks good upon initial skimming, but I'm on vacation the next 3 weeks and won't be able to properly review this until after that.

Hope that's ok.

@josteink
Copy link
Collaborator

josteink commented Jul 31, 2017

I've done some preliminary testing, and as far as I can tell... The tide-refactor command does not really work for the supplied sample at all, if in a TypeScript-file.

To make it work, I need to create a Javascript file and enable tide for my js-mode hook too. And to find out that, I needed to dig in various Github issues in the typescript repo.

Is that how it's supposed to work? Or are there refactorings which should be supported in TypeScript too? Right now it's not really very obvious, bordering on undiscoverable.

As such I think we should aim to do better. Would it be possible to add a warning that some refactorings are only available for Javascript-files when tsserver returns that no refactorings are available?

(Stellar job on tide during july when I've been on vacation btw. I see you've handled a good deal of issues and PRs. Seriously good job!)

@ananthakumaran
Copy link
Owner Author

There is only one refactoring available for now and that is only supported for js files.

As such I think we should aim to do better. Would it be possible to add a warning that some refactorings are only available for Javascript-files when tsserver returns that no refactorings are available?

Well I am ok with adding more info instead of just showing No refactorings available, but the caveat is, tsserver could add more refactoring in the future or some plugins could provide extra refactoring options. We can't say for sure.

@josteink
Copy link
Collaborator

Well I am ok with adding more info instead of just showing No refactorings available, but the caveat is, tsserver could add more refactoring in the future or some plugins could provide extra refactoring options. We can't say for sure.

How about we display No refactorings available (A javascript-file may be required)if we detect that the active major-mode is not typescript-mode?

@josteink
Copy link
Collaborator

josteink commented Aug 6, 2017

So should I just go ahead and make those changes myself?

@ananthakumaran
Copy link
Owner Author

done

@josteink
Copy link
Collaborator

josteink commented Aug 6, 2017

LGTM. Merge at will.

@ananthakumaran ananthakumaran merged commit 1e9b4d1 into master Aug 6, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants