syntax file plsql.vim maintainer not reachable. Have patch.

64 views
Skip to first unread message

Lee Lindley

unread,
Apr 17, 2022, 7:25:13 AM4/17/22
to vim_dev

The listed maintainer email address for syntax file plsql.vim returns mail as undeliverable and his online presence has not been updated in many years. The syntax file has not kept up with changes to Oracle (19c is now mainstream while syntax file only supports through 9i).

I have an update ( https://github.com/lee-lindley/vim_plsql_syntax ) and demonstrate decent test coverage in my screenshots. I can generate a pull request, but the instructions in CONTRIBUTING.md say to contact the maintainer first.

Please advise.

PS

I don't have a "test" to add per se, but have a sample pl/sql file that exercises much of the trickier syntax parsing I'm interested in.  I'm eyeballing it. If there is a separate document for creating test scripts or examples for coverage checks on syntax files, please point me to it.

 

" Vim syntax file

" Language: Oracle Procedureal SQL (PL/SQL)

" Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)

" Original Maintainer: C. Laurence Gonsalves (clgo...@kami.com)

" URL: http://lanzarotta.tripod.com/vim/syntax/plsql.vim.zip

" Last Change: September 18, 2002

" History: Geoff Evans & Bill Pribyl (bill at plnet dot org)

"                            Added 9i keywords.

"                Austin Ziegler (austin at halostatue dot ca)

"                            Added 8i+ features.

Christian Brabandt

unread,
Apr 17, 2022, 11:56:41 AM4/17/22
to vim_dev

On So, 17 Apr 2022, Lee Lindley wrote:

> The listed maintainer email address for syntax file plsql.vim returns mail as undeliverable and his online presence has not been updated in many years. The syntax file has not kept up with changes to Oracle (19c is now mainstream while
> syntax file only supports through 9i).
>
> I have an update ( https://github.com/lee-lindley/vim_plsql_syntax ) and demonstrate decent test coverage in my screenshots. I can generate a pull request, but the instructions in CONTRIBUTING.md say to contact the maintainer first.
>
> Please advise.
>
> PS
>
> I don't have a "test" to add per se, but have a sample pl/sql file that exercises much of the trickier syntax parsing I'm interested in. I'm eyeballing it. If there is a separate document for creating test scripts or examples for coverage
> checks on syntax files, please point me to it.
>

If the maintainer is unreachable, would you volunteer to take care of
the plsql syntax then?

And as a side note, if you have any changes for Oracle SQL, I'll happily
include any changes here:
https://github.com/chrisbra/vim-sqloracle-syntax/

I don't use Oracle SQL as much as several years ago, but try to keep it
up to date if someone makes me aware of required changes.


Thanks,
Chris
--
Übrigens stellen die Priester uns nur darum als Stellvertreter Gottes
hin, um sich selbst als Werkzeuge und Dolmetscher der Gottheit
auszugeben.
-- Friedrich II. der Große (an Prinz Wilhelm von Braunschweig)

Lee Lindley

unread,
Apr 17, 2022, 3:13:40 PM4/17/22
to vim_dev
Hi Chris,

I am an Oracle subject matter expert and pretty good with regular expressions, but not so much on vim. I could take the maintainer role if I must (as in if that is the only way to get this done, then yes). I would prefer to be available as a subject matter expert and let someone else maintain it.

I have only two "safe" suggestions for sqloracle.vim:

1) support for exponential notation in floating point literals.
"[+-]\?\(\(\.\d\+\([eE][+-]\?\d\+\)\)\|\d\+\.\(\d\+\([eE][+-]\?\d\+\)\?\)\)"
 
2) You treat double quoted (") strings as String. These are "names" as in column names and table names that happen to need double quotes and as such should be closer in color to "Normal" than string literal. Not having anything in the list of groups that is a sub-group of "Normal", I chose Character. I know these are not single character literal values, but it was the best I could think of from the choices. I want to be able to assign a color to double quoted string names that is close to "Normal" while having the color for string literals be something much different.

I would prefer to fold plsql.vim into your sqloracle.vim, but there are some fundamental differences in how you classify some oracle keywords plus operators as "Statement" and call other keywords "Special" We could not combine them without seriously breaking backwards compatibility.  Not saying one or the other is right. They are just different.

And this discussion led me to realize I had changed the behavior of plsql.vim in a way I hadn't noticed. plsql.vim treats most SQL keywords as "Function" which as far as I'm concerned is fundamentally broken. These need to be a subcategory of Statement (I'm using Keyword and Statement to differentiate between reserved and non-reserved words but not trying to distinguish sql from plsql keywords at all). There are builtin Oracle functions that need to be classified as Function, but words like SELECT and MERGE do not belong in that list. Sigh.

I can't see breaking backwards compatibility on something that has been around for more than 20 years. Perhaps I need to amend my request to "add a new syntax file?" plsqloracle.vim?

Any thoughts on the right thing to do?

PS
I stole your code for the q-quote operator. Nice job!
But we both still have a flaw for embedded quotes in reqular ' ' strings. These look different:

SELECT 'a string with embedded quote ('')' as regq, q'{a string with embedded quote (')}' as qquote FROM dual;

