Archived
1
0

Merge commit 'be3e8236086165e5e45a5a10783823874b3f3ebd' as 'lib/vscode'

This commit is contained in:
Joe Previte
2020-12-15 15:52:33 -07:00
4649 changed files with 1311795 additions and 0 deletions

View File

@ -0,0 +1,2 @@
test/**
cgmanifest.json

View File

@ -0,0 +1,32 @@
{
"registrations": [
{
"component": {
"type": "git",
"git": {
"name": "fadeevab/make.tmbundle",
"repositoryUrl": "https://github.com/fadeevab/make.tmbundle",
"commitHash": "e36e02becd20730259b0115d9ca5c419f65023a9"
}
},
"licenseDetail": [
"Copyright (c) textmate-make.tmbundle project authors",
"",
"If not otherwise specified (see below), files in this repository fall under the following license:",
"",
"Permission to copy, use, modify, sell and distribute this",
"software is granted. This software is provided \"as is\" without",
"express or implied warranty, and with no claim as to its",
"suitability for any purpose.",
"",
"An exception is made for files in readable text which contain their own license information,",
"or files where an accompanying file exists (in the same directory) with a \"-license\" suffix added",
"to the base-name name of the original file, and an extension of txt, html, or similar. For example",
"\"tidy\" is accompanied by \"tidy-license.txt\"."
],
"license": "TextMate Bundle License",
"version": "0.0.0"
}
],
"version": 1
}

View File

@ -0,0 +1,10 @@
{
"comments": {
"lineComment": "#"
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"]
]
}

View File

@ -0,0 +1,51 @@
{
"name": "make",
"displayName": "%displayName%",
"description": "%description%",
"version": "1.0.0",
"publisher": "vscode",
"license": "MIT",
"engines": {
"vscode": "*"
},
"scripts": {
"update-grammar": "node ../../build/npm/update-grammar.js fadeevab/make.tmbundle Syntaxes/Makefile.plist ./syntaxes/make.tmLanguage.json"
},
"contributes": {
"languages": [
{
"id": "makefile",
"aliases": [
"Makefile",
"makefile"
],
"extensions": [
".mk"
],
"filenames": [
"Makefile",
"makefile",
"GNUmakefile",
"OCamlMakefile"
],
"firstLine": "^#!\\s*/usr/bin/make",
"configuration": "./language-configuration.json"
}
],
"grammars": [
{
"language": "makefile",
"scopeName": "source.makefile",
"path": "./syntaxes/make.tmLanguage.json",
"tokenTypes": {
"string.interpolated": "other"
}
}
],
"configurationDefaults": {
"[makefile]": {
"editor.insertSpaces": false
}
}
}
}

View File

@ -0,0 +1,4 @@
{
"displayName": "Make Language Basics",
"description": "Provides syntax highlighting and bracket matching in Make files."
}

View File

