File tree 2 files changed +90
-0
lines changed
language-core/lib/codegen/template
2 files changed +90
-0
lines changed Original file line number Diff line number Diff line change @@ -713,6 +713,9 @@ function* generateReferencesForScopedCssClasses(
713
713
if ( ts . isIdentifier ( name ) ) {
714
714
walkIdentifier ( name ) ;
715
715
}
716
+ else if ( ts . isStringLiteral ( name ) ) {
717
+ literals . push ( name ) ;
718
+ }
716
719
else if ( ts . isComputedPropertyName ( name ) ) {
717
720
const { expression } = name ;
718
721
if ( ts . isStringLiteralLike ( expression ) ) {
Original file line number Diff line number Diff line change @@ -790,6 +790,93 @@ describe('Renaming', async () => {
790
790
` ) ;
791
791
} ) ;
792
792
793
+ it ( 'Scoped Classes' , async ( ) => {
794
+ expect (
795
+ await requestRename ( 'fixture.vue' , 'vue' , `
796
+ <template>
797
+ <div :class="'foo|'"></div>
798
+ <div :class="['foo', { 'foo': true }]"></div>
799
+ <div :class="{ foo }"></div>
800
+ </template>
801
+ <style scoped>
802
+ .foo { }
803
+ </style>
804
+ ` , 'bar' )
805
+ ) . toMatchInlineSnapshot ( `
806
+ {
807
+ "changes": {
808
+ "file://\${testWorkspacePath}/fixture.vue": [
809
+ {
810
+ "newText": "bar",
811
+ "range": {
812
+ "end": {
813
+ "character": 23,
814
+ "line": 4,
815
+ },
816
+ "start": {
817
+ "character": 20,
818
+ "line": 4,
819
+ },
820
+ },
821
+ },
822
+ {
823
+ "newText": "bar",
824
+ "range": {
825
+ "end": {
826
+ "character": 32,
827
+ "line": 3,
828
+ },
829
+ "start": {
830
+ "character": 29,
831
+ "line": 3,
832
+ },
833
+ },
834
+ },
835
+ {
836
+ "newText": "bar",
837
+ "range": {
838
+ "end": {
839
+ "character": 23,
840
+ "line": 3,
841
+ },
842
+ "start": {
843
+ "character": 20,
844
+ "line": 3,
845
+ },
846
+ },
847
+ },
848
+ {
849
+ "newText": "bar",
850
+ "range": {
851
+ "end": {
852
+ "character": 22,
853
+ "line": 2,
854
+ },
855
+ "start": {
856
+ "character": 19,
857
+ "line": 2,
858
+ },
859
+ },
860
+ },
861
+ {
862
+ "newText": "bar",
863
+ "range": {
864
+ "end": {
865
+ "character": 8,
866
+ "line": 7,
867
+ },
868
+ "start": {
869
+ "character": 5,
870
+ "line": 7,
871
+ },
872
+ },
873
+ },
874
+ ],
875
+ },
876
+ }
877
+ ` ) ;
878
+ } ) ;
879
+
793
880
const openedDocuments : TextDocument [ ] = [ ] ;
794
881
795
882
afterEach ( async ( ) => {
You can’t perform that action at this time.
0 commit comments