mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 01:55:56 +08:00
Add python language support in codemirror (#2772)
Co-authored-by: Andres Alejos <andres.c.alejos.mil@army.mil>
This commit is contained in:
parent
adb50b6989
commit
e211ef6027
|
@ -9,6 +9,7 @@ import { json } from "@codemirror/lang-json";
|
||||||
import { xml } from "@codemirror/lang-xml";
|
import { xml } from "@codemirror/lang-xml";
|
||||||
import { css } from "@codemirror/lang-css";
|
import { css } from "@codemirror/lang-css";
|
||||||
import { html } from "@codemirror/lang-html";
|
import { html } from "@codemirror/lang-html";
|
||||||
|
import { python } from "@codemirror/lang-python";
|
||||||
import { yaml } from "@codemirror/lang-yaml";
|
import { yaml } from "@codemirror/lang-yaml";
|
||||||
import { javascript } from "@codemirror/lang-javascript";
|
import { javascript } from "@codemirror/lang-javascript";
|
||||||
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
|
import { erlang } from "@codemirror/legacy-modes/mode/erlang";
|
||||||
|
@ -30,6 +31,11 @@ const sqlDesc = LanguageDescription.of({
|
||||||
support: sql(),
|
support: sql(),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const pythonDesc = LanguageDescription.of({
|
||||||
|
name: "Python",
|
||||||
|
support: python(),
|
||||||
|
});
|
||||||
|
|
||||||
const yamlDesc = LanguageDescription.of({
|
const yamlDesc = LanguageDescription.of({
|
||||||
name: "YAML",
|
name: "YAML",
|
||||||
support: yaml(),
|
support: yaml(),
|
||||||
|
@ -73,6 +79,7 @@ const markdownDesc = LanguageDescription.of({
|
||||||
elixirDesc,
|
elixirDesc,
|
||||||
erlangDesc,
|
erlangDesc,
|
||||||
sqlDesc,
|
sqlDesc,
|
||||||
|
pythonDesc,
|
||||||
yamlDesc,
|
yamlDesc,
|
||||||
jsonDesc,
|
jsonDesc,
|
||||||
xmlDesc,
|
xmlDesc,
|
||||||
|
@ -88,6 +95,7 @@ export const languages = [
|
||||||
elixirDesc,
|
elixirDesc,
|
||||||
erlangDesc,
|
erlangDesc,
|
||||||
sqlDesc,
|
sqlDesc,
|
||||||
|
pythonDesc,
|
||||||
yamlDesc,
|
yamlDesc,
|
||||||
jsonDesc,
|
jsonDesc,
|
||||||
xmlDesc,
|
xmlDesc,
|
||||||
|
|
47
assets/package-lock.json
generated
47
assets/package-lock.json
generated
|
@ -12,6 +12,7 @@
|
||||||
"@codemirror/lang-javascript": "^6.2.1",
|
"@codemirror/lang-javascript": "^6.2.1",
|
||||||
"@codemirror/lang-json": "^6.0.1",
|
"@codemirror/lang-json": "^6.0.1",
|
||||||
"@codemirror/lang-markdown": "^6.2.3",
|
"@codemirror/lang-markdown": "^6.2.3",
|
||||||
|
"@codemirror/lang-python": "^6.1.6",
|
||||||
"@codemirror/lang-sql": "^6.5.5",
|
"@codemirror/lang-sql": "^6.5.5",
|
||||||
"@codemirror/lang-xml": "^6.0.2",
|
"@codemirror/lang-xml": "^6.0.2",
|
||||||
"@codemirror/lang-yaml": "^6.1.1",
|
"@codemirror/lang-yaml": "^6.1.1",
|
||||||
|
@ -1884,6 +1885,19 @@
|
||||||
"@lezer/markdown": "^1.0.0"
|
"@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": {
|
"node_modules/@codemirror/lang-sql": {
|
||||||
"version": "6.6.4",
|
"version": "6.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
|
||||||
|
@ -3190,6 +3204,17 @@
|
||||||
"@lezer/highlight": "^1.0.0"
|
"@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": {
|
"node_modules/@lezer/xml": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",
|
||||||
|
@ -16179,6 +16204,18 @@
|
||||||
"@lezer/markdown": "^1.0.0"
|
"@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": {
|
"@codemirror/lang-sql": {
|
||||||
"version": "6.6.4",
|
"version": "6.6.4",
|
||||||
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
|
"resolved": "https://registry.npmjs.org/@codemirror/lang-sql/-/lang-sql-6.6.4.tgz",
|
||||||
|
@ -17079,6 +17116,16 @@
|
||||||
"@lezer/highlight": "^1.0.0"
|
"@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": {
|
"@lezer/xml": {
|
||||||
"version": "1.0.4",
|
"version": "1.0.4",
|
||||||
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/@lezer/xml/-/xml-1.0.4.tgz",
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
"@codemirror/lang-javascript": "^6.2.1",
|
"@codemirror/lang-javascript": "^6.2.1",
|
||||||
"@codemirror/lang-json": "^6.0.1",
|
"@codemirror/lang-json": "^6.0.1",
|
||||||
"@codemirror/lang-markdown": "^6.2.3",
|
"@codemirror/lang-markdown": "^6.2.3",
|
||||||
|
"@codemirror/lang-python": "^6.1.6",
|
||||||
"@codemirror/lang-sql": "^6.5.5",
|
"@codemirror/lang-sql": "^6.5.5",
|
||||||
"@codemirror/lang-xml": "^6.0.2",
|
"@codemirror/lang-xml": "^6.0.2",
|
||||||
"@codemirror/lang-yaml": "^6.1.1",
|
"@codemirror/lang-yaml": "^6.1.1",
|
||||||
|
|
Loading…
Reference in a new issue