@enjoys/context-engine 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/data/commands/linux.json +826 -21
  2. package/data/commands/manifest.json +3 -1
  3. package/data/completion/awk.json +203 -0
  4. package/data/completion/crontab.json +203 -0
  5. package/data/completion/dotenv.json +170 -0
  6. package/data/completion/go.json +9464 -773
  7. package/data/completion/graphql.json +181 -0
  8. package/data/completion/hcl.json +192 -0
  9. package/data/completion/ini.json +137 -0
  10. package/data/completion/json.json +170 -0
  11. package/data/completion/makefile.json +203 -0
  12. package/data/completion/markdown.json +225 -0
  13. package/data/completion/nginx.json +280 -0
  14. package/data/completion/perl.json +203 -0
  15. package/data/completion/powershell.json +225 -0
  16. package/data/completion/protobuf.json +181 -0
  17. package/data/completion/ssh_config.json +159 -0
  18. package/data/completion/systemd.json +170 -0
  19. package/data/completion/xml.json +159 -0
  20. package/data/completion/zsh.json +214 -0
  21. package/data/defination/awk.json +125 -0
  22. package/data/defination/crontab.json +107 -0
  23. package/data/defination/dotenv.json +71 -0
  24. package/data/defination/go.json +14555 -380
  25. package/data/defination/graphql.json +119 -0
  26. package/data/defination/hcl.json +125 -0
  27. package/data/defination/ini.json +77 -0
  28. package/data/defination/json.json +83 -0
  29. package/data/defination/makefile.json +113 -0
  30. package/data/defination/markdown.json +107 -0
  31. package/data/defination/nginx.json +131 -0
  32. package/data/defination/perl.json +101 -0
  33. package/data/defination/powershell.json +119 -0
  34. package/data/defination/protobuf.json +119 -0
  35. package/data/defination/ssh_config.json +89 -0
  36. package/data/defination/systemd.json +107 -0
  37. package/data/defination/xml.json +83 -0
  38. package/data/defination/zsh.json +113 -0
  39. package/data/hover/awk.json +47 -0
  40. package/data/hover/crontab.json +47 -0
  41. package/data/hover/dotenv.json +47 -0
  42. package/data/hover/go.json +4324 -202
  43. package/data/hover/graphql.json +47 -0
  44. package/data/hover/hcl.json +75 -0
  45. package/data/hover/ini.json +68 -0
  46. package/data/hover/json.json +89 -0
  47. package/data/hover/makefile.json +68 -0
  48. package/data/hover/markdown.json +68 -0
  49. package/data/hover/nginx.json +89 -0
  50. package/data/hover/perl.json +47 -0
  51. package/data/hover/powershell.json +54 -0
  52. package/data/hover/protobuf.json +47 -0
  53. package/data/hover/ssh_config.json +47 -0
  54. package/data/hover/systemd.json +54 -0
  55. package/data/hover/xml.json +61 -0
  56. package/data/hover/zsh.json +61 -0
  57. package/data/manifest.json +210 -6
  58. package/package.json +1 -1
