From 108d2bf74bc02eaed74beae5589d7116936aefa5 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Thu, 25 Jul 2024 09:26:13 +0200 Subject: vim-patch:e73e5b8: runtime(java): Optionally highlight the :: token for method references This token will be highlighted, similar to the arrow of lambda expressions, whenever "g:java_highlight_functions" is defined. Also: - Improve the recognition of _switch-case_ labels (D-Cysteine). - Remove insignificant empty statements in syntax test files. closes: vim/vim#15322 References: https://docs.oracle.com/javase/specs/jls/se21/html/jls-15.html#jls-15.13 https://github.com/fleiner/vim/pull/1 https://github.com/vim/vim/commit/e73e5b889b52675a9ea58cf154235c7f25d107d5 Co-authored-by: Aliaksei Budavei <0x000c70@gmail.com> Co-authored-by: D-Cysteine <54219287+D-Cysteine@users.noreply.github.com> --- runtime/syntax/java.vim | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'runtime/syntax') diff --git a/runtime/syntax/java.vim b/runtime/syntax/java.vim index 4beeaad224..9c4964db71 100644 --- a/runtime/syntax/java.vim +++ b/runtime/syntax/java.vim @@ -3,7 +3,7 @@ " Maintainer: Aliaksei Budavei <0x000c70 AT gmail DOT com> " Former Maintainer: Claudio Fleiner " Repository: https://github.com/zzzyxwvut/java-vim.git -" Last Change: 2024 Jun 22 +" Last Change: 2024 Jul 23 " Please check :help java.vim for comments on some of the options available. @@ -260,7 +260,7 @@ if exists("java_space_errors") endif endif -exec 'syn match javaUserLabel "^\s*\<\K\k*\>\%(\\)\@' . s:ff.Peek('7', '') . '\%(\\)\@' . s:ff.Peek('7', '') . '" matchgroup=NONE end=":\|->" contains=javaLabelCastType,javaLabelNumber,javaCharacter,javaString,javaConstant,@javaClasses,javaGenerics,javaLabelDefault,javaLabelVarType,javaLabelWhenClause syn region javaLabelRegion transparent matchgroup=javaLabel start="\\%(\s*\%(:\|->\)\)\@=" matchgroup=NONE end=":\|->" oneline " Consider grouped _default_ _case_ labels, i.e. @@ -497,8 +497,12 @@ syn match javaParenError "\]" hi def link javaParenError javaError -" Lambda expressions (JLS-17, §15.27). +" Lambda expressions (JLS-17, §15.27) and method references (JLS-17, +" §15.13). if exists("java_highlight_functions") + syn match javaMethodRef ":::\@!" + hi def link javaMethodRef javaFuncDef + if exists("java_highlight_signature") let s:ff.LambdaDef = s:ff.LeftConstant else -- cgit