Add python language support in codemirror (#2772)

Co-authored-by: Andres Alejos <andres.c.alejos.mil@army.mil>
This commit is contained in:
Andrés Alejos 2024-09-05 12:25:24 -04:00 committed by GitHub
parent adb50b6989
commit e211ef6027
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 56 additions and 0 deletions

View file

@ -9,6 +9,7 @@ import { json } from "@codemirror/lang-json";
import { xml } from "@codemirror/lang-xml";
import { css } from "@codemirror/lang-css";
import { html } from "@codemirror/lang-html";
import { python } from "@codemirror/lang-python";
import { yaml } from "@codemirror/lang-yaml";
import { javascript } from "@codemirror/lang-javascript";
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
@ -30,6 +31,11 @@ const sqlDesc = LanguageDescription.of({
support: sql(),
});
const pythonDesc = LanguageDescription.of({
name: "Python",
support: python(),
});
const yamlDesc = LanguageDescription.of({
name: "YAML",
support: yaml(),
@ -73,6 +79,7 @@ const markdownDesc = LanguageDescription.of({
elixirDesc,
erlangDesc,
sqlDesc,
pythonDesc,
yamlDesc,
jsonDesc,
xmlDesc,
@ -88,6 +95,7 @@ export const languages = [
elixirDesc,
erlangDesc,
sqlDesc,
pythonDesc,
yamlDesc,
jsonDesc,
xmlDesc,

View file

@ -12,6 +12,7 @@
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.2.3",
"@codemirror/lang-python": "^6.1.6",
"@codemirror/lang-sql": "^6.5.5",
"@codemirror/lang-xml": "^6.0.2",
"@codemirror/lang-yaml": "^6.1.1",
@ -1884,6 +1885,19 @@
"@lezer/markdown": "^1.0.0"
}
},
"node_modules/@codemirror/lang-python": {
"version": "6.1.6",
"resolved": "https://registry.npmjs.org/@codemirror/lang-python/-/lang-python-6.1.6.tgz",
"integrity": "sha512-ai+01WfZhWqM92UqjnvorkxosZ2aq2u28kHvr+N3gu012XqY2CThD67JPMHnGceRfXPDBmn1HnyqowdpF57bNg==",
"license": "MIT",
"dependencies": {
"@codemirror/autocomplete": "^6.3.2",
"@codemirror/language": "^6.8.0",
"@codemirror/state": "^6.0.0",
"@lezer/common": "^1.2.1",
"@lezer/python": "^1.1.4"
}
},
"node_modules/@codemirror/lang-sql": {
"version": "6.6.4",
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
@ -3190,6 +3204,17 @@
"@lezer/highlight": "^1.0.0"
}
},
"node_modules/@lezer/python": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.14.tgz",
"integrity": "sha512-ykDOb2Ti24n76PJsSa4ZoDF0zH12BSw1LGfQXCYJhJyOGiFTfGaX0Du66Ze72R+u/P35U+O6I9m8TFXov1JzsA==",
"license": "MIT",
"dependencies": {
"@lezer/common": "^1.2.0",
"@lezer/highlight": "^1.0.0",
"@lezer/lr": "^1.0.0"
}
},
"node_modules/@lezer/xml": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",
@ -16179,6 +16204,18 @@
"@lezer/markdown": "^1.0.0"
}
},
"@codemirror/lang-python": {
"version": "6.1.6",
"resolved": "https://registry.npmjs.org/@codemirror/lang-python/-/lang-python-6.1.6.tgz",
"integrity": "sha512-ai+01WfZhWqM92UqjnvorkxosZ2aq2u28kHvr+N3gu012XqY2CThD67JPMHnGceRfXPDBmn1HnyqowdpF57bNg==",
"requires": {
"@codemirror/autocomplete": "^6.3.2",
"@codemirror/language": "^6.8.0",
"@codemirror/state": "^6.0.0",
"@lezer/common": "^1.2.1",
"@lezer/python": "^1.1.4"
}
},
"@codemirror/lang-sql": {
"version": "6.6.4",
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
@ -17079,6 +17116,16 @@
"@lezer/highlight": "^1.0.0"
}
},
"@lezer/python": {
"version": "1.1.14",
"resolved": "https://registry.npmjs.org/@lezer/python/-/python-1.1.14.tgz",
"integrity": "sha512-ykDOb2Ti24n76PJsSa4ZoDF0zH12BSw1LGfQXCYJhJyOGiFTfGaX0Du66Ze72R+u/P35U+O6I9m8TFXov1JzsA==",
"requires": {
"@lezer/common": "^1.2.0",
"@lezer/highlight": "^1.0.0",
"@lezer/lr": "^1.0.0"
}
},
"@lezer/xml": {
"version": "1.0.4",
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",

View file

@ -16,6 +16,7 @@
"@codemirror/lang-javascript": "^6.2.1",
"@codemirror/lang-json": "^6.0.1",
"@codemirror/lang-markdown": "^6.2.3",
"@codemirror/lang-python": "^6.1.6",
"@codemirror/lang-sql": "^6.5.5",
"@codemirror/lang-xml": "^6.0.2",
"@codemirror/lang-yaml": "^6.1.1",