-
Notifications
You must be signed in to change notification settings - Fork 5
/
package.json
171 lines (171 loc) · 7.59 KB
/
package.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
{
"name": "hungry-delete",
"displayName": "Hungry Delete",
"description": "To delete an entire block of whitespace or tab, and reduce the time programmers need to press backspace",
"version": "1.7.0",
"publisher": "jasonlhy",
"engines": {
"vscode": "^1.69.0"
},
"license": "MIT",
"icon": "images/icon.png",
"categories": [
"Keymaps",
"Other"
],
"activationEvents": [
"onCommand:extension.hungryDelete",
"onCommand:extension.smartBackspace"
],
"main": "./out/src/extension",
"contributes": {
"commands": [
{
"command": "extension.hungryDelete",
"title": "Hungry Delete"
},
{
"command": "extension.smartBackspace",
"title": "Smart Backspace"
}
],
"keybindings": [
{
"key": "ctrl+backspace",
"mac": "alt+backspace",
"command": "extension.hungryDelete",
"when": "editorTextFocus && !editorReadonly"
},
{
"key": "backspace",
"mac": "backspace",
"command": "extension.smartBackspace",
"when": "config.hungryDelete.enableSmartBackspace && editorTextFocus && !editorReadonly"
}
],
"configuration": {
"title": "Hungry Delete Configuration",
"type": "object",
"properties": {
"hungryDelete.enableSmartBackspace": {
"type": "boolean",
"description": "Enable Smart Backspace",
"default": true
},
"hungryDelete.keepOneSpace": {
"type": "boolean",
"description": "Keep at least one space after last word of previous line with smart backspace",
"default": false
},
"hungryDelete.keepOneSpaceException" : {
"type": "string",
"description": "Keep One Space except when it encounters following characters"
},
"hungryDelete.considerIncreaseIndentPattern" : {
"type": "boolean",
"description": "Consider increaseIndentPattern in indentationRules for smart backspace",
"default": false
},
"hungryDelete.followAboveLineIndent" : {
"type": "boolean",
"description": "Consider the indentation of above line for smart backspace if increaseIndentPattern do not match above line",
"default": false
},
"hungryDelete.languageConfigurations" : {
"type": "array",
"description": "Provide language configuration which affects the behavior of smart backspace",
"default": [
{
"languageId": "html",
"indentationRules": {
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$",
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})"
}
},
{
"languageId": "go",
"indentationRules": {
"increaseIndentPattern": "^.*(\\bcase\\b.*:|\\bdefault\\b:|(\\b(func|if|else|switch|select|for|struct)\\b.*)?{[^}\"'`]*|\\([^)\"'`]*)$",
"decreaseIndentPattern": "^\\s*(\\bcase\\b.*:|\\bdefault\\b:|}[)}]*[),]?|\\)[,]?)$"
}
},
{
"languageId": "json",
"indentationRules": {
"increaseIndentPattern": "^.*(\\{[^}]*|\\[[^\\]]*)$",
"decreaseIndentPattern": "^\\s*[}\\]],?\\s*$"
}
},
{
"languageId": "less",
"indentationRules": {
"increaseIndentPattern": "(^.*\\{[^}]*$)",
"decreaseIndentPattern": "^\\s*\\}"
}
},
{
"languageId": "lua",
"indentationRules": {
"increaseIndentPattern": "^((?!(\\-\\-)).)*((\\b(else|function|then|do|repeat)\\b((?!\\b(end|until)\\b).)*)|(\\{\\s*))$",
"decreaseIndentPattern": "^\\s*((\\b(elseif|else|end|until)\\b)|(\\})|(\\)))"
}
},
{
"languageId": "php",
"indentationRules": {
"increaseIndentPattern": "({(?!.+}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch).*:)\\s*(/[/*].*)?$",
"decreaseIndentPattern": "^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\][;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))"
}
},
{
"languageId": "ruby",
"indentationRules": {
"increaseIndentPattern": "^\\s*((begin|class|(private|protected)\\s+def|def|else|elsif|ensure|for|if|module|rescue|unless|until|when|while|case)|([^#]*\\sdo\\b)|([^#]*=\\s*(case|if|unless)))\\b([^#\\{;]|(\"|'|\/).*\\4)*(#.*)?$",
"decreaseIndentPattern": "^\\s*([}\\]]([,)]?\\s*(#|$)|\\.[a-zA-Z_]\\w*\\b)|(end|rescue|ensure|else|elsif|when)\\b)"
}
},
{
"languageId": "typescript",
"indentationRules": {
"increaseIndentPattern": "^((?!.*?\\/\\*).*\\*\\/)?\\s*[\\}\\]].*$",
"decreaseIndentPattern": "^((?!\\/\\/).)*(\\{[^}\"'`]*|\\([^)\"'`]*|\\[[^\\]\"'`]*)$"
}
},
{
"languageId": "yaml",
"indentationRules": {
"increaseIndentPattern": "^\\s*.*(:|-) ?(&\\w+)?(\\{[^}\"']*|\\([^)\"']*)?$",
"decreaseIndentPattern": "^\\s+\\}$"
}
}
]
}
}
}
},
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"pretest": "npm run compile && npm run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
},
"devDependencies": {
"@types/vscode": "^1.69.0",
"@types/glob": "^7.2.0",
"@types/mocha": "^9.1.1",
"@types/node": "16.x",
"@typescript-eslint/eslint-plugin": "^5.30.0",
"@typescript-eslint/parser": "^5.30.0",
"eslint": "^8.18.0",
"glob": "^8.0.3",
"mocha": "^10.0.0",
"typescript": "^4.7.4",
"@vscode/test-electron": "^2.1.5"
},
"repository": {
"type": "git",
"url": "https://github.com/Jasonlhy/VSCode-Hungry-Delete"
}
}