Skip to content
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

feat: add support for rename prefixText and suffixText on rename #478

Merged
merged 2 commits into from
Jun 6, 2022
Merged

Conversation

jackieaskins
Copy link
Contributor

The server supports setting providePrefixAndSuffixTextForRename, which may return prefixText or suffixText as part of the rename response. These values are currently being ignored.

Example:

import { useState } from "react";

Renaming useState to useStateTest with providePrefixAndSuffixTextForRename set to true currently results in the following:

import { useStateTest } from "react";

This is an error since useStateTest is not defined. After this change, renaming results in:

import { useState as useStateTest } from "react";

I didn't see any tests for rename, but can add some if necessary.

@rchl
Copy link
Member

rchl commented Jun 5, 2022

That looks good but I would also enable that option by default since it's supported now and should generally provide better results.

Here:

@rchl rchl changed the title feat: add support for rename prefixText and suffixText feat: add support for rename prefixText and suffixText on rename Jun 6, 2022
@rchl rchl merged commit b3c8535 into typescript-language-server:master Jun 6, 2022
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.

None yet

2 participants