Open rvazarkar opened 8 years ago
I'm seeing the same behaviour.
I"m also having this issue
Anything with this format will break the scope.
state = {
}
I believe it's the equals sign which is causing the issue.
Scope above the state={}
Scope below the state={}
My source test:
class Root extends R.Component {
propTypes = {}
state = {}
constructor(props) {
super(props)
}
render() {
return (
<div>
</div>
)
}
}
export default Root
Changing the scope to meta.class.js
will allow the commands to work properly. And I think this is happening because we're defining a class property, so TM thinks we're looking to assign more meta.class.property.js
.
This syntax works and allows me to add above and below the propTypes assignments, but not inside braces or parentheses.
<scope>source.js meta.class.js -meta.group.braces.round -meta.group.braces.curly </scope>
Snippets will only work if your cursor is above the propTypes definition in a jsx file.
Apparently the propTypes syntax breaks the scope for the snippet parser, my guess is because of the colon + curly braces. Removing the propTypes definition will allow snippets to work anywhere in the class again
As a note, this is in ES6 class syntax