another day another work on highlighter

-bump for version 0.3.8rc9
This commit is contained in:
thelastWallE 2021-05-06 17:14:19 +02:00
parent 1fbe46282b
commit 5f48b6701c
3 changed files with 35 additions and 15 deletions

2
.gitignore vendored
View File

@ -11,3 +11,5 @@ dist
*.bak *.bak
.vscode .vscode
.vscode/** .vscode/**
thunder-tests

View File

@ -24,13 +24,10 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#single_line_comment": [{ "#single_line_comment": [{
token: "comment.line.number-sign", token: "comment.line.number-sign",
regex: /([^\*]|^)#[^\*].*/ regex: /(?!#\*#)([^\*]|^)#[^\*].*/
}, { }, {
token: "comment.line.gcode", token: "comment.line.gcode",
regex: /;.*$/ regex: /;.*$/
}, {
token: "comment.line.number-sign",
regex: /^(#\*#)/
}], }],
"#number": [{ "#number": [{
token: "constant.numeric", token: "constant.numeric",
@ -63,10 +60,10 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}] }]
}], }],
"#config_block": [{ "#config_block": [{
token: "text", token: "storage.type",
regex: /\[/, regex: /\[/,
push: [{ push: [{
token: "text", token: "storage.type",
regex: /\]/, regex: /\]/,
next: "pop" next: "pop"
}, { }, {
@ -79,7 +76,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#known_config_block_name": [{ "#known_config_block_name": [{
token: "storage.type", token: "storage.type",
regex: /\b(?:ad5206|adc_temperature|bed_mesh|bed_screws|bed_tilt|bltouch|board_pins|controller_fan|delayed_gcode|delta_calibrate|display|display_data|display_template|dotstar|dual_carriage|endstop_phase|extruder_stepper|extruder[1-9]{0,1}|fan|filament_switch_sensor|firmware_retraction|force_move|gcode_arcs|gcode_button|gcode_macro|hall_filament_width_sensor|heater_bed|heater_fan|heater_generic|homing_heaters|homing_override|idle_timeout|include|manual_stepper|mcp4018|mcp4451|mcp4728|mcu|menu|multi_pin|neopixel|output_pin|pause_resume|printer|probe|quad_gantry_level|replicape|respond|safe_z_home|samd_sercom|screws_tilt_adjust|servo|skew_correction|static_digital_output|stepper_(?:bed|arm|[abcdxy]|z[1-9]{0,1})|sx1509|temperature_fan|temperature_sensor|thermistor|tsl1401cl_filament_width_sensor|verify_heater|virtual_sdcard|z_tilt)\b/, regex: /\b(?:ad5206|adxl345|input_shaper|resonance_tester|adc_temperature|bed_mesh|bed_screws|bed_tilt|bltouch|board_pins|controller_fan|delayed_gcode|delta_calibrate|display|display_data|display_template|dotstar|dual_carriage|endstop_phase|extruder_stepper|extruder[1-9]{0,1}|fan|filament_switch_sensor|firmware_retraction|force_move|gcode_arcs|gcode_button|gcode_macro|hall_filament_width_sensor|heater_bed|heater_fan|heater_generic|homing_heaters|homing_override|idle_timeout|include|manual_stepper|mcp4018|mcp4451|mcp4728|mcu|menu|multi_pin|neopixel|output_pin|pause_resume|printer|probe|quad_gantry_level|replicape|respond|safe_z_home|samd_sercom|screws_tilt_adjust|servo|skew_correction|static_digital_output|stepper_(?:bed|arm|[abcdxy]|z[1-9]{0,1})|sx1509|temperature_fan|temperature_sensor|thermistor|tsl1401cl_filament_width_sensor|verify_heater|virtual_sdcard|z_tilt)\b/,
caseInsensitive: true caseInsensitive: true
}], }],
"#known_driver_type": [{ "#known_driver_type": [{
@ -124,6 +121,21 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
regex: /\b(?:lagrange|bicubic)\b/, regex: /\b(?:lagrange|bicubic)\b/,
caseInsensitive: true caseInsensitive: true
}], }],
"#known_samples_result_type": [{
token: "support.type",
regex: /\b(?:median|average)\b/,
caseInsensitive: true
}],
"#known_shaper_type": [{
token: "support.type",
regex: /\b(?:zv|mzv|zvd|ei|2hump_ei|and|3hump_ei)\b/,
caseInsensitive: true
}],
"#known_axel_chip": [{
token: "support.type",
regex: /\b(?:adxl345|mzv|zvd|ei|2hump_ei|and|3hump_ei)\b/,
caseInsensitive: true
}],
"#known_display_type": [{ "#known_display_type": [{
token: "support.type", token: "support.type",
regex: /\b(?:hd44780|st7920|uc1701|ssd1306|emulated_st7920|sh1106)\b/, regex: /\b(?:hd44780|st7920|uc1701|ssd1306|emulated_st7920|sh1106)\b/,
@ -140,15 +152,15 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#pin": [{ "#pin": [{
token: "support.type", token: "support.type",
regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}|(?:probe:z_virtual_endstop)/, regex: /[\^~!]*(?:EXP|ar|analog)\d{1,2}|(?:probe:z_virtual_endstop|rpi:)/,
caseInsensitive: true caseInsensitive: true
}, { }, {
token: "support.type", token: "support.type",
regex: /(?:(_\d{1,2}))/, regex: /(?:(_\d{1,2}=?))/,
caseInsensitive: true caseInsensitive: true
}, { }, {
token: "support.type", token: "support.type",
regex: /(?:\b)[\^~!]*(?:z:)?[a-z]{1,2}\d{1,2}(?:\.\d{1,2})?/, regex: /[\^~!]*(?:z:)?[a-zA-Z]{1,2}\d{1,2}(?:\.\d{1,2})?/,
caseInsensitive: true caseInsensitive: true
}], }],
"#config_line_start_gcode": [{ "#config_line_start_gcode": [{
@ -156,7 +168,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
regex: /^(gcode)(\s*[:=]\s*)/, regex: /^(gcode)(\s*[:=]\s*)/,
push: [{ push: [{
token: "text", token: "text",
regex: /(?=(\[))/, regex: /(?=(\[|#\*#))/,
next: "start" next: "start"
}, { }, {
include: "#gcode_line" include: "#gcode_line"
@ -180,8 +192,8 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}] }]
}], }],
"#config_line": [{ "#config_line": [{
token: ["variable.name"], token: ["variable.name", "variable.name"],
regex: /((?!gcode|sensor_type)\w+\s*[:]\s*)/, regex: /(?!gcode|sensor_type|rpi:)(\w+)(\s*[:]\s*)/,
push: [{ push: [{
token: "text", token: "text",
regex: /$/, regex: /$/,
@ -196,6 +208,12 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
include: "#known_screws_type" include: "#known_screws_type"
}, { }, {
include: "#known_algo_type" include: "#known_algo_type"
}, {
include: "#known_samples_result_type"
}, {
include: "#known_shaper_type"
}, {
include: "#known_axel_chip"
}, { }, {
include: "#pin" include: "#pin"
}, { }, {
@ -269,7 +287,7 @@ ace.define("ace/mode/klipper_config_highlight_rules",[], function(require, expor
}], }],
"#gcode_parameter": [{ "#gcode_parameter": [{
token: "variable.parameter", token: "variable.parameter",
regex: /\b[A-z]+(?![a-z])|(?:<---------------------- SAVE_CONFIG ---------------------->)|(?:\sDO NOT EDIT THIS BLOCK OR BELOW\. The contents are auto\-generated\.)/, regex: /\b[A-z]+(?![a-z])/,
caseInsensitive: true, caseInsensitive: true,
push: [{ push: [{
token: "text", token: "text",

View File

@ -19,7 +19,7 @@ plugin_package = "octoprint_klipper"
plugin_name = "OctoKlipper" plugin_name = "OctoKlipper"
plugin_version = "0.3.8rc8" plugin_version = "0.3.8rc9"
plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software.""" plugin_description = """A plugin for OctoPrint to configure,control and monitor the Klipper 3D printer software."""