@enjoys/context-engine 1.0.3 → 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.
- package/data/completion/awk.json +203 -0
- package/data/completion/crontab.json +203 -0
- package/data/completion/dotenv.json +170 -0
- package/data/completion/graphql.json +181 -0
- package/data/completion/hcl.json +192 -0
- package/data/completion/ini.json +137 -0
- package/data/completion/json.json +170 -0
- package/data/completion/makefile.json +203 -0
- package/data/completion/markdown.json +225 -0
- package/data/completion/nginx.json +280 -0
- package/data/completion/perl.json +203 -0
- package/data/completion/powershell.json +225 -0
- package/data/completion/protobuf.json +181 -0
- package/data/completion/ssh_config.json +159 -0
- package/data/completion/systemd.json +170 -0
- package/data/completion/xml.json +159 -0
- package/data/completion/zsh.json +214 -0
- package/data/defination/awk.json +125 -0
- package/data/defination/crontab.json +107 -0
- package/data/defination/dotenv.json +71 -0
- package/data/defination/graphql.json +119 -0
- package/data/defination/hcl.json +125 -0
- package/data/defination/ini.json +77 -0
- package/data/defination/json.json +83 -0
- package/data/defination/makefile.json +113 -0
- package/data/defination/markdown.json +107 -0
- package/data/defination/nginx.json +131 -0
- package/data/defination/perl.json +101 -0
- package/data/defination/powershell.json +119 -0
- package/data/defination/protobuf.json +119 -0
- package/data/defination/ssh_config.json +89 -0
- package/data/defination/systemd.json +107 -0
- package/data/defination/xml.json +83 -0
- package/data/defination/zsh.json +113 -0
- package/data/hover/awk.json +47 -0
- package/data/hover/crontab.json +47 -0
- package/data/hover/dotenv.json +47 -0
- package/data/hover/graphql.json +47 -0
- package/data/hover/hcl.json +75 -0
- package/data/hover/ini.json +68 -0
- package/data/hover/json.json +89 -0
- package/data/hover/makefile.json +68 -0
- package/data/hover/markdown.json +68 -0
- package/data/hover/nginx.json +89 -0
- package/data/hover/perl.json +47 -0
- package/data/hover/powershell.json +54 -0
- package/data/hover/protobuf.json +47 -0
- package/data/hover/ssh_config.json +47 -0
- package/data/hover/systemd.json +54 -0
- package/data/hover/xml.json +61 -0
- package/data/hover/zsh.json +61 -0
- package/data/manifest.json +210 -6
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "graphql",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"type": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```graphql\ntype User {\n id: ID!\n name: String!\n email: String\n posts: [Post!]!\n role: Role!\n createdAt: DateTime!\n}\n```\n**type** defines an object with fields. `!` means non-null, `[Type]` means list. Fields can have arguments."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"query": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```graphql\n# Schema definition:\ntype Query {\n user(id: ID!): User\n users(limit: Int = 10): [User!]!\n}\n\n# Client query:\nquery GetUser($id: ID!) {\n user(id: $id) {\n name\n email\n posts { title }\n }\n}\n```\n**Query** is the read-only entry point. Variables prefixed with `$` are passed separately from the query."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"mutation": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```graphql\nmutation CreateUser($input: CreateUserInput!) {\n createUser(input: $input) {\n id\n name\n }\n}\n\n# Variables:\n# { \"input\": { \"name\": \"John\", \"email\": \"john@example.com\" } }\n```\n**Mutation** modifies server data. Use input types for complex arguments. Returns the modified data."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"fragment": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```graphql\nfragment UserFields on User {\n id\n name\n email\n}\n\nquery {\n user(id: \"1\") { ...UserFields }\n admin: user(id: \"2\") { ...UserFields }\n}\n```\n**fragment** avoids field duplication. Spread with `...FragmentName`. Inline fragments: `... on Type { }`."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"directives": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```graphql\n# Built-in directives:\nfield @deprecated(reason: \"Use newField\")\nfield @skip(if: $condition)\nfield @include(if: $condition)\n\n# Custom directive:\ndirective @auth(requires: Role = ADMIN) on FIELD_DEFINITION\n\ntype Mutation {\n deleteUser(id: ID!): Boolean! @auth(requires: ADMIN)\n}\n```\n**Directives** add metadata. Built-in: `@deprecated`, `@skip`, `@include`. Custom directives extend functionality."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"scalars": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```graphql\n# Built-in scalars:\nID # unique identifier (serialized as String)\nString # UTF-8 text\nInt # 32-bit signed integer\nFloat # double-precision float\nBoolean # true/false\n\n# Custom scalars:\nscalar DateTime\nscalar JSON\nscalar Upload\n```\n**Scalars** are leaf types. Custom scalars need resolver implementation on the server side."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "hcl",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"resource": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```hcl\nresource \"aws_instance\" \"web\" {\n ami = \"ami-abc123\"\n instance_type = \"t2.micro\"\n}\n```\n**resource** blocks define infrastructure objects. The first label is the resource type, the second is the local name."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"variable": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```hcl\nvariable \"region\" {\n type = string\n default = \"us-east-1\"\n description = \"AWS region\"\n}\n```\n**variable** blocks declare input parameters. Set via `-var`, `.tfvars` files, or environment variables `TF_VAR_name`."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"output": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```hcl\noutput \"instance_ip\" {\n value = aws_instance.web.public_ip\n}\n```\n**output** blocks expose values from your module, visible after `terraform apply`."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"data": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```hcl\ndata \"aws_ami\" \"ubuntu\" {\n most_recent = true\n filter {\n name = \"name\"\n values = [\"ubuntu/images/*\"]\n }\n}\n```\n**data** sources read existing infrastructure. Referenced as `data.type.name.attribute`."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"provider": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```hcl\nprovider \"aws\" {\n region = \"us-east-1\"\n}\n```\n**provider** configures the connection to a cloud/service API. Each resource type belongs to a provider."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"module": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```hcl\nmodule \"vpc\" {\n source = \"terraform-aws-modules/vpc/aws\"\n version = \"5.0.0\"\n cidr = \"10.0.0.0/16\"\n}\n```\n**module** calls reuse configurations. Source can be local paths, Terraform Registry, Git, or S3."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"for_each": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```hcl\nresource \"aws_instance\" \"web\" {\n for_each = toset([\"a\", \"b\", \"c\"])\n ami = \"ami-abc123\"\n instance_type = \"t2.micro\"\n}\n```\n**for_each** creates one instance per item. Access current item with `each.key` and `each.value`."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"lifecycle": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```hcl\nlifecycle {\n create_before_destroy = true\n prevent_destroy = true\n ignore_changes = [tags]\n}\n```\n**lifecycle** customizes resource behavior: create before destroy, prevent accidental deletion, ignore drift."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"backend": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```hcl\nterraform {\n backend \"s3\" {\n bucket = \"my-state\"\n key = \"terraform.tfstate\"\n region = \"us-east-1\"\n }\n}\n```\n**backend** stores Terraform state remotely. Enables team collaboration and state locking."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"dynamic": {
|
|
68
|
+
"contents": [
|
|
69
|
+
{
|
|
70
|
+
"value": "```hcl\ndynamic \"ingress\" {\n for_each = var.ports\n content {\n from_port = ingress.value\n to_port = ingress.value\n }\n}\n```\n**dynamic** blocks generate repeated nested blocks from collections. Avoids repetitive configuration."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "ini",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"section": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```ini\n[section_name]\nkey1 = value1\nkey2 = value2\n```\nA **section** groups related configuration entries under a named header enclosed in square brackets."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"key_value": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```ini\nport = 3306\nbind-address = 127.0.0.1\n```\n**Key-value pair** - Assigns a configuration value to a named key. Delimiter is `=` or `:`."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"comment": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```ini\n; This is a comment\n# This is also a comment\n```\n**Comments** start with `;` or `#`. The entire line after the comment character is ignored."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"DEFAULT": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```ini\n[DEFAULT]\nbase_dir = /opt\n\n[app]\npath = %(base_dir)s/myapp\n```\nThe **[DEFAULT]** section provides fallback values that are inherited by all other sections."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"interpolation": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```ini\n[paths]\nbase = /srv\ndata = %(base)s/data\n```\n**Interpolation** substitutes `%(key)s` with the value of another key. Supported by Python ConfigParser."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"multiline": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```ini\ndescription = This is a\n multiline value that\n spans several lines\n```\n**Multi-line values** - Continuation lines must be indented with whitespace."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"mysqld": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```ini\n[mysqld]\nport = 3306\nmax_connections = 151\ninnodb_buffer_pool_size = 128M\n```\n**[mysqld]** - MySQL server daemon configuration section in my.cnf."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"php": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```ini\n[PHP]\nmemory_limit = 128M\nupload_max_filesize = 2M\nmax_execution_time = 30\n```\n**PHP configuration** in php.ini. Controls runtime behavior, memory limits, and file upload sizes."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"supervisord": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```ini\n[program:myapp]\ncommand = /usr/bin/python app.py\nautostart = true\nautorestart = true\n```\n**Supervisor** process control system config. Manages long-running processes with auto-restart."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "json",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"object": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```json\n{\"name\": \"value\", \"count\": 42}\n```\nA JSON **object** is an unordered set of key-value pairs enclosed in `{}`. Keys must be double-quoted strings. Pairs are separated by commas."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"array": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```json\n[1, \"two\", true, null]\n```\nA JSON **array** is an ordered list of values enclosed in `[]`. Values are separated by commas and can be any JSON type."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"string": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```json\n\"Hello, World!\"\n```\n**String** - A sequence of Unicode characters wrapped in double quotes. Supports escape sequences: `\\n` (newline), `\\t` (tab), `\\\"` (quote), `\\uXXXX` (unicode)."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"number": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```json\n42\n3.14\n1.5e10\n```\n**Number** - Integer or floating-point. No leading zeros, no hex/octal notation. Supports negative numbers and scientific notation (e/E)."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"boolean": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```json\ntrue\nfalse\n```\n**Boolean** - Represents a logical true or false value. Must be all lowercase."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"null": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```json\nnull\n```\n**null** - Represents the absence of a value. Always lowercase. Commonly used for optional/missing fields."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"true": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```json\n\"enabled\": true\n```\n**true** - Boolean literal representing a truthy value. Must be lowercase."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"false": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```json\n\"enabled\": false\n```\n**false** - Boolean literal representing a falsy value. Must be lowercase."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"trailing_comma": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```json\n// INVALID:\n{\"a\": 1,}\n// VALID:\n{\"a\": 1}\n```\n**Trailing commas** are NOT allowed in standard JSON. Remove the last comma before a closing `}` or `]`."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"comments": {
|
|
68
|
+
"contents": [
|
|
69
|
+
{
|
|
70
|
+
"value": "```\n// NOT supported in standard JSON\n{\"_comment\": \"Use this workaround\"}\n```\nJSON does not support comments. Use JSONC (JSON with Comments) in editors, or add `_comment` keys."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"escape": {
|
|
75
|
+
"contents": [
|
|
76
|
+
{
|
|
77
|
+
"value": "```\n\\\" double quote\n\\\\ backslash\n\\/ forward slash\n\\n newline\n\\t tab\n\\r carriage return\n\\uXXXX unicode\n```\n**Escape sequences** in JSON strings. The backslash `\\` is the escape character."
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"schema": {
|
|
82
|
+
"contents": [
|
|
83
|
+
{
|
|
84
|
+
"value": "```json\n{\"$schema\": \"https://json-schema.org/draft/2020-12/schema\"}\n```\n**JSON Schema** provides a way to validate the structure of JSON data. The `$schema` keyword declares the schema version."
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "makefile",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"target": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```makefile\nbuild: main.o utils.o\n\tgcc -o app main.o utils.o\n```\n**Targets** define what to build. Prerequisites are checked first; if any are newer than the target, the recipe runs."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"phony": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```makefile\n.PHONY: all build test clean\n```\n**.PHONY** declares targets that aren't files. Without it, `make clean` won't run if a file named `clean` exists."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"variable": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```makefile\nCC := gcc # simple expansion\nCFLAGS = -Wall # recursive expansion\nPORT ?= 8080 # conditional (default)\nLDFLAGS += -lm # append\n```\n**Variables** store values for reuse. `:=` expands immediately, `=` expands on use, `?=` only if unset."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"automatic": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```makefile\n%.o: %.c\n\t$(CC) -c $< -o $@\n\n# $@ = target name\n# $< = first prerequisite\n# $^ = all prerequisites\n# $* = stem (matched %)\n```\n**Automatic variables** are set by Make for each rule. They refer to the target and prerequisites."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"shell": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```makefile\nGIT_HASH := $(shell git rev-parse --short HEAD)\nFILES := $(shell find src -name '*.go')\n```\n**$(shell ...)** executes a command and captures stdout. Used to get dynamic values like git hashes or file lists."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"tab": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```makefile\n# CORRECT (tab):\nbuild:\n\tgo build ./...\n\n# WRONG (spaces):\nbuild:\n go build ./...\n```\n**Recipe lines MUST use TAB** characters, not spaces. This is the #1 Makefile gotcha. Configure your editor to insert real tabs."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"include": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```makefile\ninclude Makefile.common\n-include .env.mk # - means don't error if missing\n```\n**include** reads another Makefile. Prefix with `-` to silently ignore if the file doesn't exist."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"conditional": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```makefile\nifeq ($(OS),Windows_NT)\n BINARY := app.exe\nelse\n BINARY := app\nendif\n```\n**Conditionals** (`ifeq`, `ifneq`, `ifdef`, `ifndef`) control which parts of the Makefile are processed."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"pattern_rule": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```makefile\n%.o: %.c\n\t$(CC) $(CFLAGS) -c $< -o $@\n```\n**Pattern rules** use `%` as a wildcard. This rule says: to make any `.o` file, compile the corresponding `.c` file."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "markdown",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"heading": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```markdown\n# H1 - Document title\n## H2 - Section\n### H3 - Subsection\n#### H4\n##### H5\n###### H6\n```\n**Headings** create document structure. Use only one H1 per document. Leave a blank line before and after headings."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"emphasis": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```markdown\n*italic* or _italic_\n**bold** or __bold__\n***bold italic***\n~~strikethrough~~\n```\n**Text formatting** in Markdown. Asterisks and underscores for emphasis, tildes for strikethrough (GFM)."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"link": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```markdown\n[Click here](https://example.com)\n[With title](https://example.com \"Title\")\n[Reference][id]\n\n[id]: https://example.com\n```\n**Links** can be inline, reference-style, or autolinked. URLs in angle brackets are autolinked."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"code": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "````markdown\nInline: `const x = 1`\n\nBlock:\n```javascript\nfunction hello() {\n console.log('world');\n}\n```\n````\n**Code** - Use backticks for inline, triple backticks for blocks. Specify language after opening backticks for syntax highlighting."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"list": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```markdown\n- Unordered item\n - Nested item\n\n1. Ordered item\n2. Second item\n\n- [ ] Task incomplete\n- [x] Task complete\n```\n**Lists** - Use `-`, `*`, or `+` for unordered. Numbers for ordered. `[ ]`/`[x]` for tasks."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"table": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```markdown\n| Name | Age | City |\n|:------|:---:|--------:|\n| Alice | 30 | NYC |\n| Bob | 25 | London |\n```\n**Tables** use pipes `|` and hyphens `-`. Colon placement controls alignment: `:---` left, `:---:` center, `---:` right."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"blockquote": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```markdown\n> This is a quote\n> \n> > Nested quote\n```\n**Blockquotes** prefix lines with `>`. Can contain other Markdown elements. Useful for callouts and citations."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"image": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```markdown\n\n\n```\n**Images** use `` syntax. Alt text is important for accessibility. Title appears on hover."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"frontmatter": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```markdown\n---\ntitle: My Post\ndate: 2024-01-01\ntags: [tutorial, guide]\ndraft: false\n---\n```\n**Frontmatter** is YAML metadata between `---` delimiters. Used by Jekyll, Hugo, Gatsby, and other static site generators."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "nginx",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"server": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```nginx\nserver {\n listen 80;\n server_name example.com;\n root /var/www/html;\n}\n```\n**server** block defines a virtual host. Each server block listens on specific ports and responds to specific domain names."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"location": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```nginx\nlocation / { ... } # prefix match\nlocation = /exact { ... } # exact match\nlocation ~ \\.php$ { ... } # regex match\nlocation ^~ /images/ { ... } # prefix priority\n```\n**location** matches request URIs and applies configuration. Priority: exact (=) > prefix (^~) > regex (~, ~*) > prefix."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"upstream": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```nginx\nupstream backend {\n server 10.0.0.1:8080;\n server 10.0.0.2:8080;\n}\n```\n**upstream** defines a group of backend servers for load balancing. Default method is round-robin."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"listen": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```nginx\nlisten 80;\nlisten 443 ssl;\nlisten [::]:80;\n```\n**listen** sets the address and port. Supports IPv4, IPv6, SSL, and HTTP/2."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"proxy_pass": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```nginx\nlocation /api {\n proxy_pass http://backend:3000;\n}\n```\n**proxy_pass** forwards requests to a backend server (reverse proxy). The URL can be an upstream name or direct address."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"ssl_certificate": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```nginx\nssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;\nssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;\n```\n**SSL certificate** directives specify the public certificate and private key for HTTPS."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"try_files": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```nginx\nlocation / {\n try_files $uri $uri/ /index.html;\n}\n```\n**try_files** checks for file existence in order. Commonly used for SPA fallback routing."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
},
|
|
53
|
+
"rewrite": {
|
|
54
|
+
"contents": [
|
|
55
|
+
{
|
|
56
|
+
"value": "```nginx\nrewrite ^/blog/(.*)$ /articles/$1 permanent;\n```\n**rewrite** transforms the request URI using regex. Flags: last, break, redirect (302), permanent (301)."
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
},
|
|
60
|
+
"gzip": {
|
|
61
|
+
"contents": [
|
|
62
|
+
{
|
|
63
|
+
"value": "```nginx\ngzip on;\ngzip_types text/plain text/css application/json;\ngzip_min_length 1000;\n```\n**gzip** enables response compression. Reduces bandwidth but uses CPU. Set gzip_types for which MIME types to compress."
|
|
64
|
+
}
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
"rate_limit": {
|
|
68
|
+
"contents": [
|
|
69
|
+
{
|
|
70
|
+
"value": "```nginx\nlimit_req_zone $binary_remote_addr zone=api:10m rate=10r/s;\nlimit_req zone=api burst=20 nodelay;\n```\n**Rate limiting** restricts request rates per client IP. burst allows temporary spikes. nodelay processes burst immediately."
|
|
71
|
+
}
|
|
72
|
+
]
|
|
73
|
+
},
|
|
74
|
+
"client_max_body_size": {
|
|
75
|
+
"contents": [
|
|
76
|
+
{
|
|
77
|
+
"value": "```nginx\nclient_max_body_size 50M;\n```\n**client_max_body_size** sets the max upload size. Returns 413 (Request Entity Too Large) if exceeded. Default is 1M."
|
|
78
|
+
}
|
|
79
|
+
]
|
|
80
|
+
},
|
|
81
|
+
"add_header": {
|
|
82
|
+
"contents": [
|
|
83
|
+
{
|
|
84
|
+
"value": "```nginx\nadd_header X-Frame-Options SAMEORIGIN;\nadd_header X-Content-Type-Options nosniff;\nadd_header Strict-Transport-Security \"max-age=31536000\";\n```\n**add_header** adds security and custom headers to responses."
|
|
85
|
+
}
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "perl",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"variables": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```perl\nmy $scalar = \"hello\"; # single value\nmy @array = (1, 2, 3); # ordered list\nmy %hash = (a => 1); # key-value pairs\n\n$array[0] # array element\n$hash{key} # hash value\nscalar @array # array length\n```\n**Variable types** - `$` scalar, `@` array, `%` hash. Sigils change based on access context."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"regex": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```perl\n$str =~ /pattern/; # match\n$str =~ s/old/new/g; # substitute\n$str =~ tr/a-z/A-Z/; # transliterate\nif ($str =~ /^(\\w+)/) {\n print \"$1\\n\"; # capture group\n}\n```\n**Regex** is Perl's superpower. `=~` binds, `!~` negates. Captures in `$1`, `$2`, etc."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"file_io": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```perl\nopen(my $fh, '<', 'file.txt') or die $!;\nwhile (<$fh>) { # read line by line\n chomp;\n print \"$_\\n\";\n}\nclose($fh);\n```\n**File I/O** uses three-arg open. `<` read, `>` write, `>>` append. `<$fh>` reads line by line. `$_` is default variable."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"one_liners": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```bash\n# Replace text in file:\nperl -pi -e 's/old/new/g' file.txt\n\n# Print matching lines (like grep):\nperl -ne 'print if /pattern/' file.txt\n\n# Sum numbers:\nperl -ane '$s+=$F[0]; END{print $s}' data.txt\n\n# In-place edit with backup:\nperl -pi.bak -e 's/foo/bar/g' *.conf\n```\n**One-liners** - Perl's -n/-p flags make it a powerful command-line text processor. -i for in-place editing."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"special_vars": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```perl\n$_ # default variable\n@_ # subroutine arguments\n$! # system error message\n$@ # eval error\n$/ # input record separator\n$\\ # output record separator\n$0 # program name\n```\n**Special variables** - Perl has many built-in variables. `$_` is the most common - default for many functions."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"strict": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```perl\nuse strict; # require declarations, no barewords\nuse warnings; # runtime + compile warnings\n\n# Always start scripts with both:\n#!/usr/bin/perl\nuse strict;\nuse warnings;\n```\n**strict** and **warnings** should always be enabled. They catch common bugs like typos in variable names."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "powershell",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"function": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```powershell\nfunction Get-Greeting {\n param(\n [Parameter(Mandatory)]\n [string]$Name\n )\n \"Hello, $Name!\"\n}\n```\n**function** defines a reusable command. Use PascalCase with Verb-Noun naming. `param()` declares parameters."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"pipeline": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```powershell\nGet-Process |\n Where-Object { $_.CPU -gt 10 } |\n Sort-Object CPU -Descending |\n Select-Object -First 5 Name, CPU\n```\n**Pipeline** passes full .NET objects between commands (not just text like Unix pipes). Each `|` feeds output to the next command's input."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"comparison": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```powershell\n$a -eq $b # equal\n$a -ne $b # not equal\n$a -gt $b # greater than\n$a -lt $b # less than\n$a -like '*.txt' # wildcard match\n$a -match '^[0-9]' # regex match\n$a -contains $b # collection contains\n```\n**Comparison operators** - PowerShell uses `-eq`, `-gt`, etc. instead of `==`, `>`. Case-insensitive by default; add `c` prefix for case-sensitive (`-ceq`)."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"variables": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```powershell\n$name = \"World\" # string\n$count = 42 # integer\n$items = @(1, 2, 3) # array\n$hash = @{ a = 1 } # hashtable\n$env:PATH # environment variable\n$_ # current pipeline object\n```\n**Variables** start with `$`. PowerShell is dynamically typed. `$env:` accesses environment variables."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"Get-Service": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```powershell\nGet-Service | Where-Object Status -eq 'Running'\nGet-Service -Name 'nginx'\nRestart-Service -Name 'nginx' -Force\nStop-Service -Name 'IISAdmin'\n```\n**Service cmdlets** manage Windows services. Get, Start, Stop, Restart, Set, and New are available."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"error_handling": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```powershell\ntry {\n Get-Item \"nonexistent\" -ErrorAction Stop\n} catch {\n Write-Error \"Failed: $($_.Exception.Message)\"\n} finally {\n # cleanup\n}\n```\n**try/catch** handles terminating errors. Use `-ErrorAction Stop` to convert non-terminating errors."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"splatting": {
|
|
47
|
+
"contents": [
|
|
48
|
+
{
|
|
49
|
+
"value": "```powershell\n$params = @{\n Path = 'C:\\logs'\n Filter = '*.log'\n Recurse = $true\n}\nGet-ChildItem @params\n```\n**Splatting** passes a hashtable of parameters using `@` instead of `$`. Cleaner than long single-line commands."
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"language": "protobuf",
|
|
3
|
+
"hovers": {
|
|
4
|
+
"message": {
|
|
5
|
+
"contents": [
|
|
6
|
+
{
|
|
7
|
+
"value": "```protobuf\nmessage User {\n string name = 1;\n int32 age = 2;\n repeated string tags = 3;\n map<string, string> metadata = 4;\n optional string bio = 5;\n}\n```\n**message** defines structured data. Field numbers (1, 2, etc.) are used in binary encoding - never reuse deleted numbers."
|
|
8
|
+
}
|
|
9
|
+
]
|
|
10
|
+
},
|
|
11
|
+
"service": {
|
|
12
|
+
"contents": [
|
|
13
|
+
{
|
|
14
|
+
"value": "```protobuf\nservice UserService {\n rpc GetUser(GetUserRequest) returns (User);\n rpc ListUsers(ListUsersRequest) returns (stream User); // server stream\n rpc Upload(stream Chunk) returns (UploadResponse); // client stream\n rpc Chat(stream Msg) returns (stream Msg); // bidirectional\n}\n```\n**service** defines gRPC endpoints. Four patterns: unary, server streaming, client streaming, bidirectional."
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
},
|
|
18
|
+
"enum": {
|
|
19
|
+
"contents": [
|
|
20
|
+
{
|
|
21
|
+
"value": "```protobuf\nenum Status {\n STATUS_UNSPECIFIED = 0; // must have 0 value\n STATUS_ACTIVE = 1;\n STATUS_INACTIVE = 2;\n}\n```\n**enum** defines named constants. The zero value is required and should be UNSPECIFIED. Use the type name as prefix convention."
|
|
22
|
+
}
|
|
23
|
+
]
|
|
24
|
+
},
|
|
25
|
+
"field_numbers": {
|
|
26
|
+
"contents": [
|
|
27
|
+
{
|
|
28
|
+
"value": "```protobuf\nmessage Example {\n string name = 1; // 1-15: one byte (use for frequent fields)\n int32 count = 2; // 16-2047: two bytes\n // 19000-19999: reserved by protobuf\n \n reserved 5, 10 to 12; // reserve deleted field numbers\n reserved \"old_field_name\"; // reserve deleted field names\n}\n```\n**Field numbers** identify fields in the binary format. Use 1-15 for frequently-used fields (more efficient encoding). Never reuse numbers."
|
|
29
|
+
}
|
|
30
|
+
]
|
|
31
|
+
},
|
|
32
|
+
"well_known_types": {
|
|
33
|
+
"contents": [
|
|
34
|
+
{
|
|
35
|
+
"value": "```protobuf\nimport \"google/protobuf/timestamp.proto\";\nimport \"google/protobuf/duration.proto\";\nimport \"google/protobuf/empty.proto\";\nimport \"google/protobuf/wrappers.proto\";\nimport \"google/protobuf/any.proto\";\nimport \"google/protobuf/struct.proto\";\n```\n**Well-known types** are pre-defined utility messages. Timestamp for dates, Empty for no-data responses, wrappers for nullable scalars."
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
},
|
|
39
|
+
"scalar_types": {
|
|
40
|
+
"contents": [
|
|
41
|
+
{
|
|
42
|
+
"value": "```protobuf\n// Numeric:\ndouble, float // floating point\nint32, int64 // variable-length signed\nuint32, uint64 // variable-length unsigned\nsint32, sint64 // efficient for negatives\nfixed32, fixed64 // fixed-length unsigned\nsfixed32, sfixed64 // fixed-length signed\n\n// Other:\nbool // true/false\nstring // UTF-8 text\nbytes // raw bytes\n```\n**Scalar types** - choose based on value range and encoding efficiency."
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|