Skip to content

Commit 241e77e

Browse files
authored
Support to open the newly created files for editor cursor automatically. (hyperf#7273)
1 parent ee8af72 commit 241e77e

File tree

7 files changed

+12
-9
lines changed

7 files changed

+12
-9
lines changed

CHANGELOG-3.1.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- [#7263](https://github.com/hyperf/hyperf/pull/7263) Added `Hyperf\Coroutine\WaitConcurrent`.
1212
- [#7265](https://github.com/hyperf/hyperf/pull/7265) Added `Hyperf\Command\Concerns\Prohibitable`.
1313
- [#7269](https://github.com/hyperf/hyperf/pull/7269) Added `Hyperf\Redis\Event\CommandExecuted`.
14+
- [#7273](https://github.com/hyperf/hyperf/pull/7273) Support to open the newly created files for editor `cursor` automatically.
1415

1516
## Optimized
1617

docs/en/devtool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ All commands supported by Command can be listed by executing the above command.
3131

3232
## Quick Open
3333

34-
Added a very simple function to quickly open created files with the built-in `gen` command, supporting `sublime`, `textmate`, `emacs`, `macvim`, `phpstorm`, `idea`, `vscode`, `vscode-insiders`, `vscode-remote`, `vscode-insiders-remote`, `atom`, `nova`, `netbeans`, `xdebug`.
34+
Added a very simple function to quickly open created files with the built-in `gen` command, supporting `sublime`, `textmate`, `cursor`, `emacs`, `macvim`, `phpstorm`, `idea`, `vscode`, `vscode-insiders`, `vscode-remote`, `vscode-insiders-remote`, `atom`, `nova`, `netbeans`, `xdebug`.
3535

3636
You also need to add this configuration block on `config/autoload/devtool.php`:
3737

3838
```php
3939
return [
4040
/**
41-
* Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
41+
* Supported IDEs: "sublime", "textmate", "cursor", "emacs", "macvim", "phpstorm", "idea",
4242
* "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
4343
* "atom", "nova", "netbeans", "xdebug"
4444
*/

docs/zh-cn/devtool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ php bin/hyperf.php
3131

3232
## 快速打开
3333

34-
增加了一个非常简单的功能,用内置的 `gen` 命令快速打开创建的文件,支持 `sublime``textmate``emacs``macvim``phpstorm``idea``vscode``vscode-insiders``vscode-remote``vscode-insiders-remote``atom``nova``netbeans``xdebug`
34+
增加了一个非常简单的功能,用内置的 `gen` 命令快速打开创建的文件,支持 `sublime`, `textmate`, `cursor`, `emacs`, `macvim`, `phpstorm`, `idea`, `vscode`, `vscode-insiders`, `vscode-remote`, `vscode-insiders-remote`, `atom`, `nova`, `netbeans`, `xdebug`
3535

3636
还需要在 `config/autoload/devtool.php` 上添加这个配置块:
3737

3838
```php
3939
return [
4040
/**
41-
* Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
41+
* Supported IDEs: "sublime", "textmate", "cursor", "emacs", "macvim", "phpstorm", "idea",
4242
* "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
4343
* "atom", "nova", "netbeans", "xdebug"
4444
*/

docs/zh-hk/devtool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ php bin/hyperf.php
3131

3232
## 快速打開
3333

34-
增加了一個非常簡單的功能,用內置的 `gen` 命令快速打開創建的文件,支持 `sublime``textmate``emacs``macvim``phpstorm``idea``vscode``vscode-insiders``vscode-remote``vscode-insiders-remote``atom``nova``netbeans``xdebug`
34+
增加了一個非常簡單的功能,用內置的 `gen` 命令快速打開創建的文件,支持 `sublime`, `textmate`, `cursor`, `emacs`, `macvim`, `phpstorm`, `idea`, `vscode`, `vscode-insiders`, `vscode-remote`, `vscode-insiders-remote`, `atom`, `nova`, `netbeans`, `xdebug`
3535

3636
還需要在 `config/autoload/devtool.php` 上添加這個配置塊:
3737

3838
```php
3939
return [
4040
/**
41-
* Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
41+
* Supported IDEs: "sublime", "textmate", "cursor", "emacs", "macvim", "phpstorm", "idea",
4242
* "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
4343
* "atom", "nova", "netbeans", "xdebug"
4444
*/

docs/zh-tw/devtool.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,14 @@ php bin/hyperf.php
3131

3232
## 快速開啟
3333

34-
增加了一個非常簡單的功能,用內建的 `gen` 命令快速開啟建立的檔案,支援 `sublime``textmate``emacs``macvim``phpstorm``idea``vscode``vscode-insiders``vscode-remote``vscode-insiders-remote``atom``nova``netbeans``xdebug`
34+
增加了一個非常簡單的功能,用內建的 `gen` 命令快速開啟建立的檔案,支援 `sublime`, `textmate`, `cursor`, `emacs`, `macvim`, `phpstorm`, `idea`, `vscode`, `vscode-insiders`, `vscode-remote`, `vscode-insiders-remote`, `atom`, `nova`, `netbeans`, `xdebug`
3535

3636
還需要在 `config/autoload/devtool.php` 上新增這個配置塊:
3737

3838
```php
3939
return [
4040
/**
41-
* Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
41+
* Supported IDEs: "sublime", "textmate", "cursor", "emacs", "macvim", "phpstorm", "idea",
4242
* "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
4343
* "atom", "nova", "netbeans", "xdebug"
4444
*/

src/devtool/publish/devtool.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use function Hyperf\Support\env;
1313

1414
return [
15-
// Supported IDEs: "sublime", "textmate", "emacs", "macvim", "phpstorm", "idea",
15+
// Supported IDEs: "sublime", "textmate", "cursor", "emacs", "macvim", "phpstorm", "idea",
1616
// "vscode", "vscode-insiders", "vscode-remote", "vscode-insiders-remote",
1717
// "atom", "nova", "netbeans", "xdebug"
1818
'ide' => env('DEVTOOL_IDE', ''),

src/devtool/src/Generator/GeneratorCommand.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@ protected function getEditorUrl(string $ide): string
228228
return 'subl://open?url=file://%s';
229229
case 'textmate':
230230
return 'txmt://open?url=file://%s';
231+
case 'cursor':
232+
return 'cursor://file/%s';
231233
case 'emacs':
232234
return 'emacs://open?url=file://%s';
233235
case 'macvim':

0 commit comments

Comments
 (0)