Skip to content

Commit a87462a

Browse files
Freed-Wuchrisbra
authored andcommitted
patch 9.1.0873: filetype: Vivado files are not recognized
Problem: filetype: Vivado files are not recognized Solution: detect '*.mss' files as 'mss' filetype (Wu, Zhenyu) references: https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS closes: #15907 Signed-off-by: Wu, Zhenyu <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent a15dfc2 commit a87462a

File tree

6 files changed

+45
-0
lines changed

6 files changed

+45
-0
lines changed

.github/MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ runtime/ftplugin/meson.vim @Liambeguin
217217
runtime/ftplugin/modula2.vim @dkearns
218218
runtime/ftplugin/modula3.vim @dkearns
219219
runtime/ftplugin/mojo.vim @ribru17
220+
runtime/ftplugin/mss.vim @Freed-Wu
220221
runtime/ftplugin/nginx.vim @chr4
221222
runtime/ftplugin/nim.vim @ribru17
222223
runtime/ftplugin/nroff.vim @a-vrma
@@ -516,6 +517,7 @@ runtime/syntax/modula2/opt/iso.vim @trijezdci
516517
runtime/syntax/modula2/opt/pim.vim @trijezdci
517518
runtime/syntax/modula2/opt/r10.vim @trijezdci
518519
runtime/syntax/modula3.vim @dkearns
520+
runtime/syntax/mss.vim @Freed-Wu
519521
runtime/syntax/n1ql.vim @pr3d4t0r
520522
runtime/syntax/nginx.vim @chr4
521523
runtime/syntax/ninja.vim @nico

runtime/filetype.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,7 @@ au BufNewFile,BufRead */etc/xinetd.conf setf xinetd
28402840
" Xilinx Vivado/Vitis project files and block design files
28412841
au BufNewFile,BufRead *.xpr,*.xpfm,*.spfm,*.bxml,*.mmi setf xml
28422842
au BufNewFile,BufRead *.bd,*.bda,*.xci setf json
2843+
au BufNewFile,BufRead *.mss setf mss
28432844

28442845
" XS Perl extension interface language
28452846
au BufNewFile,BufRead *.xs setf xs

runtime/ftplugin/mss.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
" Vim filetype plugin file
2+
" Language: Vivado mss file
3+
" Last Change: 2024 Oct 22
4+
" Document: https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS
5+
" Maintainer: Wu, Zhenyu <[email protected]>
6+
7+
if exists("b:did_ftplugin")
8+
finish
9+
endif
10+
let b:did_ftplugin = 1
11+
12+
setlocal comments=b:#,fb:-
13+
setlocal commentstring=#\ %s
14+
15+
let b:match_words = '\<BEGIN\>:\<END\>'
16+
let b:undo_ftplugin = "setl com< cms< | unlet b:match_words"

runtime/syntax/mss.vim

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
" Vim syntax file
2+
" Language: Vivado mss file
3+
" Maintainer: The Vim Project <https://github.com/vim/vim>
4+
" Last Change: 2024 Oct 22
5+
" Document: https://docs.amd.com/r/2020.2-English/ug1400-vitis-embedded/Microprocessor-Software-Specification-MSS
6+
" Maintainer: Wu, Zhenyu <[email protected]>
7+
8+
if exists("b:current_syntax")
9+
finish
10+
endif
11+
12+
syn case ignore
13+
syn match mssComment "#.*$" contains=@Spell
14+
syn keyword mssKeyword BEGIN END PARAMETER
15+
syn keyword mssType OS PROCESSOR DRIVER LIBRARY
16+
syn keyword mssConstant VERSION PROC_INSTANCE HW_INSTANCE OS_NAME OS_VER DRIVER_NAME DRIVER_VER LIBRARY_NAME LIBRARY_VER STDIN STDOUT XMDSTUB_PERIPHERAL ARCHIVER COMPILER COMPILER_FLAGS EXTRA_COMPILER_FLAGS
17+
18+
hi def link mssComment Comment
19+
hi def link mssKeyword Keyword
20+
hi def link mssType Type
21+
hi def link mssConstant Constant
22+
23+
let b:current_syntax = "mss"

src/testdir/test_filetype.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ def s:GetFilenameChecks(): dict<list<string>>
507507
mplayerconf: ['mplayer.conf', '/.mplayer/config', 'any/.mplayer/config'],
508508
mrxvtrc: ['mrxvtrc', '.mrxvtrc'],
509509
msidl: ['file.odl', 'file.mof'],
510+
mss: ['file.mss'],
510511
msql: ['file.msql'],
511512
mojo: ['file.mojo', 'file.🔥'],
512513
msmtp: ['.msmtprc'],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,8 @@ static char *(features[]) =
704704

705705
static int included_patches[] =
706706
{ /* Add new patch number below this line */
707+
/**/
708+
873,
707709
/**/
708710
872,
709711
/**/

0 commit comments

Comments
 (0)