Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'
This commit is contained in:
2
lib/vscode/extensions/clojure/.vscodeignore
Normal file
2
lib/vscode/extensions/clojure/.vscodeignore
Normal file
@ -0,0 +1,2 @@
|
||||
test/**
|
||||
cgmanifest.json
|
18
lib/vscode/extensions/clojure/cgmanifest.json
Normal file
18
lib/vscode/extensions/clojure/cgmanifest.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"registrations": [
|
||||
{
|
||||
"component": {
|
||||
"type": "git",
|
||||
"git": {
|
||||
"name": "atom/language-clojure",
|
||||
"repositoryUrl": "https://github.com/atom/language-clojure",
|
||||
"commitHash": "de877502aa4a77ccdc2c7f0c9180436aea3effff"
|
||||
}
|
||||
},
|
||||
"license": "MIT",
|
||||
"version": "0.22.7",
|
||||
"description": "The file syntaxes/clojure.tmLanguage.json was derived from the Atom package https://github.com/atom/language-clojure which was originally converted from the TextMate bundle https://github.com/mmcgrana/textmate-clojure."
|
||||
}
|
||||
],
|
||||
"version": 1
|
||||
}
|
25
lib/vscode/extensions/clojure/language-configuration.json
Normal file
25
lib/vscode/extensions/clojure/language-configuration.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"comments": {
|
||||
"lineComment": ";"
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"] }
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["\"", "\""]
|
||||
],
|
||||
"folding": {
|
||||
"offSide": true
|
||||
}
|
||||
}
|
25
lib/vscode/extensions/clojure/package.json
Normal file
25
lib/vscode/extensions/clojure/package.json
Normal file
@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "clojure",
|
||||
"displayName": "%displayName%",
|
||||
"description": "%description%",
|
||||
"version": "1.0.0",
|
||||
"publisher": "vscode",
|
||||
"license": "MIT",
|
||||
"engines": { "vscode": "*" },
|
||||
"scripts": {
|
||||
"update-grammar": "node ../../build/npm/update-grammar.js atom/language-clojure grammars/clojure.cson ./syntaxes/clojure.tmLanguage.json"
|
||||
},
|
||||
"contributes": {
|
||||
"languages": [{
|
||||
"id": "clojure",
|
||||
"aliases": ["Clojure", "clojure"],
|
||||
"extensions": [".clj", ".cljs", ".cljc", ".cljx", ".clojure", ".edn"],
|
||||
"configuration": "./language-configuration.json"
|
||||
}],
|
||||
"grammars": [{
|
||||
"language": "clojure",
|
||||
"scopeName": "source.clojure",
|
||||
"path": "./syntaxes/clojure.tmLanguage.json"
|
||||
}]
|
||||
}
|
||||
}
|
4
lib/vscode/extensions/clojure/package.nls.json
Normal file
4
lib/vscode/extensions/clojure/package.nls.json
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"displayName": "Clojure Language Basics",
|
||||
"description": "Provides syntax highlighting and bracket matching in Clojure files."
|
||||
}
|
435
lib/vscode/extensions/clojure/syntaxes/clojure.tmLanguage.json
Normal file
435
lib/vscode/extensions/clojure/syntaxes/clojure.tmLanguage.json
Normal file
@ -0,0 +1,435 @@
|
||||
{
|
||||
"information_for_contributors": [
|
||||
"This file has been converted from https://github.com/atom/language-clojure/blob/master/grammars/clojure.cson",
|
||||
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
|
||||
"Once accepted there, we are happy to receive an update request."
|
||||
],
|
||||
"version": "https://github.com/atom/language-clojure/commit/de877502aa4a77ccdc2c7f0c9180436aea3effff",
|
||||
"name": "Clojure",
|
||||
"scopeName": "source.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#shebang-comment"
|
||||
},
|
||||
{
|
||||
"include": "#quoted-sexp"
|
||||
},
|
||||
{
|
||||
"include": "#sexp"
|
||||
},
|
||||
{
|
||||
"include": "#keyfn"
|
||||
},
|
||||
{
|
||||
"include": "#string"
|
||||
},
|
||||
{
|
||||
"include": "#vector"
|
||||
},
|
||||
{
|
||||
"include": "#set"
|
||||
},
|
||||
{
|
||||
"include": "#map"
|
||||
},
|
||||
{
|
||||
"include": "#regexp"
|
||||
},
|
||||
{
|
||||
"include": "#var"
|
||||
},
|
||||
{
|
||||
"include": "#constants"
|
||||
},
|
||||
{
|
||||
"include": "#dynamic-variables"
|
||||
},
|
||||
{
|
||||
"include": "#metadata"
|
||||
},
|
||||
{
|
||||
"include": "#namespace-symbol"
|
||||
},
|
||||
{
|
||||
"include": "#symbol"
|
||||
}
|
||||
],
|
||||
"repository": {
|
||||
"comment": {
|
||||
"begin": "(?<!\\\\);",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.comment.clojure"
|
||||
}
|
||||
},
|
||||
"end": "$",
|
||||
"name": "comment.line.semicolon.clojure"
|
||||
},
|
||||
"constants": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(nil)(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "constant.language.nil.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(true|false)",
|
||||
"name": "constant.language.boolean.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+/\\d+)",
|
||||
"name": "constant.numeric.ratio.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+[rR]\\w+)",
|
||||
"name": "constant.numeric.arbitrary-radix.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?0[xX][0-9a-fA-F]+)",
|
||||
"name": "constant.numeric.hexadecimal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?0\\d+)",
|
||||
"name": "constant.numeric.octal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?M)",
|
||||
"name": "constant.numeric.bigdecimal.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+\\.\\d+([eE][+-]?\\d+)?)",
|
||||
"name": "constant.numeric.double.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+N)",
|
||||
"name": "constant.numeric.bigint.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(-?\\d+)",
|
||||
"name": "constant.numeric.long.clojure"
|
||||
},
|
||||
{
|
||||
"include": "#keyword"
|
||||
}
|
||||
]
|
||||
},
|
||||
"keyword": {
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)):[\\w\\#\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}|\\,))",
|
||||
"name": "constant.keyword.clojure"
|
||||
},
|
||||
"keyfn": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(if(-[-\\p{Ll}\\?]*)?|when(-[-\\p{Ll}]*)?|for(-[-\\p{Ll}]*)?|cond|do|let(-[-\\p{Ll}\\?]*)?|binding|loop|recur|fn|throw[\\p{Ll}\\-]*|try|catch|finally|([\\p{Ll}]*case))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "storage.control.clojure"
|
||||
},
|
||||
{
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[\\p{Ll}\\-]*))(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "keyword.control.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"dynamic-variables": {
|
||||
"match": "\\*[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\d]+\\*",
|
||||
"name": "meta.symbol.dynamic.clojure"
|
||||
},
|
||||
"map": {
|
||||
"begin": "(\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.map.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.map.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.map.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.map.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"metadata": {
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(\\^\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.metadata.map.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.metadata.map.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.metadata.map.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.metadata.map.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"begin": "(\\^)",
|
||||
"end": "(\\s)",
|
||||
"name": "meta.metadata.simple.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#keyword"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
},
|
||||
"quoted-sexp": {
|
||||
"begin": "(['``]\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.section.expression.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.quoted-expression.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp": {
|
||||
"begin": "#\"",
|
||||
"beginCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.regexp.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "\"",
|
||||
"endCaptures": {
|
||||
"0": {
|
||||
"name": "punctuation.definition.regexp.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "string.regexp.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#regexp_escaped_char"
|
||||
}
|
||||
]
|
||||
},
|
||||
"regexp_escaped_char": {
|
||||
"match": "\\\\.",
|
||||
"name": "constant.character.escape.clojure"
|
||||
},
|
||||
"set": {
|
||||
"begin": "(\\#\\{)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.set.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\}(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\})",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.set.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.set.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.set.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"sexp": {
|
||||
"begin": "(\\()",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\))$|(\\)(?=[\\}\\]\\)\\s]*(?:;|$)))|(\\))",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.expression.end.trailing.clojure"
|
||||
},
|
||||
"3": {
|
||||
"name": "punctuation.section.expression.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.expression.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "(?<=\\()(ns|declare|def[\\w\\d._:+=><!?*-]*|[\\w._:+=><!?*-][\\w\\d._:+=><!?*-]*/def[\\w\\d._:+=><!?*-]*)\\s+",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "keyword.control.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(?=\\))",
|
||||
"name": "meta.definition.global.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "#metadata"
|
||||
},
|
||||
{
|
||||
"include": "#dynamic-variables"
|
||||
},
|
||||
{
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "entity.global.clojure"
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "#keyfn"
|
||||
},
|
||||
{
|
||||
"include": "#constants"
|
||||
},
|
||||
{
|
||||
"include": "#vector"
|
||||
},
|
||||
{
|
||||
"include": "#map"
|
||||
},
|
||||
{
|
||||
"include": "#set"
|
||||
},
|
||||
{
|
||||
"include": "#sexp"
|
||||
},
|
||||
{
|
||||
"match": "(?<=\\()(.+?)(?=\\s|\\))",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "entity.name.function.clojure"
|
||||
}
|
||||
},
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
},
|
||||
"shebang-comment": {
|
||||
"begin": "^(#!)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.comment.shebang.clojure"
|
||||
}
|
||||
},
|
||||
"end": "$",
|
||||
"name": "comment.line.shebang.clojure"
|
||||
},
|
||||
"string": {
|
||||
"begin": "(?<!\\\\)(\")",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\")",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.definition.string.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "string.quoted.double.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"match": "\\\\.",
|
||||
"name": "constant.character.escape.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"namespace-symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)/",
|
||||
"captures": {
|
||||
"1": {
|
||||
"name": "meta.symbol.namespace.clojure"
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"symbol": {
|
||||
"patterns": [
|
||||
{
|
||||
"match": "([\\p{L}\\.\\-\\_\\+\\=\\>\\<\\!\\?\\*][\\w\\.\\-\\_\\:\\+\\=\\>\\<\\!\\?\\*\\d]*)",
|
||||
"name": "meta.symbol.clojure"
|
||||
}
|
||||
]
|
||||
},
|
||||
"var": {
|
||||
"match": "(?<=(\\s|\\(|\\[|\\{)\\#)'[\\w\\.\\-\\_\\:\\+\\=\\>\\<\\/\\!\\?\\*]+(?=(\\s|\\)|\\]|\\}))",
|
||||
"name": "meta.var.clojure"
|
||||
},
|
||||
"vector": {
|
||||
"begin": "(\\[)",
|
||||
"beginCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.vector.begin.clojure"
|
||||
}
|
||||
},
|
||||
"end": "(\\](?=[\\}\\]\\)\\s]*(?:;|$)))|(\\])",
|
||||
"endCaptures": {
|
||||
"1": {
|
||||
"name": "punctuation.section.vector.end.trailing.clojure"
|
||||
},
|
||||
"2": {
|
||||
"name": "punctuation.section.vector.end.clojure"
|
||||
}
|
||||
},
|
||||
"name": "meta.vector.clojure",
|
||||
"patterns": [
|
||||
{
|
||||
"include": "$self"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
;; from http://clojure-doc.org/articles/tutorials/introduction.html
|
||||
|
||||
(require '[clojure.string :as str])
|
||||
(def the-answer 42)
|
||||
[1 2 3] ; A vector
|
||||
[1 :two "three"]
|
||||
{:a 1 :b 2}
|
||||
#{:a :b :c}
|
||||
'(1 2 3)
|
||||
(def my-stuff ["shirt" "coat" "hat"]) ; this is more typical usage.
|
||||
|
||||
(my-func (my-func2 arg1
|
||||
arg2)
|
||||
(other-func arg-a
|
||||
(foo-bar arg-x
|
||||
arg-y
|
||||
(+ arg-xx
|
||||
arg-yy
|
||||
arg-zz))
|
||||
arg-b))
|
||||
'(+ 1 2 3)
|
||||
;; ⇒ (+ 1 2 3)
|
||||
(let [width 10
|
||||
height 20
|
||||
thickness 2]
|
||||
(println "hello from inside the `let`.")
|
||||
(* width
|
||||
height
|
||||
thickness))
|
||||
|
||||
;; Vectors
|
||||
(def v [:a :b :c])
|
||||
(def li '(:a :b :c))
|
||||
(conj v :d) ; ⇒ [:a :b :c :d]
|
||||
(conj li :d) ; ⇒ (:d :a :b :c)
|
||||
|
||||
v ; ⇒ is still [:a :b :c]
|
||||
li ; ⇒ is still (:a :b :c)
|
||||
|
||||
;; Maps
|
||||
(def m {:a 1 :b 2})
|
||||
(assoc m :c 3) ; ⇒ {:a 1 :c 3 :b 2}
|
||||
(dissoc m :b) ; ⇒ {:a 1}
|
||||
|
||||
(def my-atom (atom {:foo 1}))
|
||||
;; ⇒ #'user/my-atom
|
||||
@my-atom
|
||||
;; ⇒ {:foo 1}
|
||||
(swap! my-atom update-in [:foo] inc)
|
||||
;; ⇒ {:foo 2}
|
||||
@my-atom
|
||||
;; ⇒ {:foo 2}
|
3324
lib/vscode/extensions/clojure/test/colorize-results/test_clj.json
Normal file
3324
lib/vscode/extensions/clojure/test/colorize-results/test_clj.json
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user