Skip to content

Commit 1859ca1

Browse files
authored
Merge pull request #472 from anteprimorac/feature/support-jsx-custom-tags
add support for jsx custom tags
2 parents 243b562 + 4991b71 commit 1859ca1

File tree

3 files changed

+46
-1
lines changed

3 files changed

+46
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this extension will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.11.0] 2023-03-04
9+
### Added
10+
- support for JSX custom tags
11+
812
## [0.10.0] 2023-02-01
913
### Added
1014
- basic support for JSX (javascript and typescript)

src/closing-labels-decorations.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,6 @@ export default class ClosingLabelsDecorations implements vscode.Disposable {
231231
node.closingElement.loc &&
232232
node.openingElement.loc &&
233233
node.openingElement.name.type === 'JSXIdentifier' &&
234-
node.openingElement.name.name.toLowerCase() === node.openingElement.name.name &&
235234
node.openingElement.loc.end.line !== node.closingElement.loc.start.line
236235
) {
237236
let id: string | undefined;

src/test/suite/extension.test.ts

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ function Component() {
118118
<div className="test-inline-class"></div>
119119
<div id="test-inline-id"></div>
120120
<div id="test-inline-both-id" class="test-inline-both-class"></div>
121+
<Box id="test-custom-id">
122+
</Box>
123+
<Box className="test-custom-class">
124+
</Box>
125+
<Box className="test-custom-both-class" id="test-custom-both-id">
126+
</Box>
127+
<Box className="test-custom-inline-class"></Box>
121128
</div>
122129
);
123130
}
@@ -143,6 +150,20 @@ export default Component;
143150
after: { contentText: '/#test-both-id.test-both-class' },
144151
},
145152
},
153+
{
154+
range: new vscode.Range(new vscode.Position(15, 6), new vscode.Position(15, 12)),
155+
renderOptions: { after: { contentText: '/#test-custom-id' } },
156+
},
157+
{
158+
range: new vscode.Range(new vscode.Position(17, 6), new vscode.Position(17, 12)),
159+
renderOptions: { after: { contentText: '/.test-custom-class' } },
160+
},
161+
{
162+
range: new vscode.Range(new vscode.Position(19, 6), new vscode.Position(19, 12)),
163+
renderOptions: {
164+
after: { contentText: '/#test-custom-both-id.test-custom-both-class' },
165+
},
166+
},
146167
]);
147168
});
148169

@@ -164,6 +185,13 @@ const Component: React.VFC<{ test: string }> = ({ test }) => {
164185
<div className="test-inline-class"></div>
165186
<div id="test-inline-id"></div>
166187
<div id="test-inline-both-id" class="test-inline-both-class"></div>
188+
<Box id="test-custom-id">
189+
</Box>
190+
<Box className="test-custom-class">
191+
</Box>
192+
<Box className="test-custom-both-class" id="test-custom-both-id">
193+
</Box>
194+
<Box className="test-custom-inline-class"></Box>
167195
</div>
168196
);
169197
}
@@ -189,6 +217,20 @@ export default Component;
189217
after: { contentText: '/#test-both-id.test-both-class' },
190218
},
191219
},
220+
{
221+
range: new vscode.Range(new vscode.Position(16, 6), new vscode.Position(16, 12)),
222+
renderOptions: { after: { contentText: '/#test-custom-id' } },
223+
},
224+
{
225+
range: new vscode.Range(new vscode.Position(18, 6), new vscode.Position(18, 12)),
226+
renderOptions: { after: { contentText: '/.test-custom-class' } },
227+
},
228+
{
229+
range: new vscode.Range(new vscode.Position(20, 6), new vscode.Position(20, 12)),
230+
renderOptions: {
231+
after: { contentText: '/#test-custom-both-id.test-custom-both-class' },
232+
},
233+
},
192234
]);
193235
});
194236
});

0 commit comments

Comments
 (0)