Skip to content

Commit c9c9e3c

Browse files
authored
Merge pull request #210 from choco-technologies/copilot/fix-vscode-extension-syntax
Add syntax highlighting for module configuration paths in .dmd files
2 parents 9acf106 + 761be88 commit c9c9e3c

5 files changed

Lines changed: 33 additions & 2 deletions

File tree

tools/lib/dmod_dependencies/vscode-dmd/CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
All notable changes to the "dmod-dependencies" extension will be documented in this file.
44

5+
## [1.2.0] - 2026-02-12
6+
7+
### Added
8+
- Support for module configuration file paths
9+
- Syntax highlighting for configuration paths after module names
10+
- Support for custom destination names in module entries
11+
- Updated documentation with configuration path examples
12+
513
## [1.1.0] - 2024-11-17
614

715
### Added

tools/lib/dmod_dependencies/vscode-dmd/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ This extension provides syntax highlighting for DMOD Dependencies (`.dmd`) files
99
- Highlighting for:
1010
- Module entries with optional versions (`module@version`)
1111
- Version range constraints (`module@>=1.0`, `module@<=2.0`, `module@>=1.0<=2.0`)
12+
- Configuration file paths (`module config/path.ini`)
13+
- Custom destination names (`module config/path.ini custom_name.ini`)
1214
- Include directives (`$include`)
1315
- Source directives (`$from`)
1416

@@ -49,6 +51,13 @@ spi@>=1.0 # Version 1.0 or newer
4951
uart@<=2.0 # Version 2.0 or older
5052
i2c@>=1.0<=2.0 # Version between 1.0 and 2.0
5153
54+
# Module with configuration file
55+
dmclk board/stm32f746g-disco.ini
56+
uart@1.2.3 configs/uart_115200.ini
57+
58+
# Module with configuration and custom destination name
59+
gpio configs/gpio_default.cfg custom_gpio.cfg
60+
5261
# Include another dependencies file
5362
$include http://repo.com/other.dmd
5463
@@ -69,6 +78,10 @@ can@>=1.5
6978
- `@>1.0` - Greater than 1.0
7079
- `@<2.0` - Less than 2.0
7180
- `@>=1.0<=2.0` - Combined range (1.0 to 2.0)
81+
- **Configuration paths**: Module entries can include configuration file paths
82+
- Format: `module[@version] config_path [custom_dest_name]`
83+
- Example: `dmclk@1.0 board/stm32f746g-disco.ini`
84+
- Example with custom name: `gpio config/default.cfg my_gpio.cfg`
7285
- **Include directive**: `$include <url>` to include other `.dmd` files
7386
- **From directive**: `$from <manifest_url>` to change the manifest source
7487

tools/lib/dmod_dependencies/vscode-dmd/example.dmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@
22
# This file demonstrates the .dmd format
33

44
# Simple module entries without versions
5+
dmell
56
dmffs
7+
dmramfs
68
driver
79
make_dmffs
810

911
# Module entries with specific versions
12+
dmdevfs@0.2
1013
spi@1.0
1114
i2c@2.5
1215
uart@1.2.3
1316

1417
# Module entries with configuration files
1518
# Format: module[@version] config_path [custom_dest_name]
19+
dmclk board/stm32f746g-disco.ini
1620
dmclk@1.0 mcu/stm32f7.ini
1721
uart@1.2.3 configs/uart_115200.ini
1822

tools/lib/dmod_dependencies/vscode-dmd/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "dmod-dependencies",
33
"displayName": "DMOD Dependencies Language Support",
44
"description": "Syntax highlighting for DMOD Dependencies (.dmd) files",
5-
"version": "1.1.0",
5+
"version": "1.2.0",
66
"publisher": "ChocoTechnologiesDMOD",
77
"repository": {
88
"type": "git",

tools/lib/dmod_dependencies/vscode-dmd/syntaxes/dmd.tmLanguage.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
"patterns": [
7878
{
7979
"name": "meta.module-entry.dmd",
80-
"match": "^\\s*([a-zA-Z0-9_.-]+)(@([><=]+)?([0-9a-zA-Z._-]+)([><=]+[0-9a-zA-Z._-]+)?)?\\s*(\\$from\\s+.+)?$",
80+
"match": "^\\s*([a-zA-Z0-9_.-]+)(@([><=]+)?([0-9a-zA-Z._-]+)([><=]+[0-9a-zA-Z._-]+)?)?(?:\\s+((?:[^\\s$]+|\\$(?!from))+))?(?:\\s+((?:[^\\s$]+|\\$(?!from))+))?\\s*(\\$from\\s+.+)?$",
8181
"captures": {
8282
"1": {
8383
"name": "entity.name.function.module.dmd"
@@ -108,6 +108,12 @@
108108
]
109109
},
110110
"6": {
111+
"name": "string.unquoted.path.config.dmd"
112+
},
113+
"7": {
114+
"name": "string.unquoted.path.custom-name.dmd"
115+
},
116+
"8": {
111117
"patterns": [
112118
{
113119
"include": "#inline-from"

0 commit comments

Comments
 (0)