[vim/vim] Add Free Form ILE RPG filetype files (PR #12152)

19 views
Skip to first unread message

Andreas Louv

unread,
Mar 14, 2023, 5:50:20 PM3/14/23
to vim/vim, Subscribed

It seems like vim doesn't ship with syntax / filetype files for the ILE RPG programming language:

https://en.wikipedia.org/wiki/IBM_RPG and
https://www.ibm.com/docs/en/i/7.5?topic=rpg-ile-programmers-guide

This PR contains ftdetect, syntax, indent and ftplugin files for Free Form ILE RPG files.

The files *.rpgle and *.rpgleinc will be detected as being the filetype=rpgle.

This PR contains adopted code from https://github.com/andlrc/rpgle.vim


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/12152

Commit Summary

  • b937352 Generate helptags
  • 9f42c43 Add syntax, indent, ftplugin and detection of Free Form ILE RPG programs
  • e192684 Add @andlrc to the CODEOWNERS file for rpgle related files
  • 9d057e7 Add helptags for ft_rpgle.txt

File Changes

(9 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152@github.com>

Amaan Qureshi

unread,
Mar 16, 2023, 2:49:25 AM3/16/23
to vim/vim, Subscribed

Forgive me if this is a stupid question stemming from my curiosity, but is ILE RPG the same as IBM's? RPG was on my todo list of creating treesitter grammars for to then add (really good) syntax highliighting support in neovim treesitter


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/c1471409669@github.com>

Bram Moolenaar

unread,
Mar 16, 2023, 8:28:06 AM3/16/23
to vim/vim, Subscribed


> It seems like vim doesn't ship with syntax / filetype files for the
> ILE RPG programming language:
>
> https://en.wikipedia.org/wiki/IBM_RPG and
> https://www.ibm.com/docs/en/i/7.5?topic=rpg-ile-programmers-guide
>
> This PR contains ftdetect, syntax, indent and ftplugin files for Free
> Form ILE RPG files.
>
> The files `*.rpgle` and `*.rpgleinc` will be detected as being the
> `filetype=rpgle`.

I can include the filetype detection part. If there is something in
common with other RPG filetypes that can be handled in the plugins.

You should not use "function!" in plugins. If the script is loaded
again, a function can be redefined once, also without the exclamation
mark. The exclamation mark allows for redefining multiple times, which
can hide making the mistake of using the same function name twice.

In the syntax file please use "hi def link" instead of "highlight link".

There is no need to include an update for doc/tags, it's generated.

--
A cow comes flying over the battlements, lowing aggressively. The cow
lands on GALAHAD'S PAGE, squashing him completely.
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

/// Bram Moolenaar -- ***@***.*** -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/c1471867297@github.com>

Doug Kearns

unread,
Mar 16, 2023, 12:32:53 PM3/16/23
to vim/vim, Subscribed

@dkearns commented on this pull request.


In runtime/ftplugin/rpgle.vim:

> +xnoremap <script> <buffer> <silent> <Plug>XRpglePrevProcEnd
+       \ :<C-U>call rpgle#NextSection('^\s*end-proc', 'b', 'x')<CR>
+
+" Nest jumping
+nnoremap <script> <buffer> <silent> <Plug>RpglePrevBlock
+       \ :call rpgle#NextNest('b')<CR>
+nnoremap <script> <buffer> <silent> <Plug>RpgleNextBlock
+       \ :call rpgle#NextNest('')<CR>
+
+" Operator Pending brackets
+noremap <script> <buffer> <silent> <Plug>RpgleAroundBlock
+       \ :<C-U>call rpgle#Operator('a')<CR>
+noremap <script> <buffer> <silent> <Plug>RpgleInnerBlock
+       \ :<C-U>call rpgle#Operator('i')<CR>
+
+if !get(g:, 'rpgle_skipMapping', 0)

It would be better to use the standard mechanism to disable plugin mappings. See :help no_plugin_maps.

So this line would be something like:

if !exists("g:no_plugin_maps") && !exists("g:no_rpgle_maps")

This file should also set b:undo_ftplugin.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/review/1344270670@github.com>

Andreas Louv

unread,
Mar 16, 2023, 5:19:36 PM3/16/23
to vim/vim, Subscribed

I can include the filetype detection part. If there is something in
common with other RPG filetypes that can be handled in the plugins.

The way I read this is that the ftplugin, syntax, indent etc, should be handled by an external plugin, I guess that makes sense.

I can see that you already included the filetype detection part, so I'll close up this PR then.

There is no need to include an update for doc/tags, it's generated.

Good to know.

You should not use "function!" in plugins. [...]

In the syntax file please use "hi def link" instead of "highlight link".

and

It would be better to use the standard mechanism to disable plugin mappings. See :help no_plugin_maps.

[...]


This file should also set b:undo_ftplugin.

Thanks for the valuable feedback, I'll bring it upstream in the previous linked plugin.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/c1472756511@github.com>

Andreas Louv

unread,
Mar 16, 2023, 5:27:49 PM3/16/23
to vim/vim, Push

@andlrc pushed 2 commits.

  • e15a7c6 Add syntax, indent, ftplugin and detection of Free Form ILE RPG programs
  • daef3b0 Add @andlrc to the CODEOWNERS file for rpgle related files


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/push/12972473179@github.com>

codecov[bot]

unread,
Mar 16, 2023, 5:39:28 PM3/16/23
to vim/vim, Subscribed

Codecov Report

Merging #12152 (daef3b0) into master (d11ac40) will decrease coverage by 1.19%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master   #12152      +/-   ##
==========================================
- Coverage   82.31%   81.12%   -1.19%     
==========================================
  Files         154      154              
  Lines      183678   183631      -47     
  Branches    41400    41400              
==========================================
- Hits       151193   148974    -2219     
- Misses      19932    21704    +1772     
- Partials    12553    12953     +400     
Flag Coverage Δ
huge-clang-none 82.66% <ø> (+<0.01%) ⬆️
huge-gcc-testgui ?
huge-gcc-unittests 0.29% <ø> (ø)
linux 81.12% <ø> (-1.19%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 114 files with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.


Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/c1472781383@github.com>

Andreas Louv

unread,
Mar 20, 2023, 10:24:05 AM3/20/23
to vim/vim, Subscribed

Closed #12152.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/12152/issue_event/8795275747@github.com>

Reply all
Reply to author
Forward
0 new messages