Bug 850868 - [RFE] BeakerLib syntax highlight for vim
Summary: [RFE] BeakerLib syntax highlight for vim
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: beakerlib
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Muller
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Fedora-beakerlib-1.9-3 1116317
TreeView+ depends on / blocked
 
Reported: 2012-08-22 15:10 UTC by Filip Holec
Modified: 2016-09-20 02:09 UTC (History)
3 users (show)

Fixed In Version: beakerlib-1.9-3.fc20
Doc Type: Enhancement
Doc Text:
Clone Of:
: 984657 (view as bug list)
Environment:
Last Closed: 2014-07-30 06:57:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
file for BeakerLib highlighting in vim (1.62 KB, application/octet-stream)
2012-08-22 15:10 UTC, Filip Holec
no flags Details

Description Filip Holec 2012-08-22 15:10:16 UTC
Created attachment 606308 [details]
file for BeakerLib highlighting in vim

BeakerLib syntax highlighting for vim is an enhancement for more comfortable work with this shell-level integration testing library. 

Syntax is now highlighted with green color, however, it can be optimized by modifying provided file. 

Installation is quite easy:
1. download file sh.vim to your computer
2. set user to root
3. move it to /usr/share/vim/vimfiles/after/syntax/

BeakerLib highlight feature will be active only if the extension of the file is *.sh

Any ideas ?

Comment 1 Petr Šplíchal 2012-08-22 18:07:50 UTC
Nice, thanks for providing the patch! It would be great to have
this working out-of-the box after installing beakerlib. Could we
just include /usr/share/vim/vimfiles/after/syntax/sh.vim in
beakerlib? Not sure whether vim supports naming of these "after"
files which would prevent name clashes.

Last note: I've noticed that the suggested syntax file does not
highlight beakerlib commands inside function definitions, e.g.

> fun() {
>     rlRun "does not work here"
> }
> 
> rlJournalStart
>     rlPhaseStartTest
>         rlAssertExists "foo"
>         rlRun "works here"
>     rlPhaseEnd
> rlJournalPrintText
> rlJournalEnd

Comment 2 Petr Muller 2012-08-23 09:42:54 UTC
Wonderful. Really. Thanks!

(In reply to comment #1)
> Nice, thanks for providing the patch! It would be great to have
> this working out-of-the box after installing beakerlib. Could we
> just include /usr/share/vim/vimfiles/after/syntax/sh.vim in
> beakerlib? Not sure whether vim supports naming of these "after"
> files which would prevent name clashes.

I would really like do that if possible. While a vim user myself, I'm not really familiar how the syn-high machinery work. Is it possible to somehow distinguish that from the other possible sh.vim highlighters, for examply by grepping for rlJournalStart, some tag in the file, or something similar? If something like that and a rename of the file is possible, that would allow me to put the file into the RPM directly.

The second issue I see is that by installing this file directly we would probably need to depend on vim so that the directory to install actually exists. But that can probably be solved by creating a subpackage, which would be installed on Beaker boxes by default.

Comment 3 Petr Šplíchal 2012-08-30 11:34:49 UTC
Another option is to enable highlighting in user's vimrc:

    autocmd FileType sh match Type 'rl[A-Z][^ ]*'

However, I too would prefer to have it packed in the rpm.

Comment 4 Petr Muller 2013-01-08 12:19:30 UTC
Still do not know how to do this :(

Comment 5 Petr Muller 2013-07-15 16:03:07 UTC
I think I managed to do this using more vim machinery... I have introduced new 'beakerlib' filetype, which is set on a *.sh file if the first 100 lines contain some often used BL function. A syntax highlight then loads the common *.sh highlight and applies Filip's work onto it.

But as I do not want BL to depend on vim-common, the syntax highlight needs to be in a subpackage.

https://git.fedorahosted.org/cgit/beakerlib.git/commit/?id=5d65632a2c76d2769fbde7eefa5e5702beb39405
http://git.engineering.redhat.com/?p=users/pmuller/beakerlib-rhel.git;a=commit;h=1dca362d88de3c1bafda4fdf0aea4bb057f04f7c

Comment 6 Fedora Update System 2014-06-17 13:41:29 UTC
beakerlib-1.9-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-1.fc20

Comment 7 Fedora Update System 2014-06-17 23:29:00 UTC
Package beakerlib-1.9-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing beakerlib-1.9-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-7442/beakerlib-1.9-1.fc20
then log in and leave karma (feedback).

Comment 8 Fedora Update System 2014-07-02 08:01:09 UTC
beakerlib-1.9-2.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-2.fc20

Comment 9 Dalibor Pospíšil 2014-07-04 08:50:59 UTC
Please consider the package fixing this bug available in Fedora stable repos once bz1116308 is closed and RHEL stable repos once bz1116317 is closed.

Fixed in:
beakerlib-1.9-2.fc19
beakerlib-1.9-2.fc20
beakerlib-1.9-2.fc21
beakerlib-1.9-3.el5
beakerlib-1.9-2.el6
beakerlib-1.9-2.el7

Comment 10 Fedora Update System 2014-07-17 13:15:36 UTC
beakerlib-1.9-3.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/beakerlib-1.9-3.fc20

Comment 11 Fedora Update System 2014-07-30 06:57:08 UTC
beakerlib-1.9-3.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.