Skip to content

Commit 347d43b

Browse files
Freed-Wuchrisbra
authored andcommitted
patch 9.1.0769: filetype: MLIR files are not recognized
Problem: filetype: MLIR files are not recognized Solution: Detect '*.mlir' files as mlir filetype, include a mlir filetype plugin (Wu, Zhenyu) closes: #15826 Signed-off-by: Wu, Zhenyu <wuzhenyu@ustc.edu> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent ded5913 commit 347d43b

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

runtime/filetype.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -576,6 +576,9 @@ au BufNewFile,BufRead lynx.cfg setf lynx
576576
" LyRiCs
577577
au BufNewFile,BufRead *.lrc setf lyrics
578578

579+
" MLIR
580+
au BufNewFile,BufRead *.mlir setf mlir
581+
579582
" Modula-3 configuration language (must be before *.cfg and *makefile)
580583
au BufNewFile,BufRead *.quake,cm3.cfg setf m3quake
581584
au BufNewFile,BufRead m3makefile,m3overrides setf m3build

runtime/ftplugin/mlir.vim

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
" Vim filetype plugin file
2+
" Language: MLIR
3+
4+
if exists("b:did_ftplugin") | finish | endif
5+
let b:did_ftplugin = 1
6+
7+
setl comments=:///,://
8+
setl commentstring=//\ %s
9+
10+
let b:undo_ftplugin = "setl commentstring< comments<"

src/testdir/test_filetype.vim

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ def s:GetFilenameChecks(): dict<list<string>>
479479
mgp: ['file.mgp'],
480480
mib: ['file.mib', 'file.my'],
481481
mix: ['file.mix', 'file.mixal'],
482+
mlir: ['file.mlir'],
482483
mma: ['file.nb', 'file.wl'],
483484
mmp: ['file.mmp'],
484485
modconf: ['/etc/modules.conf', '/etc/modules', '/etc/conf.modules', '/etc/modprobe.file', 'any/etc/conf.modules', 'any/etc/modprobe.file', 'any/etc/modules', 'any/etc/modules.conf'],

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+
769,
707709
/**/
708710
768,
709711
/**/

0 commit comments

Comments
 (0)