Skip to content

Commit 623a22d

Browse files
authored
Merge pull request #12 from juanlopez4691/ide-helper-sail
add sail support to ide helper commands
2 parents 7e22993 + 486db3e commit 623a22d

File tree

2 files changed

+12
-9
lines changed

2 files changed

+12
-9
lines changed

lua/laravel/ide_helper.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
local M = {}
44

55
local ui = require('laravel.ui')
6+
local sail = require('laravel.sail')
67

78
-- Cache for IDE helper completions
89
local cache = {
@@ -78,9 +79,9 @@ local function ensure_ide_helper_files()
7879
if choice == 1 then
7980
-- Generate files
8081
local commands = {
81-
'php artisan ide-helper:generate',
82-
'php artisan ide-helper:models --write',
83-
'php artisan ide-helper:meta'
82+
sail.wrap_command('php artisan ide-helper:generate'),
83+
sail.wrap_command('php artisan ide-helper:models --write'),
84+
sail.wrap_command('php artisan ide-helper:meta')
8485
}
8586

8687
for _, cmd in ipairs(commands) do

plugin/laravel.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ if vim.g.loaded_laravel_nvim then
66
end
77
vim.g.loaded_laravel_nvim = true
88

9+
local sail = require('laravel.sail')
10+
911
-- Check if we're in a Laravel project
1012
local function is_laravel_project()
1113
local markers = { 'artisan', 'composer.json', 'app/Http', 'config/app.php' }
@@ -589,13 +591,13 @@ local function setup_commands()
589591
local root = _G.laravel_nvim.project_root
590592

591593
local commands = {
592-
generate = 'php artisan ide-helper:generate',
593-
models = 'php artisan ide-helper:models --write',
594-
meta = 'php artisan ide-helper:meta',
594+
generate = sail.wrap_command('php artisan ide-helper:generate'),
595+
models = sail.wrap_command('php artisan ide-helper:models --write'),
596+
meta = sail.wrap_command('php artisan ide-helper:meta'),
595597
all = {
596-
'php artisan ide-helper:generate',
597-
'php artisan ide-helper:models --write',
598-
'php artisan ide-helper:meta'
598+
sail.wrap_command('php artisan ide-helper:generate'),
599+
sail.wrap_command('php artisan ide-helper:models --write'),
600+
sail.wrap_command('php artisan ide-helper:meta')
599601
}
600602
}
601603

0 commit comments

Comments
 (0)