@codemirror/lang-javascript
Advanced tools
Comparing version 6.1.3 to 6.1.4
@@ -0,1 +1,7 @@ | ||
## 6.1.4 (2023-02-13) | ||
### Bug fixes | ||
Make sure code in JSX context can be commented correctly. | ||
## 6.1.3 (2023-02-02) | ||
@@ -2,0 +8,0 @@ |
import { parser } from '@lezer/javascript'; | ||
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, LanguageSupport } from '@codemirror/language'; | ||
import { syntaxTree, LRLanguage, indentNodeProp, continuedIndent, flatIndent, delimitedIndent, foldNodeProp, foldInside, defineLanguageFacet, sublanguageProp, LanguageSupport } from '@codemirror/language'; | ||
import { EditorSelection } from '@codemirror/state'; | ||
@@ -308,2 +308,6 @@ import { EditorView } from '@codemirror/view'; | ||
}); | ||
const jsxSublanguage = { | ||
test: node => /^JSX/.test(node.name), | ||
facet: /*@__PURE__*/defineLanguageFacet({ commentTokens: { block: { open: "{/*", close: "*/}" } } }) | ||
}; | ||
/** | ||
@@ -316,7 +320,13 @@ A language provider for TypeScript. | ||
*/ | ||
const jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: "jsx" }); | ||
const jsxLanguage = /*@__PURE__*/javascriptLanguage.configure({ | ||
dialect: "jsx", | ||
props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)] | ||
}); | ||
/** | ||
Language provider for JSX + TypeScript. | ||
*/ | ||
const tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({ dialect: "jsx ts" }, "typescript"); | ||
const tsxLanguage = /*@__PURE__*/javascriptLanguage.configure({ | ||
dialect: "jsx ts", | ||
props: [/*@__PURE__*/sublanguageProp.add(n => n.isTop ? [jsxSublanguage] : undefined)] | ||
}, "typescript"); | ||
const keywords = /*@__PURE__*/"break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(kw => ({ label: kw, type: "keyword" })); | ||
@@ -323,0 +333,0 @@ /** |
{ | ||
"name": "@codemirror/lang-javascript", | ||
"version": "6.1.3", | ||
"version": "6.1.4", | ||
"description": "JavaScript language support for the CodeMirror code editor", | ||
@@ -30,3 +30,3 @@ "scripts": { | ||
"@codemirror/autocomplete": "^6.0.0", | ||
"@codemirror/language": "^6.0.0", | ||
"@codemirror/language": "^6.6.0", | ||
"@codemirror/lint": "^6.0.0", | ||
@@ -33,0 +33,0 @@ "@codemirror/state": "^6.0.0", |
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
53837
1016
Updated@codemirror/language@^6.6.0