mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
runtime(vim): Update base-syntax file, improve class, enum and interface highlighting
- Enable folding of class, enum and interface declarations. - Highlight constructor names with the Function highlight group, like other special methods. - Mark function definitions using special method names as errors. - Highlight :type arguments. fixes: #14393#issuecomment-2042796198. closes: #13810 Signed-off-by: Doug Kearns <dougkearns@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
ec0229414b
commit
818c641b6f
70
runtime/syntax/testdir/input/vim9_ex_class_fold.vim
Normal file
70
runtime/syntax/testdir/input/vim9_ex_class_fold.vim
Normal file
@@ -0,0 +1,70 @@
|
||||
vim9script
|
||||
# Vim9 :class command
|
||||
# VIM_TEST_SETUP let g:vimsyn_folding = 'cf'
|
||||
# VIM_TEST_SETUP setl fdc=2 fdl=99 fdm=syntax
|
||||
|
||||
interface Interface1
|
||||
endinterface
|
||||
interface Interface2
|
||||
endinterface
|
||||
|
||||
class Class1
|
||||
endclass
|
||||
|
||||
export class Class2
|
||||
endclass
|
||||
|
||||
abstract class Class3
|
||||
endclass
|
||||
|
||||
export abstract class Class4
|
||||
endclass
|
||||
|
||||
class Class5 extends Class1
|
||||
endclass
|
||||
|
||||
export class Class6 extends Class1
|
||||
endclass
|
||||
|
||||
class Class7 implements Interface1, Interface2
|
||||
endclass
|
||||
|
||||
export class Class8 implements Interface1, Interface2
|
||||
endclass
|
||||
|
||||
class Class9
|
||||
def new()
|
||||
enddef
|
||||
def Method1(): void
|
||||
def Nested1(): void
|
||||
def Nested2(): void
|
||||
enddef
|
||||
enddef
|
||||
enddef
|
||||
def _Method2(): void
|
||||
enddef
|
||||
static def Method3(): void
|
||||
enddef
|
||||
endclass
|
||||
|
||||
abstract class Class10
|
||||
abstract def Method1(): void
|
||||
abstract def string(): string
|
||||
endclass
|
||||
|
||||
|
||||
# Issue: #14393
|
||||
|
||||
interface Testable
|
||||
def SetUp()
|
||||
def TearDown()
|
||||
endinterface
|
||||
|
||||
abstract class TestTemplate implements Testable
|
||||
var failed: number
|
||||
var passed: number
|
||||
|
||||
abstract def SetUp()
|
||||
abstract def TearDown()
|
||||
endclass
|
||||
|
Reference in New Issue
Block a user