Documentation/Source/eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService.html

Mon, 21 Apr 2014 19:20:27 +0200

author
T.Rzepka <Tobias.Rzepka@gmail.com>
date
Mon, 21 Apr 2014 19:20:27 +0200
branch
Py2 comp.
changeset 3525
66f4b8646622
parent 3456
96232974dcdb
child 3591
2f2a4a76dd22
permissions
-rw-r--r--

Reintegrated the js syntax checker and therefore improved the background service a little.

<!DOCTYPE html>
<html><head>
<title>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</title>
<meta charset="UTF-8">
<style>
body {
    background: #EDECE6;
    margin: 0em 1em 10em 1em;
    color: black;
}

h1 { color: white; background: #85774A; }
h2 { color: white; background: #85774A; }
h3 { color: white; background: #9D936E; }
h4 { color: white; background: #9D936E; }
    
a { color: #BA6D36; }

</style>
</head>
<body><a NAME="top" ID="top"></a>
<h1>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</h1>
<p>
Module implementing an interface to add different languages to do a syntax
check.
</p>
<h3>Global Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Classes</h3>
<table>
<tr>
<td><a href="#SyntaxCheckService">SyntaxCheckService</a></td>
<td>Implement the syntax check service.</td>
</tr>
</table>
<h3>Functions</h3>
<table>
<tr><td>None</td></tr>
</table>
<hr /><hr />
<a NAME="SyntaxCheckService" ID="SyntaxCheckService"></a>
<h2>SyntaxCheckService</h2>
<p>
    Implement the syntax check service.
</p><p>
    Plugins can add other languages to the syntax check by calling addLanguage
    and support of an extra checker module on the client side which has to
    connect directly to the background service.
</p><h3>Signals</h3>
<dl>
<dt>syntaxChecked(str, dict)</dt>
<dd>
emited when the syntax check was done.
</dd>
</dl>
<h3>Derived from</h3>
QObject
<h3>Class Attributes</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Class Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<h3>Methods</h3>
<table>
<tr>
<td><a href="#SyntaxCheckService.__init__">SyntaxCheckService</a></td>
<td>Contructor of SyntaxCheckService.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.__determineLanguage">__determineLanguage</a></td>
<td>Private methode to determine the language of the file.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.addLanguage">addLanguage</a></td>
<td>Register the new language to the supported languages.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.getExtensions">getExtensions</a></td>
<td>Return all supported file extensions for the syntax checker dialog.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.getLanguages">getLanguages</a></td>
<td>Return the supported language names.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.removeLanguage">removeLanguage</a></td>
<td>Remove the language from syntax check.</td>
</tr><tr>
<td><a href="#SyntaxCheckService.syntaxCheck">syntaxCheck</a></td>
<td>Method to prepare to compile one Python source file to Python bytecode and to perform a pyflakes check in another task.</td>
</tr>
</table>
<h3>Static Methods</h3>
<table>
<tr><td>None</td></tr>
</table>
<a NAME="SyntaxCheckService.__init__" ID="SyntaxCheckService.__init__"></a>
<h4>SyntaxCheckService (Constructor)</h4>
<b>SyntaxCheckService</b>(<i></i>)
<p>
        Contructor of SyntaxCheckService.
</p><a NAME="SyntaxCheckService.__determineLanguage" ID="SyntaxCheckService.__determineLanguage"></a>
<h4>SyntaxCheckService.__determineLanguage</h4>
<b>__determineLanguage</b>(<i>filename, source</i>)
<p>
        Private methode to determine the language of the file.
</p><dl>
<dt><i>filename</i></dt>
<dd>
of the sourcefile (str)
</dd><dt><i>source</i></dt>
<dd>
code of the file (str)
</dd>
</dl><dl>
<dt>Returns:</dt>
<dd>
language of the file or None if not found (str or None)
</dd>
</dl><a NAME="SyntaxCheckService.addLanguage" ID="SyntaxCheckService.addLanguage"></a>
<h4>SyntaxCheckService.addLanguage</h4>
<b>addLanguage</b>(<i>lang, env, path, module, getArgs, getExt, callback, onError</i>)
<p>
        Register the new language to the supported languages.
</p><dl>
<dt><i>lang</i></dt>
<dd>
new language to check syntax (str)
</dd><dt><i>env</i></dt>
<dd>
the environment in which the checker is implemented (str)
</dd><dt><i>path</i></dt>
<dd>
full path to the module (str)
</dd><dt><i>module</i></dt>
<dd>
name to import (str)
</dd><dt><i>getArgs</i></dt>
<dd>
function to collect the required arguments to call the
            syntax checker on client side (function)
</dd><dt><i>getExt</i></dt>
<dd>
function that returns the supported file extensions of
            the syntax checker (function)
</dd><dt><i>callback</i></dt>
<dd>
function on service response (function)
</dd><dt><i>onError</i></dt>
<dd>
callback function if client or service isn't available
            (function)
</dd>
</dl><a NAME="SyntaxCheckService.getExtensions" ID="SyntaxCheckService.getExtensions"></a>
<h4>SyntaxCheckService.getExtensions</h4>
<b>getExtensions</b>(<i></i>)
<p>
        Return all supported file extensions for the syntax checker dialog.
</p><dl>
<dt>Returns:</dt>
<dd>
set of all supported file extensions (set of str)
</dd>
</dl><a NAME="SyntaxCheckService.getLanguages" ID="SyntaxCheckService.getLanguages"></a>
<h4>SyntaxCheckService.getLanguages</h4>
<b>getLanguages</b>(<i></i>)
<p>
        Return the supported language names.
</p><dl>
<dt>Returns:</dt>
<dd>
list of languanges supported (list of str)
</dd>
</dl><a NAME="SyntaxCheckService.removeLanguage" ID="SyntaxCheckService.removeLanguage"></a>
<h4>SyntaxCheckService.removeLanguage</h4>
<b>removeLanguage</b>(<i>lang</i>)
<p>
        Remove the language from syntax check.
</p><dl>
<dt><i>lang</i></dt>
<dd>
language to remove (str)
</dd>
</dl><a NAME="SyntaxCheckService.syntaxCheck" ID="SyntaxCheckService.syntaxCheck"></a>
<h4>SyntaxCheckService.syntaxCheck</h4>
<b>syntaxCheck</b>(<i>lang, filename, source</i>)
<p>
        Method to prepare to compile one Python source file to Python bytecode
        and to perform a pyflakes check in another task.
</p><dl>
<dt><i>lang</i></dt>
<dd>
language of the file or None to determine by internal
            algorithm (str or None)
</dd><dt><i>filename</i></dt>
<dd>
source filename (string)
</dd><dt><i>source</i></dt>
<dd>
string containing the code to check (string)
</dd>
</dl>
<div align="right"><a href="#top">Up</a></div>
<hr />
</body></html>

eric ide

mercurial