mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Merge pull request #27293 from fadeevab/master
Makefile colorizing improvement: colorize at the beginning of line, handling the '\' symbol and other.
This commit is contained in:
commit
7f1912686f
|
@ -16,6 +16,9 @@
|
|||
{
|
||||
"include": "#comment"
|
||||
},
|
||||
{
|
||||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"include": "#variable-assignment"
|
||||
},
|
||||
|
@ -43,7 +46,7 @@
|
|||
"name": "punctuation.definition.comment.makefile"
|
||||
}
|
||||
},
|
||||
"end": "\\n",
|
||||
"end": "(?=[^\\\\])$",
|
||||
"name": "comment.line.number-sign.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
|
@ -323,12 +326,12 @@
|
|||
"name": "punctuation.separator.key-value.makefile"
|
||||
}
|
||||
},
|
||||
"end": "^(?!\\t)",
|
||||
"end": "[^\\\\]$",
|
||||
"name": "meta.scope.target.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
"begin": "\\G",
|
||||
"end": "^",
|
||||
"end": "(?=[^\\\\])$",
|
||||
"name": "meta.scope.prerequisites.makefile",
|
||||
"patterns": [
|
||||
{
|
||||
|
@ -427,11 +430,11 @@
|
|||
"include": "#variables"
|
||||
},
|
||||
{
|
||||
"match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
|
||||
"match": "(?<=\\()(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
|
||||
"name": "variable.language.makefile"
|
||||
},
|
||||
{
|
||||
"begin": "\\G(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",
|
||||
"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"
|
||||
|
@ -450,8 +453,13 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
|
||||
"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": [
|
||||
|
@ -461,7 +469,7 @@
|
|||
]
|
||||
},
|
||||
{
|
||||
"begin": "\\G(?!\\))",
|
||||
"begin": "(?<=\\()(?!\\))",
|
||||
"end": "(?=\\))",
|
||||
"name": "variable.other.makefile",
|
||||
"patterns": [
|
||||
|
|
|
@ -1,31 +1,41 @@
|
|||
.PHONY: all
|
||||
all: hello
|
||||
|
||||
hello: main.o factorial.o hello.o
|
||||
.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
|
||||
g++ -c factorial.cpp $(fake_variable)
|
||||
|
||||
hello.o: hello.cpp
|
||||
g++ -c hello.cpp
|
||||
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
|
||||
|
||||
define defined
|
||||
$(info Checkng existance of $(1))
|
||||
$(if ifeq "$(flavor $(1))" "undefined",0,1)
|
||||
$(info Checking existance of $(1) $(flavor $(1)))
|
||||
$(if $(filter undefined,$(flavor $(1))),0,1)
|
||||
endef
|
||||
|
||||
ifeq ($(call defined,TOP_DIR),0)
|
||||
TOP_DIR must be set before including paths.mk
|
||||
ifeq ($(strip $(call defined,TOP_DIR)),0)
|
||||
$(info TOP_DIR must be set before including paths.mk)
|
||||
endif
|
||||
|
||||
include $(TOP_DIR)3rdparty.mk
|
||||
-include $(TOP_DIR)3rdparty.mk
|
||||
|
||||
ifeq ($(call defined,CODIT_DIR),0)
|
||||
CODIT_DIR must be set in $(TOP_DIR)3rdparty.mk
|
||||
ifeq ($(strip $(call defined,CODIT_DIR)),0)
|
||||
$(info CODIT_DIR must be set in $(TOP_DIR)3rdparty.mk)
|
||||
endif
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue