Bug 850868 - [RFE] BeakerLib syntax highlight for vim
[RFE] BeakerLib syntax highlight for vim
Product: Fedora
Classification: Fedora
Component: beakerlib (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Petr Muller
Fedora Extras Quality Assurance
: FutureFeature
Depends On:
Blocks: Fedora-beakerlib-1.9-3 1116317
  Show dependency treegraph
Reported: 2012-08-22 11:10 EDT by Filip Holec
Modified: 2016-09-19 22:09 EDT (History)
3 users (show)

See Also:
Fixed In Version: beakerlib-1.9-3.fc20
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
: 984657 (view as bug list)
Last Closed: 2014-07-30 02:57:08 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

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

  None (edit)
Description Filip Holec 2012-08-22 11:10:16 EDT
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 14:07:50 EDT
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 05:42:54 EDT
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 07:34:49 EDT
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 07:19:30 EST
Still do not know how to do this :(
Comment 5 Petr Muller 2013-07-15 12:03:07 EDT
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.

Comment 6 Fedora Update System 2014-06-17 09:41:29 EDT
beakerlib-1.9-1.fc20 has been submitted as an update for Fedora 20.
Comment 7 Fedora Update System 2014-06-17 19:29:00 EDT
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:
then log in and leave karma (feedback).
Comment 8 Fedora Update System 2014-07-02 04:01:09 EDT
beakerlib-1.9-2.fc20 has been submitted as an update for Fedora 20.
Comment 9 Dalibor Pospíšil 2014-07-04 04:50:59 EDT
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:
Comment 10 Fedora Update System 2014-07-17 09:15:36 EDT
beakerlib-1.9-3.fc20 has been submitted as an update for Fedora 20.
Comment 11 Fedora Update System 2014-07-30 02:57:08 EDT
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.