From 3e910bb07780b557b01c7eff71b28c9f18d90b0b Mon Sep 17 00:00:00 2001 From: KazariEX <1364035137@qq.com> Date: Mon, 26 Aug 2024 12:44:43 +0800 Subject: [PATCH] test: add renaming case --- .../language-server/tests/renaming.spec.ts | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/packages/language-server/tests/renaming.spec.ts b/packages/language-server/tests/renaming.spec.ts index eeb0e85dac..eec6001974 100644 --- a/packages/language-server/tests/renaming.spec.ts +++ b/packages/language-server/tests/renaming.spec.ts @@ -790,6 +790,93 @@ describe('Renaming', async () => { `); }); + it('Scoped Classes', async () => { + expect( + await requestRename('fixture.vue', 'vue', ` + + + `, 'bar') + ).toMatchInlineSnapshot(` + { + "changes": { + "file://\${testWorkspacePath}/fixture.vue": [ + { + "newText": "bar", + "range": { + "end": { + "character": 23, + "line": 4, + }, + "start": { + "character": 20, + "line": 4, + }, + }, + }, + { + "newText": "bar", + "range": { + "end": { + "character": 32, + "line": 3, + }, + "start": { + "character": 29, + "line": 3, + }, + }, + }, + { + "newText": "bar", + "range": { + "end": { + "character": 23, + "line": 3, + }, + "start": { + "character": 20, + "line": 3, + }, + }, + }, + { + "newText": "bar", + "range": { + "end": { + "character": 22, + "line": 2, + }, + "start": { + "character": 19, + "line": 2, + }, + }, + }, + { + "newText": "bar", + "range": { + "end": { + "character": 8, + "line": 7, + }, + "start": { + "character": 5, + "line": 7, + }, + }, + }, + ], + }, + } + `); + }); + const openedDocuments: TextDocument[] = []; afterEach(async () => {