mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-11-18 22:01:36 +08:00
38 lines
984 B
JavaScript
38 lines
984 B
JavaScript
|
/**
|
||
|
* Defines Elixir traits to enable various editor features,
|
||
|
* like automatic bracket insertion and indentation.
|
||
|
*/
|
||
|
const ElixirLanguageConfiguration = {
|
||
|
comments: {
|
||
|
lineComment: "#",
|
||
|
},
|
||
|
brackets: [
|
||
|
["{", "}"],
|
||
|
["[", "]"],
|
||
|
["(", ")"],
|
||
|
],
|
||
|
surroundingPairs: [
|
||
|
["{", "}"],
|
||
|
["[", "]"],
|
||
|
["(", ")"],
|
||
|
["'", "'"],
|
||
|
['"', '"'],
|
||
|
],
|
||
|
autoClosingPairs: [
|
||
|
{ open: "'", close: "'", notIn: ["string", "comment"] },
|
||
|
{ open: '"', close: '"', notIn: ["comment"] },
|
||
|
{ open: '"""', close: '"""' },
|
||
|
{ open: "`", close: "`", notIn: ["string", "comment"] },
|
||
|
{ open: "(", close: ")" },
|
||
|
{ open: "{", close: "}" },
|
||
|
{ open: "[", close: "]" },
|
||
|
{ open: "<<", close: ">>" },
|
||
|
],
|
||
|
indentationRules: {
|
||
|
increaseIndentPattern: /^\s*(after|else|catch|rescue|fn|[^#]*(do|<\-|\->|\{|\[|\=))\s*$/,
|
||
|
decreaseIndentPattern: /^\s*((\}|\])\s*$|(after|else|catch|rescue|end)\b)/,
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export default ElixirLanguageConfiguration;
|