Skip to content

Commit b2aaf1f

Browse files
authored
fix: Python functions should be highlighted as functions (#4708)
1 parent 0164811 commit b2aaf1f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

lib/ace/mode/_test/tokens_python.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
"start",
334334
["keyword","def"],
335335
["text"," "],
336-
["identifier","to_lowercase"],
336+
["entity.name.function","to_lowercase"],
337337
["paren.lparen","("],
338338
["support.function","input"],
339339
["paren.rparen",")"],

lib/ace/mode/python_highlight_rules.js

+3
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,9 @@ var PythonHighlightRules = function() {
170170
token: "paren.rparen",
171171
regex: "[\\]\\)\\}]"
172172
}, {
173+
token: ["keyword", "text", "entity.name.function"],
174+
regex: "(def|class)(\\s+)(\\w+)"
175+
}, {
173176
token: "text",
174177
regex: "\\s+"
175178
}, {

0 commit comments

Comments
 (0)