@codemirror/lang-javascript
Advanced tools
Comparing version 0.17.1 to 0.17.2
@@ -0,1 +1,9 @@ | ||
## 0.17.2 (2021-02-15) | ||
### Bug fixes | ||
Improve highlighting tag specificity of defined function and class names. Add indentation information for JSX constructs | ||
Support smart indent for JSX syntax. | ||
## 0.17.1 (2021-01-06) | ||
@@ -2,0 +10,0 @@ |
@@ -62,3 +62,14 @@ import { parser } from 'lezer-javascript'; | ||
"TemplateString BlockComment": () => -1, | ||
"Statement Property": continuedIndent({ except: /^{/ }) | ||
"Statement Property": continuedIndent({ except: /^{/ }), | ||
JSXElement(context) { | ||
let closed = /^\s*<\//.test(context.textAfter); | ||
return context.lineIndent(context.state.doc.lineAt(context.node.from)) + (closed ? 0 : context.unit); | ||
}, | ||
JSXEscape(context) { | ||
let closed = /\s*\}/.test(context.textAfter); | ||
return context.lineIndent(context.state.doc.lineAt(context.node.from)) + (closed ? 0 : context.unit); | ||
}, | ||
"JSXOpenTag JSXSelfClosingTag"(context) { | ||
return context.column(context.node.from) + context.unit; | ||
} | ||
}), | ||
@@ -89,2 +100,4 @@ foldNodeProp.add({ | ||
"CallExpression/MemberExpression/PropertyName": tags.function(tags.propertyName), | ||
"FunctionDeclaration/VariableDefinition": tags.function(tags.definition(tags.variableName)), | ||
"ClassDeclaration/VariableDefinition": tags.definition(tags.className), | ||
PropertyNameDefinition: tags.definition(tags.propertyName), | ||
@@ -91,0 +104,0 @@ UpdateOp: tags.updateOperator, |
{ | ||
"name": "@codemirror/lang-javascript", | ||
"version": "0.17.1", | ||
"version": "0.17.2", | ||
"description": "JavaScript language support for the CodeMirror code editor", | ||
@@ -5,0 +5,0 @@ "scripts": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48797
460