Module: Ruber::SyntaxChecker

Defined in:
plugins/syntax_checker/syntax_checker.rb,
plugins/syntax_checker/syntax_checker.rb

Overview

Module for the Syntax checker plugin.

This plugin provides a framework to let the user know whether the file in the current editor view is syntactically correct or not (according to the most appropriate sytnax for that kind of file). The result of the syntax check is displayed in a widget at the right end of the status bar (this will be referred to as the *syntax result widget). This implementation of the syntax_checker feature uses a KDE::Led whose colour changes according to the result of the syntax check, but other plugins may use other widgets. If the user right clikcs on the widget, a menu showing a list of syntax errors is displayed. Clicking on it will jump to the corresponding like, while clicking on the widget itself jumps to the line corresponding to the first error.

The syntax check is run every time the file is activated or saved and the user can choose to have it run automatically when one second has passed since he last edited the file. The reasoning is that it makes little sense to check the syntax while the user is writing text: it will most likely be wrong (because the user hasn’t finished writing what he wants), may quickly change from valid to invalid depending on the point the user has reached in writing, and the user won’t look at it because he’s busy writing.

The kind of syntax check to perform on a document is decided according to the mimetype of the document (this means that only documents associated with a file can be syntax-checked). Currently, this plugin contains syntax checkers for ruby files and YAML files, but syntax checkers for other kind of files can be added by other plugins (see the documentation for register_syntax_checker for details)

syntax checks after one second of inactivity

API for feature syntax_checker

Plugin object API

See API for Plugin

Global Settings

syntax_checker/automatic_check – Boolean
Whether to perform automatic

Defined Under Namespace

Classes: ConfigWidget, Extension, Plugin, RubySyntaxChecker, SyntaxCheckerExtension, SyntaxCheckerPlugin, SyntaxError, SyntaxNotChecked, SyntaxResultWidget, YamlSyntaxChecker