Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit77ea02d

Browse files
committed
Fix renaming with php7.4 typed properties and 8.0 union types
1 parent44dd1f3 commit77ea02d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎plugin/php-refactoring-toolbox.vim‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ let s:php_regex_ns_line = '^namespace\_s\+[\\_A-Za-z0-9]*\_s*[;{]'
9090
lets:php_regex_use_line='^use\_s\+[\\_A-Za-z0-9]\+\%(\_s\+as\_s\+[_A-Za-z0-9]\+\)\?\_s*\%(,\_s\+[\\_A-Za-z0-9]\+\%(\_s\+as\_s\+[_A-Za-z0-9]\+\)\?\_s*\)*;'
9191
lets:php_regex_class_line='^\%(\%(final\s\+\|abstract\s\+\)\?class\>\|trait\>\)'
9292
lets:php_regex_const_line='^\s*const\s\+[^;]\+;'
93-
lets:php_regex_member_line='^\s*\%(\%(private\|protected\|public\|static\)\s*\)\+\$'
93+
lets:php_regex_member_line='^\s*\%(\%(private\|protected\|public\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\s*\)\+\$'
9494
lets:php_regex_func_line='^\s*\%(\%(private\|protected\|public\|static\|abstract\)\s*\)*function\_s\+'
9595

9696
lets:php_regex_local_var='\$\<\%(this\>\)\@![A-Za-z0-9]*'
@@ -193,14 +193,14 @@ function! PhpRenameClassVariable() " {{{
193193
letl:oldName=substitute(expand('<cword>'),'^\$*','','')
194194
letl:newName=inputdialog('Rename' .l:oldName .' to:')
195195
ifg:vim_php_refactoring_auto_validate_rename==0
196-
ifs:PhpSearchInCurrentClass('\C\%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' .l:newName .'\>','n') >0
196+
ifs:PhpSearchInCurrentClass('\C\%(\%(\%(public\|protected\|private\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\_s\+\)\+\$\|$this->\)\@<=' .l:newName .'\>','n') >0
197197
calls:PhpEchoError(l:newName .' seems to already exist in the current class. Rename anyway ?')
198198
ifinputlist(["0. No","1. Yes"])==0
199199
return
200200
endif
201201
endif
202202
endif
203-
calls:PhpReplaceInCurrentClass('\C\%(\%(\%(public\|protected\|private\|static\)\_s\+\)\+\$\|$this->\)\@<=' .l:oldName .'\>',l:newName)
203+
calls:PhpReplaceInCurrentClass('\C\%(\%(\%(public\|protected\|private\|static\)\%(\_s\+?\?[\\|_A-Za-z0-9]\+\)\?\_s\+\)\+\$\|$this->\)\@<=' .l:oldName .'\>',l:newName)
204204
endfunction
205205
" }}}
206206

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp