Align highlighting

This commit is contained in:
Kolja Lampe
2019-02-10 17:54:22 +01:00
parent 0cc28dd7c6
commit 83e45103e3
5 changed files with 774 additions and 832 deletions

View File

@@ -1,15 +1,17 @@
{
"name": "elm-language-server",
"name": "elm-vscode-ls",
"displayName": "Elm",
"description": "A language server for Elm",
"description": "VSCode plugin using the elm-language-server",
"author": "Kolja Lampe",
"license": "MIT",
"version": "1.0.0",
"repository": {
"type": "git",
"url": "https://github.com/Microsoft/vscode-extension-samples"
"url": "https://github.com/razzeee/elm-language-server"
},
"categories": [],
"categories": [
"Programming Languages"
],
"keywords": [
"elm"
],
@@ -35,17 +37,28 @@
}
],
"grammars": [
{
"scopeName": "markdown.elm.codeblock",
"path": "./syntaxes/codeblock.json",
"injectTo": [
"text.html.markdown"
],
"embeddedLanguages": {
"meta.embedded.block.elm": "elm",
"meta.embedded.block.glsl": "glsl"
}
},
{
"language": "elm",
"scopeName": "source.elm",
"path": "./syntaxes/elm.tmLanguage"
"path": "./syntaxes/elm.json"
}
],
"configuration": {
"type": "object",
"title": "Debug configuration",
"properties": {
"languageServerExample.trace.server": {
"elmLS.trace.server": {
"scope": "window",
"type": "string",
"enum": [
@@ -72,4 +85,4 @@
"tslint": "^5.12.1",
"typescript": "3.2.4"
}
}
}

View File

@@ -1,223 +0,0 @@
'use strict';
import * as cp from 'child_process';
import Uri from 'vscode-uri/lib/umd'
import {
createConnection,
TextDocuments,
TextDocument,
Diagnostic,
DiagnosticSeverity,
ProposedFeatures,
InitializeParams,
DidChangeConfigurationNotification,
CompletionItem,
CompletionItemKind,
TextDocumentPositionParams,
Range,
Position,
TextEdit
} from 'vscode-languageserver';
// import { ElmAnalyse } from './elmAnalyse';
// Create a connection for the server. The connection uses Node's IPC as a transport.
// Also include all preview / proposed LSP features.
let connection = createConnection(ProposedFeatures.all);
// Create a simple text document manager. The text document manager
// supports full document sync only
let documents: TextDocuments = new TextDocuments();
let hasConfigurationCapability: boolean = false;
let hasWorkspaceFolderCapability: boolean = false;
let rootPath: string = undefined;
connection.onInitialize((params: InitializeParams) => {
let capabilities = params.capabilities;
this.rootPath = params.rootPath;
// Does the client support the `workspace/configuration` request?
// If not, we will fall back using global settings
hasConfigurationCapability =
capabilities.workspace && !!capabilities.workspace.configuration;
hasWorkspaceFolderCapability =
capabilities.workspace && !!capabilities.workspace.workspaceFolders;
return {
capabilities: {
textDocumentSync: documents.syncKind,
// Tell the client that the server supports code completion
completionProvider: {
resolveProvider: true
}
}
};
});
connection.onInitialized(() => {
if (hasConfigurationCapability) {
// Register for all configuration changes.
connection.client.register(
DidChangeConfigurationNotification.type,
undefined
);
}
if (hasWorkspaceFolderCapability) {
connection.workspace.onDidChangeWorkspaceFolders(_event => {
connection.console.log('Workspace folder change event received.');
});
}
});
documents.onDidOpen(params => {
// const elmAnalyseIssues: IElmIssue[] = [];
// const elmAnalyse = new ElmAnalyse(elmAnalyseIssues);
// runLinter(connection, this.rootPath, params.document);
validateTextDocument(params.document);
});
documents.onDidSave(params => {
// const elmAnalyseIssues: IElmIssue[] = [];
// const elmAnalyse = new ElmAnalyse(elmAnalyseIssues);
// runLinter(connection, this.rootPath, params.document);
validateTextDocument(params.document);
});
async function validateTextDocument(textDocument: TextDocument): Promise<void> {
connection.console.log('Validate text');
// let uri = Uri.parse(textDocument.uri);
// let diagnostics: Diagnostic[] = []
// try {
// await Compiler.compileToString(uri.fsPath, { report: 'json' })
// var x = await Compiler.findAllDependencies(uri.fsPath);
// connection.console.log(x);
// } catch (err) {
// const issues = JSON.parse(err.message.split('\n')[1]);
// const byFile = issues.reduce((acc: any, issue: any) => {
// if (acc[issue.file]) {
// acc[issue.file].push(issue);
// } else {
// acc[issue.file] = [issue];
// }
// return acc;
// }, {});
// Object.keys(byFile).forEach((file: string) => {
// byFile[file].map((issue: any) => {
// diagnostics.push( {
// severity: DiagnosticSeverity.Error,
// source: "Elm",
// message: issue.details,
// range: {
// start: {
// line: issue.region.start.line - 1,
// character: issue.region.start.column - 1,
// },
// end: {
// line: issue.region.end.line - 1,
// character: issue.region.end.column - 1,
// },
// },
// });
// });
// });
// }
// finally {
// connection.sendDiagnostics({
// uri: textDocument.uri,
// diagnostics: diagnostics,
// });
// }
};
connection.onDidChangeWatchedFiles(_change => {
// Monitored files have change in VSCode
connection.console.log('We received an file change event');
});
// This handler provides the initial list of the completion items.
connection.onCompletion(
(_textDocumentPosition: TextDocumentPositionParams): CompletionItem[] => {
// The pass parameter contains the position of the text document in
// which code complete got requested. For the example we ignore this
// info and always provide the same completion items.
return [
{
label: 'TypeScript',
kind: CompletionItemKind.Text,
data: 1
},
{
label: 'JavaScript',
kind: CompletionItemKind.Text,
data: 2
}
];
}
);
// This handler resolve additional information for the item selected in
// the completion list.
connection.onCompletionResolve(
(item: CompletionItem): CompletionItem => {
if (item.data === 1) {
(item.detail = 'TypeScript details'),
(item.documentation = 'TypeScript documentation');
} else if (item.data === 2) {
(item.detail = 'JavaScript details'),
(item.documentation = 'JavaScript documentation');
}
return item;
}
);
connection.onDocumentFormatting(params => {
const document = documents.get(params.textDocument.uri);
const text = document.getText();
const wholeDocument = Range.create(
Position.create(0, 0),
document.positionAt(text.length - 1),
);
return new Promise<string>((resolve, reject) => {
const cmd = cp.exec('elm-format --stdin', (err, stdout) => {
err ? reject(err) : resolve(stdout);
});
cmd.stdin.write(text);
cmd.stdin.end();
})
.then(formattedText => {
return [TextEdit.replace(wholeDocument, formattedText)];
})
.catch(_err => {
// if ((<string>err.message).indexOf('SYNTAX PROBLEM') >= 0) {
// return new LServer.ResponseError(
// LServer.ErrorCodes.ParseError,
// 'Running elm-format failed. Check the file for syntax errors.',
// );
// } else {
// return new LServer.ResponseError(
// LServer.ErrorCodes.InternalError,
// 'Running elm-format failed. Install from ' +
// "https://github.com/avh4/elm-format and make sure it's on your path",
// );
// }
return [];
});
});
// Make the text document manager listen on the connection
// for open, change and close text document events
documents.listen(connection);
// Listen on the connection
connection.listen();

45
syntaxes/codeblock.json Normal file
View File

@@ -0,0 +1,45 @@
{
"fileTypes": [],
"injectionSelector": "L:text.html.markdown",
"patterns": [
{
"include": "#fenced_code_block_elm"
}
],
"repository": {
"fenced_code_block_elm": {
"begin": "(^|\\G)(\\s*)(`{3,}|~{3,})\\s*(?i:(elm)(\\s+[^`~]*)?$)",
"name": "markup.fenced_code.block.markdown",
"end": "(^|\\G)(\\2|\\s{0,3})(\\3)\\s*$",
"beginCaptures": {
"3": {
"name": "punctuation.definition.markdown"
},
"5": {
"name": "fenced_code.block.language"
},
"6": {
"name": "fenced_code.block.language.attributes"
}
},
"endCaptures": {
"3": {
"name": "punctuation.definition.markdown"
}
},
"patterns": [
{
"begin": "(^|\\G)(\\s*)(.*)",
"while": "(^|\\G)(?!\\s*([`~]{3,})\\s*$)",
"contentName": "meta.embedded.block.elm",
"patterns": [
{
"include": "source.elm"
}
]
}
]
}
},
"scopeName": "markdown.elm.codeblock"
}

709
syntaxes/elm.json Normal file
View File

@@ -0,0 +1,709 @@
{
"fileTypes": [
"elm"
],
"name": "Elm",
"scopeName": "source.elm",
"patterns": [
{
"include": "#import"
},
{
"include": "#module"
},
{
"include": "#debug"
},
{
"include": "#comments"
},
{
"match": "\\b(_)\\b",
"name": "keyword.unused.elm"
},
{
"include": "#type-signature"
},
{
"include": "#type-declaration"
},
{
"include": "#type-alias-declaration"
},
{
"include": "#string-double"
},
{
"include": "#string-triple"
},
{
"comment": "Floats are always decimal",
"match": "\\b([0-9]+\\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\\b",
"name": "constant.numeric.float.elm"
},
{
"match": "\\b([0-9]+)\\b",
"name": "constant.numeric.elm"
},
{
"include": "#glsl"
},
{
"include": "#record-prefix"
},
{
"include": "#module-prefix"
},
{
"include": "#constructor"
},
{
"name": "meta.record.field.update.elm",
"match": "(\\{)\\s+([a-z][a-zA-Z0-9]*)\\s+(\\|)\\s+([a-z][a-zA-Z0-9]*)",
"captures": {
"1": {
"name": "punctuation.bracket.elm"
},
"2": {
"name": "record.name.elm"
},
"3": {
"name": "keyword.pipe.elm"
},
"4": {
"name": "entity.name.record.field.elm"
}
}
},
{
"name": "meta.record.field.update.elm",
"match": "(\\|)\\s+([a-z][a-zA-Z0-9]*)\\s+(\\=)",
"captures": {
"1": {
"name": "keyword.pipe.elm"
},
"2": {
"name": "entity.name.record.field.elm"
},
"3": {
"name": "keyword.operator.assignment.elm"
}
}
},
{
"name": "meta.record.field.update.elm",
"match": "(\\{)\\s+([a-z][a-zA-Z0-9]*)\\s+$",
"captures": {
"1": {
"name": "punctuation.bracket.elm"
},
"2": {
"name": "record.name.elm"
}
}
},
{
"name": "meta.record.field.elm",
"match": "(\\{)\\s+([a-z][a-zA-Z0-9]*)\\s+(\\=)",
"captures": {
"1": {
"name": "punctuation.bracket.elm"
},
"2": {
"name": "entity.name.record.field.elm"
},
"3": {
"name": "keyword.operator.assignment.elm"
}
}
},
{
"name": "meta.record.field.elm",
"match": "(,)\\s+([a-z][a-zA-Z0-9]*)\\s+(\\=)",
"captures": {
"1": {
"name": "punctuation.separator.comma.elm"
},
"2": {
"name": "entity.name.record.field.elm"
},
"3": {
"name": "keyword.operator.assignment.elm"
}
}
},
{
"match": "(\\}|\\{)",
"name": "punctuation.bracket.elm"
},
{
"include": "#unit"
},
{
"include": "#comma"
},
{
"include": "#parens"
},
{
"match": "(->)",
"name": "keyword.operator.arrow.elm"
},
{
"include": "#infix_op"
},
{
"match": "(\\=|\\:|\\||\\\\)",
"name": "keyword.other.elm"
},
{
"match": "\\b(type|as|port|exposing|alias|infixl|infixr|infix)\\s+",
"name": "keyword.other.elm"
},
{
"match": "\\b(if|then|else|case|of|let|in)\\s+",
"name": "keyword.control.elm"
},
{
"include": "#record-accessor"
},
{
"include": "#top_level_value"
},
{
"include": "#value"
},
{
"include": "#period"
},
{
"include": "#square_brackets"
}
],
"repository": {
"comma": {
"match": "(,)",
"name": "punctuation.separator.comma.elm"
},
"parens": {
"match": "(\\(|\\))",
"name": "punctuation.parens.elm"
},
"block_comment": {
"applyEndPatternLast": 1,
"begin": "\\{-(?!#)",
"captures": {
"0": {
"name": "punctuation.definition.comment.elm"
}
},
"end": "-\\}",
"name": "comment.block.elm",
"patterns": [
{
"include": "#block_comment"
}
]
},
"comments": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.elm"
}
},
"begin": "--",
"end": "$",
"name": "comment.line.double-dash.elm"
},
{
"include": "#block_comment"
}
]
},
"import": {
"name": "meta.import.elm",
"begin": "^\\b(import)\\s*",
"beginCaptures": {
"1": {
"name": "keyword.control.import.elm"
}
},
"end": "\\n(?!\\s)",
"patterns": [
{
"match": "(as|exposing)",
"name": "keyword.control.elm"
},
{
"include": "#module_chunk"
},
{
"include": "#period"
},
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"include": "#module-exports"
}
]
},
"module": {
"begin": "^\\b((port |effect )?module)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.other.elm"
}
},
"end": "\\n(?!\\s)",
"endCaptures": {
"1": {
"name": "keyword.other.elm"
}
},
"name": "meta.declaration.module.elm",
"patterns": [
{
"include": "#module_chunk"
},
{
"include": "#period"
},
{
"match": "(exposing)",
"name": "keyword.other.elm"
},
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"include": "#module-exports"
}
]
},
"string-triple": {
"name": "string.quoted.triple.elm",
"begin": "\"\"\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.elm"
}
},
"end": "\"\"\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.elm"
}
},
"patterns": [
{
"match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})",
"name": "constant.character.escape.elm"
},
{
"match": "\\^[A-Z@\\[\\]\\\\\\^_]",
"name": "constant.character.escape.control.elm"
}
]
},
"string-double": {
"name": "string.quoted.double.elm",
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.elm"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.elm"
}
},
"patterns": [
{
"match": "\\\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\\"'\\&]|x[0-9a-fA-F]{1,5})",
"name": "constant.character.escape.elm"
},
{
"match": "\\^[A-Z@\\[\\]\\\\\\^_]",
"name": "constant.character.escape.control.elm"
}
]
},
"debug": {
"match": "\\b(Debug)\\b",
"name": "invalid.illegal.debug.elm"
},
"module-exports": {
"begin": "(\\()",
"beginCaptures": {
"1": {
"name": "punctuation.parens.module-export.elm"
}
},
"end": "(\\))",
"endCaptures": {
"1": {
"name": "punctuation.parens.module-export.elm"
}
},
"name": "meta.declaration.exports.elm",
"patterns": [
{
"match": "\\b[a-z][a-zA-Z_'0-9]*",
"name": "entity.name.function.elm"
},
{
"match": "\\b[A-Z][A-Za-z_'0-9]*",
"name": "storage.type.elm"
},
{
"match": ",",
"name": "punctuation.separator.comma.elm"
},
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"include": "#comma"
},
{
"match": "\\(\\.\\.\\)",
"name": "punctuation.parens.ellipses.elm"
},
{
"match": "\\.\\.",
"name": "punctuation.parens.ellipses.elm"
},
{
"include": "#infix_op"
},
{
"comment": "So named because I don't know what to call this.",
"match": "\\(.*?\\)",
"name": "meta.other.unknown.elm"
}
]
},
"module_chunk": {
"match": "[A-Z][a-zA-Z0-9]*",
"name": "support.module.elm"
},
"period": {
"match": "[.]",
"name": "keyword.other.period.elm"
},
"square_brackets": {
"match": "[\\[\\]]",
"name": "punctuation.definition.list.elm"
},
"record-prefix": {
"match": "([a-z][a-zA-Z0-9]*)(\\.)([a-z][a-zA-Z0-9]*)",
"name": "record.accessor.elm",
"captures": {
"1": {
"name": "record.name.elm"
},
"2": {
"name": "keyword.other.period.elm"
},
"3": {
"name": "entity.name.record.field.accessor.elm"
}
}
},
"module-prefix": {
"match": "([A-Z][a-zA-Z0-9]*)(\\.)",
"name": "meta.module.name.elm",
"captures": {
"1": {
"name": "support.module.elm"
},
"2": {
"name": "keyword.other.period.elm"
}
}
},
"constructor": {
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
"name": "constant.type-constructor.elm"
},
"value": {
"match": "\\b[a-z][a-zA-Z0-9_]*\\b",
"name": "meta.value.elm"
},
"unit": {
"match": "\\(\\)",
"name": "constant.unit.elm"
},
"top_level_value": {
"match": "^[a-z][a-zA-Z0-9_]*\\b",
"name": "entity.name.function.top_level.elm"
},
"record-accessor": {
"match": "(\\.)([a-z][a-zA-Z0-9_]*)",
"name": "meta.record.accessor",
"captures": {
"1": {
"name": "keyword.other.period.elm"
},
"2": {
"name": "entity.name.record.field.accessor.elm"
}
}
},
"infix_op": {
"match": "(<\\||<=|\\|\\||&&|>=|\\|>|\\|\\=|\\=\\=|\\|\\.|\\|\\=|\\+\\+|\\:\\:|\\+|\\-|\\*|\\/|\\/\\/|\\^|>>|<<|<|>|%)",
"name": "keyword.operator.elm"
},
"type-declaration": {
"begin": "^(type\\s+)([A-Z][a-zA-Z0-9_']*)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.type.elm"
},
"2": {
"name": "storage.type.elm"
}
},
"end": "^\\n$",
"name": "meta.function.type-declaration.elm",
"patterns": [
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"name": "meta.record.field.elm",
"match": "(\\=|\\|)\\s+([A-Z][a-zA-Z0-9_]*)\\b",
"captures": {
"1": {
"name": "keyword.operator.assignment.elm"
},
"2": {
"name": "constant.type-constructor.elm"
}
}
},
{
"match": "\\=",
"name": "keyword.operator.assignment.elm"
},
{
"match": "\\-\\>",
"name": "keyword.operator.arrow.elm"
},
{
"include": "#module-prefix"
},
{
"match": "\\b[a-z][a-zA-Z0-9_]*\\b",
"name": "variable.type.elm"
},
{
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
"name": "storage.type.elm"
},
{
"include": "#comments"
},
{
"include": "#type-record"
}
]
},
"type-alias-declaration": {
"begin": "^(type\\s+)(alias\\s+)([A-Z][a-zA-Z0-9_']*)\\s+",
"beginCaptures": {
"1": {
"name": "keyword.type.elm"
},
"2": {
"name": "keyword.type-alias.elm"
},
"3": {
"name": "storage.type.elm"
}
},
"end": "^\\n$",
"name": "meta.function.type-declaration.elm",
"patterns": [
{
"match": "\\n\\s+",
"name": "punctuation.spaces.elm"
},
{
"match": "\\=",
"name": "keyword.operator.assignment.elm"
},
{
"include": "#module-prefix"
},
{
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
"name": "storage.type.elm"
},
{
"match": "\\b[a-z][a-zA-Z0-9_]*\\b",
"name": "variable.type.elm"
},
{
"include": "#comments"
},
{
"include": "#type-record"
}
]
},
"type-record": {
"begin": "(\\{)",
"beginCaptures": {
"1": {
"name": "punctuation.section.braces.begin"
}
},
"end": "(\\})",
"endCaptures": {
"1": {
"name": "punctuation.section.braces.end"
}
},
"name": "meta.function.type-record.elm",
"patterns": [
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"match": "->",
"name": "keyword.operator.arrow.elm"
},
{
"name": "meta.record.field.elm",
"match": "([a-z][a-zA-Z0-9]*)\\s+(\\:)",
"captures": {
"1": {
"name": "entity.name.record.field.elm"
},
"2": {
"name": "keyword.other.elm"
}
}
},
{
"match": "\\,",
"name": "punctuation.separator.comma.elm"
},
{
"include": "#module-prefix"
},
{
"match": "\\b[a-z][a-zA-Z0-9]*\\b",
"name": "variable.type.elm"
},
{
"match": "\\b[A-Z][a-zA-Z0-9]*\\b",
"name": "storage.type.elm"
},
{
"include": "#comments"
},
{
"include": "#type-record"
}
]
},
"type-signature": {
"begin": "^(port\\s+)?([a-z_][a-zA-Z0-9_']*)\\s+(\\:)",
"beginCaptures": {
"1": {
"name": "keyword.other.port.elm"
},
"2": {
"name": "entity.name.function.elm"
},
"3": {
"name": "keyword.other.colon.elm"
}
},
"end": "((^(?=[a-z]))|^$)",
"name": "meta.function.type-declaration.elm",
"patterns": [
{
"include": "#type-signature-chunk"
}
]
},
"type-signature-chunk": {
"patterns": [
{
"match": "->",
"name": "keyword.operator.arrow.elm"
},
{
"match": "\\s+",
"name": "punctuation.spaces.elm"
},
{
"include": "#module-prefix"
},
{
"match": "\\b[a-z][a-zA-Z0-9]*\\b",
"name": "variable.type.elm"
},
{
"match": "\\b[A-Z][a-zA-Z0-9_]*\\b",
"name": "storage.type.elm"
},
{
"match": "\\(\\)",
"name": "constant.unit.elm"
},
{
"include": "#comma"
},
{
"include": "#parens"
},
{
"include": "#comments"
},
{
"include": "#type-record"
}
]
},
"glsl": {
"begin": "(\\[)(glsl)(\\|)",
"beginCaptures": {
"1": {
"name": "entity.glsl.bracket.elm"
},
"2": {
"name": "entity.glsl.name.elm"
},
"3": {
"name": "entity.glsl.bracket.elm"
}
},
"end": "(\\|\\])",
"endCaptures": {
"1": {
"name": "entity.glsl.bracket.elm"
}
},
"name": "meta.embedded.block.glsl",
"patterns": [
{
"include": "source.glsl"
}
]
}
}
}