If/when I fix that, I'll let you know.

lee.l...@gmail.com

unread,
Apr 17, 2022, 3:13:40 PM4/17/22
to vim...@vim.org

The listed maintainer email address for syntax file plsql.vim returns mail as undeliverable and his online presence has not been updated in many years. The syntax file has not kept up with changes to Oracle (19c is now mainstream while syntax file only supports through 9i).

I have an update ( https://github.com/lee-lindley/vim_plsql_syntax ) and demonstrate decent test coverage in my screenshots. I can generate a pull request, but the instructions in CONTRIBUTING.md say to contact the maintainer first.

Please advise.

PS

I don't have a "test" to add per se, but have a sample pl/sql file that exercises much of the trickier syntax parsing I'm interested in.  I'm eyeballing it. If there is a separate document for creating test scripts or examples for coverage checks on syntax files, please point me to it.

I don't particularly want to be the maintainer, but I have the Oracle PL/SQL experience to be a subject matter expert and will do it if nobody else will step up. Being a backup person who the maintainer could reach out to would be my preference.

 

" Vim syntax file

" Language: Oracle Procedureal SQL (PL/SQL)

" Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)

" Original Maintainer: C. Laurence Gonsalves (clgo...@kami.com)

" URL: http://lanzarotta.tripod.com/vim/syntax/plsql.vim.zip

" Last Change: September 18, 2002

" History: Geoff Evans & Bill Pribyl (bill at plnet dot org)

"                            Added 9i keywords.

"                Austin Ziegler (austin at halostatue dot ca)

"                            Added 8i+ features.

 

 

--

Lee Lindley

lee.l...@gmail.com

 

Lee Lindley

unread,
Apr 17, 2022, 4:03:13 PM4/17/22
to vim_dev
Oh gosh. The embedded quote solution turns out to be embarrasingly easy once I read the vim documentation on "region." But this is why I may not be suitable as a maintainer. I really do not know the "vim" programming world very well. OTOH, I know what Oracle SQL and PL/SQL should look like when syntax highlighed.

syn region sqlString    matchgroup=Quote start=+n\?'+  skip=+''+    end=+'+

These legal quoted strings all display correctly in vim with this change:
SELECT 'a string with embedded quote ('')' as regq, q'{a string with embedded quote (')}' as qquote, 'a string ending in a quote ''' as regq_end_quote FROM dual;

Bram Moolenaar

unread,
Apr 17, 2022, 4:37:40 PM4/17/22
to vim...@googlegroups.com, lee.l...@gmail.com, vim...@vim.org

Lee Lindley wrote:

> The listed maintainer email address for syntax file plsql.vim returns mail
> as undeliverable and his online presence has not been updated in many years.
> The syntax file has not kept up with changes to Oracle (19c is now
> mainstream while syntax file only supports through 9i).
> I have an update ( https://github.com/lee-lindley/vim_plsql_syntax ) and
> demonstrate decent test coverage in my screenshots. I can generate a pull
> request, but the instructions in CONTRIBUTING.md say to contact the
> maintainer first.
> Please advise.
> PS
> I don't have a "test" to add per se, but have a sample pl/sql file that
> exercises much of the trickier syntax parsing I'm interested in. I'm
> eyeballing it. If there is a separate document for creating test scripts or
> examples for coverage checks on syntax files, please point me to it.
> I don't particularly want to be the maintainer, but I have the Oracle PL/SQL
> experience to be a subject matter expert and will do it if nobody else will
> step up. Being a backup person who the maintainer could reach out to would
> be my preference.
>
> " Vim syntax file
> " Language: Oracle Procedureal SQL (PL/SQL)
> " Maintainer: Jeff Lanzarotta (jefflanzarotta at yahoo dot com)
> " Original Maintainer: C. Laurence Gonsalves (clgo...@kami.com
> <mailto:clgo...@kami.com> )
> " URL: http://lanzarotta.tripod.com/vim/syntax/plsql.vim.zip
> " Last Change: September 18, 2002
> " History: Geoff Evans & Bill Pribyl (bill at plnet dot org)
> " Added 9i keywords.
> " Austin Ziegler (austin at halostatue dot ca)
> " Added 8i+ features.

Since the listed maintainer is not responding, please do send me the
updated version of the file.

If you do not want to be listed as the maintainer, please update the
header to change "Maintainer" to "Previous Maintainer", add "Maintaner:
vacancy" and add "Last Update" with your info. That should best reflect
the situation.

--
hundred-and-one symptoms of being an internet addict:
17. You turn on your intercom when leaving the room so you can hear if new
e-mail arrives.

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

Lee Lindley

unread,
Apr 17, 2022, 5:18:45 PM4/17/22
to vim_dev
acknowledged. Thanks Bram.

Lee Lindley

unread,
Apr 19, 2022, 5:39:09 PM4/19/22
to vim_dev
Bram,

I stopped squirming and will cowboy up as the maintainer. If someone who is more in-tune with the vim API wants to take over, I will stand aside.

You said "send me the updated version of the file". You can retrieve it from:

https://github.com/lee-lindley/vim_plsql_syntax/blob/main/syntax/plsql.vim

which is tagged as "r1.0" in my github repository. There is a README.md, test file, and screenshots in that repository as well.

If you meant to literally send you the file, as in attach a zip, or if you meant to fork vim and send you a pull request, please let me know. I'm happy to do whatever is required.

Thanks and regards,

Lee

Bram Moolenaar

unread,
Apr 20, 2022, 8:59:09 AM4/20/22
to vim...@googlegroups.com, Lee Lindley

Lee Lindley wrote:

> I stopped squirming and will cowboy up as the maintainer. If someone who is
> more in-tune with the vim API wants to take over, I will stand aside.
>
> You said "send me the updated version of the file". You can retrieve it
> from:
>
> https://github.com/lee-lindley/vim_plsql_syntax/blob/main/syntax/plsql.vim
>
> which is tagged as "r1.0" in my github repository. There is a README.md,
> test file, and screenshots in that repository as well.

Thanks. I'll grab the file from there this time. You link to the
github repository, so the other files can be found that way, we don't
normally include this in the distribution.

One thing you need to fix: since line continuation is used, you need to
save and set the 'cpo' option. See other syntax files for examples.

> If you meant to literally send you the file, as in attach a zip, or if you
> meant to fork vim and send you a pull request, please let me know. I'm
> happy to do whatever is required.

Next time it would be good if you can make a PR, then I'm sure I don't
get different versions mixed up.

--
How To Keep A Healthy Level Of Insanity:
17. When the money comes out the ATM, scream "I won!, I won! 3rd
time this week!!!!!"

Lee Lindley

unread,
Apr 20, 2022, 9:47:35 AM4/20/22
to vim_dev
Added the cpo option the way it is recommended, resetting it at the end as was done in ruby.vim. Thanks much for pointing that out.

I know how to create a Pull Request and will do so. No need for you to grab the file. 
Now that I know the process, I may hold off until I can figure out folding. Not like there is any urgency. The existing one was last changed in 2002 according to the comment header.

Thanks and Regards,

Lee

Bram Moolenaar

unread,
Apr 20, 2022, 1:43:44 PM4/20/22
to vim...@googlegroups.com, Lee Lindley

Lee Lindley wrote:

> Added the cpo option the way it is recommended, resetting it at the end as
> was done in ruby.vim. Thanks much for pointing that out.
>
> I know how to create a Pull Request and will do so. No need for you to grab
> the file.
> Now that I know the process, I may hold off until I can figure out folding.
> Not like there is any urgency. The existing one was last changed in 2002
> according to the comment header.

Sure, no need to hurry. However, I do hope to finally release Vim9, and
should start a feature freeze in a few weeks.

--
Now it is such a bizarrely improbable coincidence that anything as
mind-bogglingly useful as the Babel fish could have evolved purely by chance
that some thinkers have chosen to see it as a final and clinching proof of the
NON-existence of God.
The argument goes something like this: 'I refuse to prove that I exist,' says
God, 'for proof denies faith, and without faith I am nothing.'
'But,' says Man, 'the Babel fish is a dead giveaway, isn't it? It could not
have evolved by chance. It proves you exist, and so therefore, by your own
arguments, you don't. QED.'
'Oh dear,' says God, 'I hadn't thought of that,' and promptly vanishes in a
puff of logic.
'Oh, that was easy,' says Man, and for an encore goes on to prove that black
is white and gets himself killed on the next pedestrian crossing.
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
Reply all
Reply to author
Forward
0 new messages