Editors for ProB: Difference between revisions

 
(5 intermediate revisions by the same user not shown)
Line 23: Line 23:
A [https://github.com/bivab/prob.vim VIM plugin for ProB is available].
A [https://github.com/bivab/prob.vim VIM plugin for ProB is available].
It shows a quick fix list of parse and type errors for classical B machines (.mch) using the [[Using_the_Command-Line_Version_of_ProB|command line tool probcli]]. VIM has builtin syntax highlighting support for [https://github.com/vim/vim/blob/master/runtime/syntax/b.vim B].
It shows a quick fix list of parse and type errors for classical B machines (.mch) using the [[Using_the_Command-Line_Version_of_ProB|command line tool probcli]]. VIM has builtin syntax highlighting support for [https://github.com/vim/vim/blob/master/runtime/syntax/b.vim B].
=== VSCode ===
There is a package called  [https://github.com/hhu-stups/b-language-extension B/ProB Language Support] available for the VSCode editor.
It adds syntax highlighting and snippets for the specification languages B and Event-B to VSCode.
It integrates with probcli to obtain error markers for syntax and type errors. It can also be used for [[Well-Definedness_Checking#VSCode|well-definedness checking]].


=== Atom ===
=== Atom ===
Line 29: Line 34:
It adds syntax highlighting and snippets for the specification languages B and Event-B to Atom.
It adds syntax highlighting and snippets for the specification languages B and Event-B to Atom.
It integrates with probcli to obtain error markers for syntax and type errors.
It integrates with probcli to obtain error markers for syntax and type errors.
With the Atom plugin you can now also visualize WD (well-definedness) issues in your B machines. See [https://youtu.be/td7CKFkAvaw this small demo video].
Note that Atom is no longer being updated as of [https://github.blog/2022-06-08-sunsetting-atom/ December 2022].


=== BBEdit ===
=== BBEdit ===

Latest revision as of 12:03, 4 March 2024

ProB Tcl/Tk Editor

ProB Tcl/Tk contains an editor in which syntax errors are displayed and which can be used to edit B, CSP, Z and TLA+ models. The editor of Tcl/Tk, however, has a few limitations:

  • it can become very slow with long or very long lines
  • the syntax highlighting can become slow with very large files. Hence, syntax highlighting is automatically turned off in some circumstances (when more than 50,000 characters are encountered or when a line is longer than 500 characters).

It is possible to open the files in an external editor. You can setup the editor to be used by modifying the preference "Path to External Text Editor" in the "Advanced Preferences" list (available in the "Preferences" menu). You can then use the command "Open FILE in external editor" in the "File" menu to open your main specification file with this editor. You can also use the command-key shortcut "Cmd-E" for this.

Launching the editor in probcli

The probcli REPL (read-eval-print-loop) supports the command :e to open the current file in the external editor, as specified in the "EDITOR" preference. You can set this preference using

probcli -repl -p EDITOR PATH

In case errors occurred with the last command, this will also try and move the cursor to the corresponding location in the file.

External Editors

VIM

A VIM plugin for ProB is available. It shows a quick fix list of parse and type errors for classical B machines (.mch) using the command line tool probcli. VIM has builtin syntax highlighting support for B.

VSCode

There is a package called B/ProB Language Support available for the VSCode editor. It adds syntax highlighting and snippets for the specification languages B and Event-B to VSCode. It integrates with probcli to obtain error markers for syntax and type errors. It can also be used for well-definedness checking.

Atom

There is a package language-b-eventb available for the Atom editor. It adds syntax highlighting and snippets for the specification languages B and Event-B to Atom. It integrates with probcli to obtain error markers for syntax and type errors.

With the Atom plugin you can now also visualize WD (well-definedness) issues in your B machines. See this small demo video.

Note that Atom is no longer being updated as of December 2022.

BBEdit

Some BBedit Language modules for B, TLA+, CSP and Prolog are available.

Emacs

A package File:B-mode.el.zip is available.