Skip to content

Commit 7033d88

Browse files
committed
✨ Add mdd
1 parent cf7080a commit 7033d88

File tree

4 files changed

+67
-0
lines changed

4 files changed

+67
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Language server for some specific bash scripts:
5151
- `*.eclass`
5252
- [`make.conf`](https://dev.gentoo.org/~zmedico/portage/doc/man/make.conf.5.html)
5353
- [`color.map`](https://dev.gentoo.org/~zmedico/portage/doc/man/color.map.5.html)
54+
- zsh
55+
- [`*.mdd`](https://github.com/zsh-users/zsh/blob/57248b88830ce56adc243a40c7773fb3825cab34/Etc/zsh-development-guide#L285-L288)
5456

5557
This language server only provides extra features which
5658
[bash-language-server](https://github.com/bash-lsp/bash-language-server)

src/termux_language_server/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"ebuild",
2222
"make.conf",
2323
"color.map",
24+
"mdd",
2425
]
2526
PACKAGE_NAME = r"[a-z][a-z0-9-]*"
2627
CSV = f"{PACKAGE_NAME}(, {PACKAGE_NAME})*"
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$id": "https://github.com/termux/termux-language-server/blob/main/src/termux_language_server/assets/json/build.sh.json",
3+
"$schema": "http://json-schema.org/draft-07/schema#",
4+
"$comment": "https://github.com/zsh-users/zsh/blob/57248b88830ce56adc243a40c7773fb3825cab34/Etc/zsh-development-guide#L285-L288",
5+
"type": "object",
6+
"properties": {
7+
"name": {
8+
"type": "string",
9+
"description": "name of the module"
10+
},
11+
"link": {
12+
"type": "string",
13+
"enum": ["static", "dynamic", "no"],
14+
"description": "as described in INSTALL. In addition, the value `either` is allowed in the .mdd file, which will be converted by configure to `dynamic` if that is available, else `static`. May also be a command string, which will be run within configure and whose output is used to set the value of `link` in config.modules. This allows a system-specific choice of modules. For example, \n```zsh\nlink=`case $host in\n *-hpux*) echo dynamic;\n ;;\n *) echo no;\n ;;\n esac`\n```"
15+
},
16+
"load": {
17+
"type": "string",
18+
"enum": ["yes", "no"],
19+
"description": "whether the shell should include hooks for loading the module automatically as necessary. (This corresponds to an `L` in xmods.conf in the old mechanism.)"
20+
},
21+
"moddeps": {
22+
"type": "string",
23+
"description": "modules on which this module depends (default none)"
24+
},
25+
"nozshdep": {
26+
"type": "string",
27+
"description": "non-empty indicates no dependence on the `zsh/main' pseudo-module"
28+
},
29+
"alwayslink": {
30+
"type": "string",
31+
"description": "if non-empty, always link the module into the executable"
32+
},
33+
"autofeatures": {
34+
"type": "string",
35+
"description": "features defined by the module for autoloading, a space-separated list. The syntax for features is as for zmodload -F, e.g. b:mybin refers to the builtin mybin. This replaces the previous mechanism with separate variables for builtins, conditions, math functions and parameters. Note the features are only available in zsh's native mode, not in emulation modes."
36+
},
37+
"autofeatures_emu": {
38+
"type": "string",
39+
"description": "As autofeatures, but the features so presented are available in modes that are *not* zsh's native mode. The variable autofeatures must also be present."
40+
},
41+
"objects": {
42+
"type": "string",
43+
"description": ".o files making up this module (*must* be defined)"
44+
},
45+
"proto": {
46+
"type": "string",
47+
"description": ".syms files for this module (default generated from $objects)"
48+
},
49+
"headers": {
50+
"type": "string",
51+
"description": "extra headers for this module (default none)"
52+
},
53+
"hdrdeps": {
54+
"type": "string",
55+
"description": "extra headers on which the .mdh depends (default none)"
56+
},
57+
"otherincs": {
58+
"type": "string",
59+
"description": "extra headers that are included indirectly (default none)"
60+
}
61+
}
62+
}

src/termux_language_server/utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,4 +85,6 @@ def get_filetype(uri: str) -> FILETYPE | Literal[""]:
8585
return "make.conf"
8686
if basename == "color.map":
8787
return "color.map"
88+
if ext == "mdd":
89+
return "mdd"
8890
return ""

0 commit comments

Comments
 (0)