@@ -0,0 +1,280 @@
1
+ {
2
+ "language": "nginx",
3
+ "completions": [
4
+ {
5
+ "label": "server block",
6
+ "kind": 15,
7
+ "detail": "Server block",
8
+ "documentation": {
9
+ "value": "Define a virtual server that listens on a port and handles requests for a domain."
10
+ },
11
+ "insertText": "server {\n listen ${1:80};\n server_name ${2:example.com};\n\n location / {\n ${3:root /var/www/html;}\n }\n}",
12
+ "insertTextRules": 4,
13
+ "sortText": "00_server"
14
+ },
15
+ {
16
+ "label": "location block",
17
+ "kind": 15,
18
+ "detail": "Location block",
19
+ "documentation": {
20
+ "value": "Match request URIs and define how to handle them."
21
+ },
22
+ "insertText": "location ${1:/path} {\n ${2:proxy_pass http://localhost:3000;}\n}",
23
+ "insertTextRules": 4,
24
+ "sortText": "00_location"
25
+ },
26
+ {
27
+ "label": "upstream block",
28
+ "kind": 15,
29
+ "detail": "Upstream (load balancing)",
30
+ "documentation": {
31
+ "value": "Define a group of backend servers for load balancing."
32
+ },
33
+ "insertText": "upstream ${1:backend} {\n server ${2:127.0.0.1:8001};\n server ${3:127.0.0.1:8002};\n}",
34
+ "insertTextRules": 4,
35
+ "sortText": "00_upstream"
36
+ },
37
+ {
38
+ "label": "listen",
39
+ "kind": 14,
40
+ "detail": "Listen directive",
41
+ "documentation": {
42
+ "value": "Set the address and port for the server to accept requests on."
43
+ },
44
+ "insertText": "listen ${1:80};",
45
+ "insertTextRules": 4,
46
+ "sortText": "01_listen"
47
+ },
48
+ {
49
+ "label": "listen 443 ssl",
50
+ "kind": 14,
51
+ "detail": "Listen HTTPS",
52
+ "documentation": {
53
+ "value": "Listen on port 443 with SSL/TLS enabled."
54
+ },
55
+ "insertText": "listen 443 ssl;\nssl_certificate ${1:/etc/ssl/certs/cert.pem};\nssl_certificate_key ${2:/etc/ssl/private/key.pem};",
56
+ "insertTextRules": 4,
57
+ "sortText": "01_listen_ssl"
58
+ },
59
+ {
60
+ "label": "server_name",
61
+ "kind": 14,
62
+ "detail": "Server name",
63
+ "documentation": {
64
+ "value": "Set the virtual host names this server block responds to."
65
+ },
66
+ "insertText": "server_name ${1:example.com www.example.com};",
67
+ "insertTextRules": 4,
68
+ "sortText": "01_servername"
69
+ },
70
+ {
71
+ "label": "root",
72
+ "kind": 14,
73
+ "detail": "Document root",
74
+ "documentation": {
75
+ "value": "Set the root directory for serving static files."
76
+ },
77
+ "insertText": "root ${1:/var/www/html};",
78
+ "insertTextRules": 4,
79
+ "sortText": "01_root"
80
+ },
81
+ {
82
+ "label": "index",
83
+ "kind": 14,
84
+ "detail": "Index files",
85
+ "documentation": {
86
+ "value": "Define the default files to serve when a directory is requested."
87
+ },
88
+ "insertText": "index ${1:index.html index.htm};",
89
+ "insertTextRules": 4,
90
+ "sortText": "01_index"
91
+ },
92
+ {
93
+ "label": "proxy_pass",
94
+ "kind": 14,
95
+ "detail": "Reverse proxy",
96
+ "documentation": {
97
+ "value": "Forward requests to a backend server (reverse proxy)."
98
+ },
99
+ "insertText": "proxy_pass http://${1:localhost}:${2:3000};",
100
+ "insertTextRules": 4,
101
+ "sortText": "01_proxy"
102
+ },
103
+ {
104
+ "label": "proxy_set_header",
105
+ "kind": 14,
106
+ "detail": "Proxy header",
107
+ "documentation": {
108
+ "value": "Set or modify HTTP headers passed to the proxied server."
109
+ },
110
+ "insertText": "proxy_set_header ${1:Host} ${2:$host};",
111
+ "insertTextRules": 4,
112
+ "sortText": "01_proxyheader"
113
+ },
114
+ {
115
+ "label": "proxy headers (full)",
116
+ "kind": 15,
117
+ "detail": "Common proxy headers",
118
+ "documentation": {
119
+ "value": "Commonly used proxy headers for reverse proxy setups."
120
+ },
121
+ "insertText": "proxy_set_header Host $host;\nproxy_set_header X-Real-IP $remote_addr;\nproxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;\nproxy_set_header X-Forwarded-Proto $scheme;",
122
+ "insertTextRules": 4,
123
+ "sortText": "01_proxyheaders"
124
+ },
125
+ {
126
+ "label": "ssl_certificate",
127
+ "kind": 14,
128
+ "detail": "SSL certificate",
129
+ "documentation": {
130
+ "value": "Path to the SSL/TLS certificate file."
131
+ },
132
+ "insertText": "ssl_certificate ${1:/etc/letsencrypt/live/example.com/fullchain.pem};",
133
+ "insertTextRules": 4,
134
+ "sortText": "02_sslcert"
135
+ },
136
+ {
137
+ "label": "ssl_certificate_key",
138
+ "kind": 14,
139
+ "detail": "SSL certificate key",
140
+ "documentation": {
141
+ "value": "Path to the SSL/TLS private key file."
142
+ },
143
+ "insertText": "ssl_certificate_key ${1:/etc/letsencrypt/live/example.com/privkey.pem};",
144
+ "insertTextRules": 4,
145
+ "sortText": "02_sslkey"
146
+ },
147
+ {
148
+ "label": "return",
149
+ "kind": 14,
150
+ "detail": "Return response",
151
+ "documentation": {
152
+ "value": "Return a specific HTTP status code and optional redirect URL."
153
+ },
154
+ "insertText": "return ${1:301} ${2:https://$host$request_uri};",
155
+ "insertTextRules": 4,
156
+ "sortText": "02_return"
157
+ },
158
+ {
159
+ "label": "rewrite",
160
+ "kind": 14,
161
+ "detail": "URL rewrite",
162
+ "documentation": {
163
+ "value": "Rewrite the request URI using a regex pattern."
164
+ },
165
+ "insertText": "rewrite ${1:^/old/(.*)} ${2:/new/$1} ${3:permanent};",
166
+ "insertTextRules": 4,
167
+ "sortText": "02_rewrite"
168
+ },
169
+ {
170
+ "label": "try_files",
171
+ "kind": 14,
172
+ "detail": "Try files",
173
+ "documentation": {
174
+ "value": "Check for file existence in order and serve the first match."
175
+ },
176
+ "insertText": "try_files $uri $uri/ ${1:=404};",
177
+ "insertTextRules": 4,
178
+ "sortText": "02_tryfiles"
179
+ },
180
+ {
181
+ "label": "access_log",
182
+ "kind": 14,
183
+ "detail": "Access log",
184
+ "documentation": {
185
+ "value": "Set the path for the access log file."
186
+ },
187
+ "insertText": "access_log ${1:/var/log/nginx/access.log};",
188
+ "insertTextRules": 4,
189
+ "sortText": "03_accesslog"
190
+ },
191
+ {
192
+ "label": "error_log",
193
+ "kind": 14,
194
+ "detail": "Error log",
195
+ "documentation": {
196
+ "value": "Set the path and level for the error log."
197
+ },
198
+ "insertText": "error_log ${1:/var/log/nginx/error.log} ${2:warn};",
199
+ "insertTextRules": 4,
200
+ "sortText": "03_errorlog"
201
+ },
202
+ {
203
+ "label": "gzip",
204
+ "kind": 14,
205
+ "detail": "Enable gzip",
206
+ "documentation": {
207
+ "value": "Enable gzip compression for responses."
208
+ },
209
+ "insertText": "gzip on;\ngzip_types text/plain text/css application/json application/javascript text/xml;",
210
+ "insertTextRules": 4,
211
+ "sortText": "03_gzip"
212
+ },
213
+ {
214
+ "label": "client_max_body_size",
215
+ "kind": 14,
216
+ "detail": "Max body size",
217
+ "documentation": {
218
+ "value": "Set the maximum allowed size of the client request body."
219
+ },
220
+ "insertText": "client_max_body_size ${1:10M};",
221
+ "insertTextRules": 4,
222
+ "sortText": "03_bodysize"
223
+ },
224
+ {
225
+ "label": "http to https redirect",
226
+ "kind": 15,
227
+ "detail": "HTTP to HTTPS redirect",
228
+ "documentation": {
229
+ "value": "Redirect all HTTP traffic to HTTPS."
230
+ },
231
+ "insertText": "server {\n listen 80;\n server_name ${1:example.com};\n return 301 https://$host$request_uri;\n}",
232
+ "insertTextRules": 4,
233
+ "sortText": "04_redirect"
234
+ },
235
+ {
236
+ "label": "websocket proxy",
237
+ "kind": 15,
238
+ "detail": "WebSocket proxy config",
239
+ "documentation": {
240
+ "value": "Configure nginx to proxy WebSocket connections."
241
+ },
242
+ "insertText": "location ${1:/ws} {\n proxy_pass http://${2:localhost:3000};\n proxy_http_version 1.1;\n proxy_set_header Upgrade $http_upgrade;\n proxy_set_header Connection \"upgrade\";\n}",
243
+ "insertTextRules": 4,
244
+ "sortText": "04_websocket"
245
+ },
246
+ {
247
+ "label": "rate limiting",
248
+ "kind": 15,
249
+ "detail": "Rate limit zone",
250
+ "documentation": {
251
+ "value": "Define and apply a rate limiting zone."
252
+ },
253
+ "insertText": "limit_req_zone $binary_remote_addr zone=${1:mylimit}:10m rate=${2:10r/s};",
254
+ "insertTextRules": 4,
255
+ "sortText": "04_ratelimit"
256
+ },
257
+ {
258
+ "label": "add_header",
259
+ "kind": 14,
260
+ "detail": "Add response header",
261
+ "documentation": {
262
+ "value": "Add a custom header to the response."
263
+ },
264
+ "insertText": "add_header ${1:X-Frame-Options} ${2:SAMEORIGIN};",
265
+ "insertTextRules": 4,
266
+ "sortText": "03_addheader"
267
+ },
268
+ {
269
+ "label": "expires",
270
+ "kind": 14,
271
+ "detail": "Cache expiry",
272
+ "documentation": {
273
+ "value": "Set the Expires header and Cache-Control max-age for static assets."
274
+ },
275
+ "insertText": "expires ${1:30d};",
276
+ "insertTextRules": 4,
277
+ "sortText": "03_expires"
278
+ }
279
+ ]
280
+ }
@@ -0,0 +1,203 @@
1
+ {
2
+ "language": "perl",
3
+ "completions": [
4
+ {
5
+ "label": "shebang",
6
+ "kind": 15,
7
+ "detail": "Perl shebang",
8
+ "documentation": {
9
+ "value": "Perl script shebang with strict and warnings."
10
+ },
11
+ "insertText": "#!/usr/bin/env perl\nuse strict;\nuse warnings;\n\n${1:# code}",
12
+ "insertTextRules": 4,
13
+ "sortText": "00_shebang"
14
+ },
15
+ {
16
+ "label": "use strict",
17
+ "kind": 14,
18
+ "detail": "Enable strict mode",
19
+ "documentation": {
20
+ "value": "Enable strict variable checking."
21
+ },
22
+ "insertText": "use strict;\nuse warnings;",
23
+ "insertTextRules": 4,
24
+ "sortText": "00_strict"
25
+ },
26
+ {
27
+ "label": "my variable",
28
+ "kind": 15,
29
+ "detail": "Lexical variable",
30
+ "documentation": {
31
+ "value": "Declare a lexical (local scope) variable."
32
+ },
33
+ "insertText": "my $${1:var} = ${2:value};",
34
+ "insertTextRules": 4,
35
+ "sortText": "01_my"
36
+ },
37
+ {
38
+ "label": "my array",
39
+ "kind": 15,
40
+ "detail": "Array variable",
41
+ "documentation": {
42
+ "value": "Declare an array."
43
+ },
44
+ "insertText": "my @${1:arr} = (${2:1, 2, 3});",
45
+ "insertTextRules": 4,
46
+ "sortText": "01_array"
47
+ },
48
+ {
49
+ "label": "my hash",
50
+ "kind": 15,
51
+ "detail": "Hash variable",
52
+ "documentation": {
53
+ "value": "Declare a hash (dictionary)."
54
+ },
55
+ "insertText": "my %${1:hash} = (\n ${2:key1} => '${3:value1}',\n ${4:key2} => '${5:value2}',\n);",
56
+ "insertTextRules": 4,
57
+ "sortText": "01_hash"
58
+ },
59
+ {
60
+ "label": "sub",
61
+ "kind": 15,
62
+ "detail": "Subroutine",
63
+ "documentation": {
64
+ "value": "Define a subroutine (function)."
65
+ },
66
+ "insertText": "sub ${1:name} {\n my (${2:$param}) = @_;\n ${3:# body}\n return ${4:$result};\n}",
67
+ "insertTextRules": 4,
68
+ "sortText": "01_sub"
69
+ },
70
+ {
71
+ "label": "if",
72
+ "kind": 15,
73
+ "detail": "If statement",
74
+ "documentation": {
75
+ "value": "Conditional if statement."
76
+ },
77
+ "insertText": "if (${1:condition}) {\n ${2:# code}\n}",
78
+ "insertTextRules": 4,
79
+ "sortText": "02_if"
80
+ },
81
+ {
82
+ "label": "if-else",
83
+ "kind": 15,
84
+ "detail": "If-elsif-else",
85
+ "documentation": {
86
+ "value": "Full conditional."
87
+ },
88
+ "insertText": "if (${1:condition}) {\n ${2:# true}\n} elsif (${3:other}) {\n ${4:# elsif}\n} else {\n ${5:# else}\n}",
89
+ "insertTextRules": 4,
90
+ "sortText": "02_ifelse"
91
+ },
92
+ {
93
+ "label": "foreach",
94
+ "kind": 15,
95
+ "detail": "Foreach loop",
96
+ "documentation": {
97
+ "value": "Iterate over a list."
98
+ },
99
+ "insertText": "foreach my $${1:item} (@${2:list}) {\n ${3:print \"$item\\n\";}\n}",
100
+ "insertTextRules": 4,
101
+ "sortText": "02_foreach"
102
+ },
103
+ {
104
+ "label": "while",
105
+ "kind": 15,
106
+ "detail": "While loop",
107
+ "documentation": {
108
+ "value": "Loop while condition is true."
109
+ },
110
+ "insertText": "while (${1:condition}) {\n ${2:# body}\n}",
111
+ "insertTextRules": 4,
112
+ "sortText": "02_while"
113
+ },
114
+ {
115
+ "label": "regex match",
116
+ "kind": 15,
117
+ "detail": "Regex match",
118
+ "documentation": {
119
+ "value": "Match a string against a regex pattern."
120
+ },
121
+ "insertText": "if ($${1:str} =~ /${2:pattern}/) {\n ${3:print \"matched\\n\";}\n}",
122
+ "insertTextRules": 4,
123
+ "sortText": "03_regex"
124
+ },
125
+ {
126
+ "label": "regex substitute",
127
+ "kind": 15,
128
+ "detail": "Regex substitution",
129
+ "documentation": {
130
+ "value": "Replace text using a regex pattern."
131
+ },
132
+ "insertText": "$${1:str} =~ s/${2:pattern}/${3:replacement}/g;",
133
+ "insertTextRules": 4,
134
+ "sortText": "03_subst"
135
+ },
136
+ {
137
+ "label": "open file",
138
+ "kind": 15,
139
+ "detail": "Open file",
140
+ "documentation": {
141
+ "value": "Open a file for reading."
142
+ },
143
+ "insertText": "open(my $${1:fh}, '<', '${2:file.txt}') or die \"Cannot open: $!\";\nwhile (my $line = <$${1:fh}>) {\n chomp $line;\n ${3:print \"$line\\n\";}\n}\nclose($${1:fh});",
144
+ "insertTextRules": 4,
145
+ "sortText": "03_open"
146
+ },
147
+ {
148
+ "label": "write file",
149
+ "kind": 15,
150
+ "detail": "Write to file",
151
+ "documentation": {
152
+ "value": "Open and write to a file."
153
+ },
154
+ "insertText": "open(my $${1:fh}, '>', '${2:output.txt}') or die \"Cannot open: $!\";\nprint $${1:fh} \"${3:content}\\n\";\nclose($${1:fh});",
155
+ "insertTextRules": 4,
156
+ "sortText": "03_write"
157
+ },
158
+ {
159
+ "label": "one-liner",
160
+ "kind": 15,
161
+ "detail": "Perl one-liner pattern",
162
+ "documentation": {
163
+ "value": "Common Perl one-liner patterns used on servers."
164
+ },
165
+ "insertText": "perl -${1:n}e '${2:print if /pattern/}' ${3:file.txt}",
166
+ "insertTextRules": 4,
167
+ "sortText": "04_oneliner"
168
+ },
169
+ {
170
+ "label": "chomp",
171
+ "kind": 14,
172
+ "detail": "Remove newline",
173
+ "documentation": {
174
+ "value": "Remove trailing newline from a string."
175
+ },
176
+ "insertText": "chomp($${1:line});",
177
+ "insertTextRules": 4,
178
+ "sortText": "05_chomp"
179
+ },
180
+ {
181
+ "label": "split",
182
+ "kind": 14,
183
+ "detail": "Split string",
184
+ "documentation": {
185
+ "value": "Split a string into an array."
186
+ },
187
+ "insertText": "my @${1:parts} = split(/${2:,}/, $${3:str});",
188
+ "insertTextRules": 4,
189
+ "sortText": "05_split"
190
+ },
191
+ {
192
+ "label": "join",
193
+ "kind": 14,
194
+ "detail": "Join array",
195
+ "documentation": {
196
+ "value": "Join array elements into a string."
197
+ },
198
+ "insertText": "my $${1:result} = join('${2:,}', @${3:arr});",
199
+ "insertTextRules": 4,
200
+ "sortText": "05_join"
201
+ }
202
+ ]
203
+ }