View File

@@ -1,602 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>elm</string>
</array>
<key>name</key>
<string>Elm</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.elm</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.elm</string>
</dict>
</dict>
<key>match</key>
<string>(`)[a-zA-Z_']*?(`)</string>
<key>name</key>
<string>keyword.operator.function.infix.elm</string>
</dict>
<dict>
<key>match</key>
<string>\(\)</string>
<key>name</key>
<string>constant.language.unit.elm</string>
</dict>
<dict>
<key>begin</key>
<string>^\b((effect|port)\s+)?(module)\s+</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
</dict>
<key>end</key>
<string>$|;</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
</dict>
<key>name</key>
<string>meta.declaration.module.elm</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#module_name</string>
</dict>
<dict>
<key>begin</key>
<string>(where)\s*\{</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#type_signature</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(exposing)</string>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<dict>
<key>include</key>
<string>#module_exports</string>
</dict>
<dict>
<key>match</key>
<string>(where)</string>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<dict>
<key>match</key>
<string>[a-z]+</string>
<key>name</key>
<string>invalid</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^\b(import)\s+((open)\s+)?</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>invalid</string>
</dict>
</dict>
<key>end</key>
<string>($|;)</string>
<key>name</key>
<string>meta.import.elm</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(as|exposing)</string>
<key>name</key>
<string>keyword.import.elm</string>
</dict>
<dict>
<key>include</key>
<string>#module_name</string>
</dict>
<dict>
<key>include</key>
<string>#module_exports</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(\[)(glsl)(\|)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>support.function.prelude.elm</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
</dict>
<key>end</key>
<string>(\|\])</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
</dict>
<key>name</key>
<string>entity.glsl.elm</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.glsl</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(type alias|type|case|of|let|in|as)\s+</string>
<key>name</key>
<string>keyword.other.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b(if|then|else)\s+</string>
<key>name</key>
<string>keyword.control.elm</string>
</dict>
<dict>
<key>comment</key>
<string>Floats are always decimal</string>
<key>match</key>
<string>\b([0-9]+\.[0-9]+([eE][+-]?[0-9]+)?|[0-9]+[eE][+-]?[0-9]+)\b</string>
<key>name</key>
<string>constant.numeric.float.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b([0-9]+)\b</string>
<key>name</key>
<string>constant.numeric.elm</string>
</dict>
<dict>
<key>begin</key>
<string>"""</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.elm</string>
</dict>
</dict>
<key>end</key>
<string>"""</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.elm</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.elm</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\'\&amp;])</string>
<key>name</key>
<string>constant.character.escape.elm</string>
</dict>
<dict>
<key>match</key>
<string>\^[A-Z@\[\]\\\^_]</string>
<key>name</key>
<string>constant.character.escape.control.elm</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.elm</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.elm</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.elm</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\(NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\"'\&amp;])</string>
<key>name</key>
<string>constant.character.escape.elm</string>
</dict>
<dict>
<key>match</key>
<string>\^[A-Z@\[\]\\\^_]</string>
<key>name</key>
<string>constant.character.escape.control.elm</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.elm</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.character.escape.elm</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.elm</string>
</dict>
</dict>
<key>match</key>
<string>(?x)
(')
(?:
[\ -\[\]-~] # Basic Char
| (\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE
|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS
|US|SP|DEL|[abfnrtv\\\"'\&amp;])) # Escapes
| (\^[A-Z@\[\]\\\^_]) # Control Chars
)
(')</string>
<key>name</key>
<string>string.quoted.single.elm</string>
</dict>
<dict>
<key>begin</key>
<string>^(port\s+)?([a-z_][a-zA-Z0-9_']*|\([|!%$+\-.,=&lt;/&gt;]+\))\s*((:)([:]+)?)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.port.elm</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.function.elm</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.other.colon.elm</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>invalid</string>
</dict>
</dict>
<key>end</key>
<string>$\n?</string>
<key>name</key>
<string>meta.function.type-declaration.elm</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#type_signature</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\bport\s+</string>
<key>name</key>
<string>keyword.other.port.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b[A-Z]\w*\b</string>
<key>name</key>
<string>constant.other.elm</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>match</key>
<string>^[a-z][A-Za-z0-9_']*\s+</string>
<key>name</key>
<string>entity.name.function.elm</string>
</dict>
<dict>
<key>include</key>
<string>#infix_op</string>
</dict>
<dict>
<key>match</key>
<string>[|!%$?~+:\-.=&lt;/&gt;&amp;\\*^]+</string>
<key>name</key>
<string>keyword.operator.elm</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.delimiter.elm</string>
</dict>
</dict>
<key>match</key>
<string>([\[\]\{\},])</string>
<key>name</key>
<string>constant.language.delimiter.elm</string>
</dict>
<dict>
<key>match</key>
<string>([\(\)])</string>
<key>name</key>
<string>keyword.other.parenthesis.elm</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>block_comment</key>
<dict>
<key>applyEndPatternLast</key>
<integer>1</integer>
<key>begin</key>
<string>\{-(?!#)</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.elm</string>
</dict>
</dict>
<key>end</key>
<string>-\}</string>
<key>name</key>
<string>comment.block.elm</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#block_comment</string>
</dict>
</array>
</dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.elm</string>
</dict>
</dict>
<key>match</key>
<string>(--).*$\n?</string>
<key>name</key>
<string>comment.line.double-dash.elm</string>
</dict>
<dict>
<key>include</key>
<string>#block_comment</string>
</dict>
</array>
</dict>
<key>infix_op</key>
<dict>
<key>match</key>
<string>(\([|!%$+:\-.=&lt;/&gt;]+\)|\(,+\))</string>
<key>name</key>
<string>entity.name.function.infix.elm</string>
</dict>
<key>module_exports</key>
<dict>
<key>begin</key>
<string>\(</string>
<key>end</key>
<string>\)</string>
<key>name</key>
<string>meta.declaration.exports.elm</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\b[a-z][a-zA-Z_'0-9]*</string>
<key>name</key>
<string>entity.name.function.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b[A-Z][A-Za-z_'0-9]*</string>
<key>name</key>
<string>storage.type.elm</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.comma.elm</string>
</dict>
<dict>
<key>include</key>
<string>#infix_op</string>
</dict>
<dict>
<key>comment</key>
<string>So named because I don't know what to call this.</string>
<key>match</key>
<string>\(.*?\)</string>
<key>name</key>
<string>meta.other.unknown.elm</string>
</dict>
</array>
</dict>
<key>module_name</key>
<dict>
<key>match</key>
<string>[A-Z][A-Za-z._']*</string>
<key>name</key>
<string>support.other.module.elm</string>
</dict>
<key>type_signature</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.other.inherited-class.elm</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.generic-type.elm</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.other.big-arrow.elm</string>
</dict>
</dict>
<key>match</key>
<string>\(\s*([A-Z][A-Za-z]*)\s+([a-z][A-Za-z_']*)\)\s*(=&gt;)</string>
<key>name</key>
<string>meta.class-constraint.elm</string>
</dict>
<dict>
<key>match</key>
<string>-&gt;</string>
<key>name</key>
<string>keyword.other.arrow.elm</string>
</dict>
<dict>
<key>match</key>
<string>=&gt;</string>
<key>name</key>
<string>keyword.other.big-arrow.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b[a-z][a-zA-Z0-9_']*\b</string>
<key>name</key>
<string>variable.other.generic-type.elm</string>
</dict>
<dict>
<key>match</key>
<string>\b[A-Z][a-zA-Z0-9_']*\b</string>
<key>name</key>
<string>storage.type.elm</string>
</dict>
<dict>
<key>match</key>
<string>\(\)</string>
<key>name</key>
<string>support.constant.unit.elm</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.elm</string>
<key>uuid</key>
<string>2cb90e5e-6e98-456d-9a8a-b59935dbc4b0</string>
</dict>
</plist>