添加 路径转换 快捷键命令绑定;更新 CHANGELOG.md
This commit is contained in:
parent
6999fc30e8
commit
f99146703b
@ -29,6 +29,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
|
||||
- Adjust the project code directory structure. (项目代码目录结构调整)
|
||||
|
||||
### Added
|
||||
|
||||
- New: Support path conversions via shortcut keys `Ctrl + Alt + /` and `Ctrl + Shift + Alt + /` (also supports multi-selection conversion). (支持通过 `Ctrl + Alt + /`, `Ctrl + Shift + Alt + /` 快捷键进行路径转换 (同时支持多选区转换))
|
||||
|
||||
### Changed
|
||||
|
||||
- Do not display the editor context menu `Variable Conversion` option when text is not selected. (当未选中文本时,不显示右键菜单 `变量转换` 选项)
|
||||
@ -56,7 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
### Added
|
||||
|
||||
- New: Supports multi-selection conversion (支持多选区转换)
|
||||
- New: Supports scrolling conversion via shortcut keys `Ctrl + Alt + [` and `Ctrl + Alt + ]` (also supports multi-selection conversion) 支持通过快捷键循环转换 (同时支持多选区转换)
|
||||
- New: Supports scrolling variable conversion via shortcut keys `Ctrl + Alt + [` and `Ctrl + Alt + ]` (also supports multi-selection conversion). (支持通过 `Ctrl + Alt + [`, `Ctrl + Alt + ]` 快捷键进行变量循环转换 (同时支持多选区转换))
|
||||
|
||||
## 1.0.7
|
||||
|
||||
|
@ -40,6 +40,7 @@
|
||||
// docs: https://code.visualstudio.com/docs/getstarted/keybindings#_accepted-keys
|
||||
"keybindings": [
|
||||
// 绑定快捷键
|
||||
// ↓ 变量转换快捷键
|
||||
{
|
||||
"command": "variable-conversion.convertCase",
|
||||
"key": "shift+alt+t",
|
||||
@ -62,6 +63,30 @@
|
||||
"arrowKey": "]"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
// ↓ 路径转换快捷键
|
||||
{
|
||||
"command": "variable-conversion.convertPath",
|
||||
"key": "shift+alt+/",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
// 循环转换 上一个
|
||||
{
|
||||
"command": "variable-conversion.cyclicConvertPath.previous",
|
||||
"key": "ctrl+alt+shift+/",
|
||||
"args": {
|
||||
"direction": "<-"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
// 循环转换 下一个
|
||||
{
|
||||
"command": "variable-conversion.cyclicConvertPath.next",
|
||||
"key": "ctrl+alt+/",
|
||||
"args": {
|
||||
"direction": "->"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
}
|
||||
],
|
||||
"commands": [
|
||||
|
21
package.json
21
package.json
@ -52,6 +52,27 @@
|
||||
"arrowKey": "]"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"command": "variable-conversion.convertPath",
|
||||
"key": "shift+alt+/",
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"command": "variable-conversion.cyclicConvertPath.previous",
|
||||
"key": "ctrl+alt+shift+/",
|
||||
"args": {
|
||||
"direction": "<-"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
},
|
||||
{
|
||||
"command": "variable-conversion.cyclicConvertPath.next",
|
||||
"key": "ctrl+alt+/",
|
||||
"args": {
|
||||
"direction": "->"
|
||||
},
|
||||
"when": "editorTextFocus"
|
||||
}
|
||||
],
|
||||
"commands": [
|
||||
|
@ -118,16 +118,38 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
context.subscriptions.push(convertCaseDisposable);
|
||||
|
||||
// 注册循环转换 command
|
||||
let disposableLoopConversionPrev = vscode.commands.registerCommand('variable-conversion.cyclicConvertCase.previous', ({ arrowKey }) => {
|
||||
console.log('variable-conversion.convertCase', arrowKey);
|
||||
let loopConvertCasePrevDisposable = vscode.commands.registerCommand('variable-conversion.cyclicConvertCase.previous', ({ arrowKey }) => {
|
||||
console.log('variable-conversion.cyclicConvertCase.previous', arrowKey);
|
||||
CyclicConversion.previousOne();
|
||||
});
|
||||
context.subscriptions.push(disposableLoopConversionPrev);
|
||||
let disposableLoopConversionNext = vscode.commands.registerCommand('variable-conversion.cyclicConvertCase.next', ({ arrowKey }) => {
|
||||
console.log('variable-conversion.convertCase', arrowKey);
|
||||
context.subscriptions.push(loopConvertCasePrevDisposable);
|
||||
let loopConvertCaseNextDisposable = vscode.commands.registerCommand('variable-conversion.cyclicConvertCase.next', ({ arrowKey }) => {
|
||||
console.log('variable-conversion.cyclicConvertCase.next', arrowKey);
|
||||
CyclicConversion.nextOne();
|
||||
});
|
||||
context.subscriptions.push(disposableLoopConversionNext);
|
||||
context.subscriptions.push(loopConvertCaseNextDisposable);
|
||||
|
||||
|
||||
/**
|
||||
* 路径转换
|
||||
* issue: #3 https://github.com/coder-xiaomo/variable-conversion-vscode-extension/issues/3
|
||||
*/
|
||||
|
||||
// 注册路径转换 command 状态栏/快捷键/右键[路径转换]菜单均有用到
|
||||
let convertPathDisposable = vscode.commands.registerCommand('variable-conversion.convertPath', handleQuickPick);
|
||||
context.subscriptions.push(convertPathDisposable);
|
||||
|
||||
// 注册循环转换 command
|
||||
let loopConvertPathPrevDisposable = vscode.commands.registerCommand('variable-conversion.cyclicConvertPath.previous', ({ direction }) => {
|
||||
console.log('variable-conversion.cyclicConvertPath.previous', direction);
|
||||
// TODO
|
||||
});
|
||||
context.subscriptions.push(loopConvertPathPrevDisposable);
|
||||
let loopConvertPathNextDisposable = vscode.commands.registerCommand('variable-conversion.cyclicConvertPath.next', ({ direction }) => {
|
||||
console.log('variable-conversion.cyclicConvertPath.next', direction);
|
||||
// TODO
|
||||
});
|
||||
context.subscriptions.push(loopConvertPathNextDisposable);
|
||||
}
|
||||
|
||||
// This method is called when your extension is deactivated
|
||||
|
Loading…
Reference in New Issue
Block a user