Skip to content

Initial JSX support for class attributes added#49

Merged
pranaygp merged 4 commits intopranaygp:masterfrom
RayMcCl:master
Nov 29, 2018
Merged

Initial JSX support for class attributes added#49
pranaygp merged 4 commits intopranaygp:masterfrom
RayMcCl:master

Conversation

@RayMcCl
Copy link
Copy Markdown

@RayMcCl RayMcCl commented Nov 27, 2018

The below set of changes adds simple support for JSX peek through the same mechanism that is already present. This is related to the below issue:

#3

attribute = htmlScanner.getTokenText().toLowerCase();

// Convert the attribute to a standard class attribute
if (attribute === 'classname') {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this work with className (i.e. camelcased)?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my test cases I had the JSX instance written as "className" and it was converted to "classname" by the scanner.

@pranaygp
Copy link
Copy Markdown
Owner

Can we add test files (a .js and .jsx) that have one of the test classes and/or ids here https://github.com/pranaygp/vscode-css-peek/tree/master/client/test/test_files. You can see the .html files making references to the classes and ids listed in the .css and .scss files.

These files aren't tested by the test suite (yet). They just exist so you can test the extension's behaviour manually.

@RayMcCl
Copy link
Copy Markdown
Author

RayMcCl commented Nov 28, 2018

JS and JSX files have been added which follow the same structure as the existing HTML test.

@pranaygp
Copy link
Copy Markdown
Owner

@ReiMcCl seems like you're not using className in any of the examples. Could you update atleast one of them to use className and then we can ship this 👌

@RayMcCl
Copy link
Copy Markdown
Author

RayMcCl commented Nov 28, 2018

Added className to the example js and jsx file 👍

@pranaygp
Copy link
Copy Markdown
Owner

Thanks!

@pranaygp pranaygp merged commit 511dd91 into pranaygp:master Nov 29, 2018
@pranaygp
Copy link
Copy Markdown
Owner

Shipped in version 2.2.0

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.

2 participants