@ -0,0 +1,643 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/fadeevab/make.tmbundle/blob/master/Syntaxes/Makefile.plist",
"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/fadeevab/make.tmbundle/commit/e36e02becd20730259b0115d9ca5c419f65023a9",
"name": "Makefile",
"scopeName": "source.makefile",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"include": "#variable-assignment"
},
{
"include": "#directives"
},
{
"include": "#recipe"
},
{
"include": "#target"
}
],
"repository": {
"comment": {
"begin": "(^[ \\t]+)?(?=#)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.makefile"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.makefile"
}
},
"end": "(?=[^\\\\])$",
"name": "comment.line.number-sign.makefile",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"directives": {
"patterns": [
{
"begin": "^[ ]*([s\\-]?include)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.include.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
},
{
"begin": "^[ ]*(vpath)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.vpath.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
},
{
"begin": "^\\s*(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.override.makefile"
},
"2": {
"name": "keyword.control.define.makefile"
},
"3": {
"name": "variable.other.makefile"
},
"4": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^\\s*(endef)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G(?!\\n)",
"end": "^",
"patterns": [
{
"include": "#comment"
}
]
},
{
"include": "#variables"
},
{
"include": "#comment"
},
{
"include": "#directives"
}
]
},
{
"begin": "^[ ]*(export)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variable-assignment"
},
{
"match": "[^\\s]+",
"name": "variable.other.makefile"
}
]
},
{
"begin": "^[ ]*(override|private)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variable-assignment"
}
]
},
{
"begin": "^[ ]*(unexport|undefine)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"match": "[^\\s]+",
"name": "variable.other.makefile"
}
]
},
{
"begin": "^\\s*(ifdef|ifndef)\\s*([^\\s]+)(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.$1.makefile"
},
"2": {
"name": "variable.other.makefile"
},
"3": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^\\s*(endif)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G(?!\\n)",
"end": "^",
"patterns": [
{
"include": "#comment"
}
]
},
{
"include": "$self"
}
]
},
{
"begin": "^\\s*(ifeq|ifneq)(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^\\s*(endif)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G",
"end": "^",
"name": "meta.scope.condition.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#comment"
}
]
},
{
"begin": "^\\s*else(?=\\s)",
"beginCaptures": {
"0": {
"name": "keyword.control.else.makefile"
}
},
"end": "^"
},
{
"include": "$self"
}
]
}
]
},
"target": {
"begin": "^(?!\\t)([^:]*)(:)(?!\\=)",
"beginCaptures": {
"1": {
"patterns": [
{
"captures": {
"1": {
"name": "support.function.target.$1.makefile"
}
},
"match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$"
},
{
"begin": "(?=\\S)",
"end": "(?=\\s|$)",
"name": "entity.name.function.target.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
}
]
},
"2": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "[^\\\\]$",
"name": "meta.scope.target.makefile",
"patterns": [
{
"begin": "\\G",
"end": "(?=[^\\\\])$",
"name": "meta.scope.prerequisites.makefile",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"include": "#comment"
},
{
"include": "#variables"
}
]
}
]
},
"recipe": {
"begin": "^\\t([+\\-@]*)",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "[^\\\\]$",
"name": "meta.scope.recipe.makefile",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"include": "#variables"
}
]
},
"variable-assignment": {
"begin": "(^[ ]*|\\G\\s*)([^\\s:#=]+)\\s*((?<![?:+!])=|\\?=|:=|\\+=|!=)",
"beginCaptures": {
"2": {
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
}
]
},
"3": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "\\n",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"include": "#comment"
},
{
"include": "#variables"
}
]
},
"interpolation": {
"patterns": [
{
"include": "#parentheses-interpolation"
},
{
"include": "#braces-interpolation"
}
]
},
"parentheses-interpolation": {
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
}
]
},
"braces-interpolation": {
"begin": "{",
"end": "}",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
}
]
},
"variables": {
"patterns": [
{
"include": "#simple-variable"
},
{
"include": "#variable-parentheses"
},
{
"include": "#variable-braces"
}
]
},
"simple-variable": {
"patterns": [
{
"match": "\\$[^(){}]",
"name": "variable.language.makefile"
}
]
},
"variable-parentheses": {
"patterns": [
{
"begin": "\\$\\(",
"captures": {
"0": {
"name": "punctuation.definition.variable.makefile"
}
},
"end": "\\)|((?<!\\\\)\\n)",
"name": "string.interpolated.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#builtin-variable-parentheses"
},
{
"include": "#function-variable-parentheses"
},
{
"include": "#flavor-variable-parentheses"
},
{
"include": "#another-variable-parentheses"
}
]
}
]
},
"variable-braces": {
"patterns": [
{
"begin": "\\${",
"captures": {
"0": {
"name": "punctuation.definition.variable.makefile"
}
},
"end": "}|((?<!\\\\)\\n)",
"name": "string.interpolated.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#builtin-variable-braces"
},
{
"include": "#function-variable-braces"
},
{
"include": "#flavor-variable-braces"
},
{
"include": "#another-variable-braces"
}
]
}
]
},
"builtin-variable-parentheses": {
"patterns": [
{
"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"name": "variable.language.makefile"
}
]
},
"builtin-variable-braces": {
"patterns": [
{
"match": "(?<={)(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*})",
"name": "variable.language.makefile"
}
]
},
"function-variable-parentheses": {
"patterns": [
{
"begin": "(?<=\\()(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"function-variable-braces": {
"patterns": [
{
"begin": "(?<={)(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=}|((?<!\\\\)\\n))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#interpolation"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"flavor-variable-parentheses": {
"patterns": [
{
"begin": "(?<=\\()(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
}
]
},
"flavor-variable-braces": {
"patterns": [
{
"begin": "(?<={)(origin|flavor)\\s(?=[^\\s}]+\\s*})",
"contentName": "variable.other.makefile",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=})",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
}
]
},
"another-variable-parentheses": {
"patterns": [
{
"begin": "(?<=\\()(?!\\))",
"end": "(?=\\)|((?<!\\\\)\\n))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"another-variable-braces": {
"patterns": [
{
"begin": "(?<={)(?!})",
"end": "(?=}|((?<!\\\\)\\n))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
}
}
}

View File

@ -0,0 +1,88 @@
.PHONY: all
all: echo hello
.PHONY: hello
hello: main.o factorial.o \
hello.o $(first) $($(filter second,second)) \
# This is a long \
comment inside prerequisites.
g++ main.o factorial.o hello.o -o hello
# There are a building steps \
below. And the tab is at the beginning of this line.
main.o: main.cpp
g++ -c main.cpp
factorial.o: factorial.cpp
g++ -c factorial.cpp $(fake_variable)
hello.o: hello.cpp \
$(Colorizing with tabs at the beginning of the second line of prerequisites)
g++ -c hello.cpp -o $@
.PHONY: clean
clean:
rm *o hello
.PHONY: var
var:
# "$$" in a shell means to escape makefile's variable substitution.
some_shell_var=$$(sed -nre 's/some regex with (group)/\1/p')
.PHONY: echo
echo:
echo "#" and '#' in quotes are not comments \
and '\' will be continued
@echo Shell is not printed out, just a message.
@-+-+echo Error will be ignored here; invalidcommand
# And we can see variables are highlited as supposed to be:
@echo '$(CC) $(shell echo "123") -o $@'
@-./point-and-slash-should-not-be-highlighted
define defined
$(info Checking existance of $(1) $(flavor $(1)))
$(if $(filter undefined,$(flavor $(1))),0,1)
endef
ifeq ($(strip $(call defined,TOP_DIR)),0)
$(info TOP_DIR must be set before including paths.mk)
endif
-include $(TOP_DIR)3rdparty.mk
ifeq ($(strip $(call defined,CODIT_DIR)),0)
$(info CODIT_DIR must be set in $(TOP_DIR)3rdparty.mk)
endif
CXXVER_GE480 := $(shell expr `$(CXX) -dumpversion | sed -e 's/\.\([0-9][0-9]\)/\1/g' -e 's/\.\([0-9]\)/0\1/g' -e 's/^[0-9]\{3,4\}$$/&00/'` \>= 40800)
ok := ok
$(info Braces {} in parentheses ({}): ${ok})
${info Parentheses () in braces {()}: $(ok)}
ifeq ("${ok}", "skip")
$(ok))}
${ok}})
endif
result != echo "'$(ok)' $(shell echo "from inlined shell")"
$(info $(result))
# Below is a test of variable assignment without any spacing.
var=val
var?=val
var:=123
var!=echo val
var:=val \
notvar=butval
var:=$(val:.c=.o)
var-$(nested-var)=val
# Spaces in a nested shell will hurt a colorizing of variable,
# but not so much.
var-$(shell printf 2) := val2
$(info Should be 'val2' here: $(var-2))
export a ?= b:c

File diff suppressed because it is too large Load Diff