Skip to content

feat: add rename symbol within <script> tags - #111644

Merged
Martin Aeschlimann (aeschli) merged 5 commits into
microsoft:masterfrom
chenjigeng:master
Dec 9, 2020
Merged

Martin Aeschlimann (aeschli) merged 5 commits into
microsoft:masterfrom
chenjigeng:master

Conversation

@chenjigeng

Copy link
Copy Markdown
Contributor

This PR fixes #85411

@ghost

Deleted user (ghost) commented Dec 1, 2020 •

Copy link
Copy Markdown

CLA assistant check
All CLA requirements met.

@aeschli

Martin Aeschlimann (aeschli) commented Dec 1, 2020 •

Copy link
Copy Markdown
Contributor

The ts.LanguageService offers proper support for rename:

       getRenameInfo(fileName: string, position: number, options?: RenameInfoOptions): RenameInfo;
        findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean, providePrefixAndSuffixTextForRename?: boolean): readonly RenameLocation[] | undefined;

Did you try to use that?

@chenjigeng

chenjg88 (chenjigeng) commented Dec 1, 2020 •

Copy link
Copy Markdown
Contributor Author

OK~I try to use ts.LanguageService and it work. Martin Aeschlimann (@aeschli)

@aeschli

Copy link
Copy Markdown
Contributor

Vwry cool. We shoud also add a test. I think https://github.com/microsoft/vscode/blob/master/extensions/html-language-features/server/src/test/folding.test.ts#L19 is a good template. Just create a new file rename.test.ts based on that and test the outputs of the rename.

@chenjigeng

Copy link
Copy Markdown
Contributor Author

OK~let me see how do we do that

@chenjigeng

Copy link
Copy Markdown
Contributor Author

Martin Aeschlimann (@aeschli) Please take a look at the test case I wrote and the code has been updated a bit

@chenjigeng

Copy link
Copy Markdown
Contributor Author

I don't know why CI/monaco fail.I tried to run it locally, and it was successful

@aeschli

Copy link
Copy Markdown
Contributor

Change looks good, thanks!
I will merge the PR next week, we're currently in testing week and do not add new features.

@chenjigeng

Copy link
Copy Markdown
Contributor Author

OK~ thanks for your advice

@chenjigeng

Copy link
Copy Markdown
Contributor Author

If possible, please merge this PR. I'm afraid there may be conflicts after a long time Martin Aeschlimann (@aeschli)

@aeschli
Martin Aeschlimann (aeschli) merged commit 785097e into microsoft:master Dec 9, 2020
@aeschli

Copy link
Copy Markdown
Contributor

Thanks for the work, chenjg88 (@chenjigeng) !

@aeschli Martin Aeschlimann (aeschli) added the html HTML support issues label Jan 21, 2021
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

html HTML support issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[html] can't "rename symbol" within <script> tags

2 participants