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

branch
Py2 comp.
changeset 3456
96232974dcdb
child 3525
66f4b8646622
equal deleted inserted replaced
3178:f25fc1364c88 3456:96232974dcdb
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric5.Plugins.CheckerPlugins.SyntaxChecker.SyntaxCheckService</h1>
23 <p>
24 Module implementing an interface to add different languages to do a syntax
25 check.
26 </p>
27 <h3>Global Attributes</h3>
28 <table>
29 <tr><td>None</td></tr>
30 </table>
31 <h3>Classes</h3>
32 <table>
33 <tr>
34 <td><a href="#SyntaxCheckService">SyntaxCheckService</a></td>
35 <td>Implement the syntax check service.</td>
36 </tr>
37 </table>
38 <h3>Functions</h3>
39 <table>
40 <tr><td>None</td></tr>
41 </table>
42 <hr /><hr />
43 <a NAME="SyntaxCheckService" ID="SyntaxCheckService"></a>
44 <h2>SyntaxCheckService</h2>
45 <p>
46 Implement the syntax check service.
47 </p><p>
48 Plugins can add other languages to the syntax check by calling addLanguage
49 and support of an extra checker module on the client side which has to
50 connect directly to the background service.
51 </p><h3>Signals</h3>
52 <dl>
53 <dt>syntaxChecked(str, dict)</dt>
54 <dd>
55 emited when the syntax check was done.
56 </dd>
57 </dl>
58 <h3>Derived from</h3>
59 QObject
60 <h3>Class Attributes</h3>
61 <table>
62 <tr><td>None</td></tr>
63 </table>
64 <h3>Class Methods</h3>
65 <table>
66 <tr><td>None</td></tr>
67 </table>
68 <h3>Methods</h3>
69 <table>
70 <tr>
71 <td><a href="#SyntaxCheckService.__init__">SyntaxCheckService</a></td>
72 <td>Contructor of SyntaxCheckService.</td>
73 </tr><tr>
74 <td><a href="#SyntaxCheckService.__determineLanguage">__determineLanguage</a></td>
75 <td>Private methode to determine the language of the file.</td>
76 </tr><tr>
77 <td><a href="#SyntaxCheckService.addLanguage">addLanguage</a></td>
78 <td>Register the new language to the supported languages.</td>
79 </tr><tr>
80 <td><a href="#SyntaxCheckService.getExtensions">getExtensions</a></td>
81 <td>Return all supported file extensions for the syntax checker dialog.</td>
82 </tr><tr>
83 <td><a href="#SyntaxCheckService.getLanguages">getLanguages</a></td>
84 <td>Return the supported language names.</td>
85 </tr><tr>
86 <td><a href="#SyntaxCheckService.removeLanguage">removeLanguage</a></td>
87 <td>Remove the language from syntax check.</td>
88 </tr><tr>
89 <td><a href="#SyntaxCheckService.syntaxCheck">syntaxCheck</a></td>
90 <td>Method to prepare to compile one Python source file to Python bytecode and to perform a pyflakes check in another task.</td>
91 </tr>
92 </table>
93 <h3>Static Methods</h3>
94 <table>
95 <tr><td>None</td></tr>
96 </table>
97 <a NAME="SyntaxCheckService.__init__" ID="SyntaxCheckService.__init__"></a>
98 <h4>SyntaxCheckService (Constructor)</h4>
99 <b>SyntaxCheckService</b>(<i></i>)
100 <p>
101 Contructor of SyntaxCheckService.
102 </p><a NAME="SyntaxCheckService.__determineLanguage" ID="SyntaxCheckService.__determineLanguage"></a>
103 <h4>SyntaxCheckService.__determineLanguage</h4>
104 <b>__determineLanguage</b>(<i>filename, source</i>)
105 <p>
106 Private methode to determine the language of the file.
107 </p><dl>
108 <dt><i>filename</i></dt>
109 <dd>
110 of the sourcefile (str)
111 </dd><dt><i>source</i></dt>
112 <dd>
113 code of the file (str)
114 </dd>
115 </dl><dl>
116 <dt>Returns:</dt>
117 <dd>
118 language of the file or None if not found (str or None)
119 </dd>
120 </dl><a NAME="SyntaxCheckService.addLanguage" ID="SyntaxCheckService.addLanguage"></a>
121 <h4>SyntaxCheckService.addLanguage</h4>
122 <b>addLanguage</b>(<i>lang, path, module, getArgs, getExt, callback, onError</i>)
123 <p>
124 Register the new language to the supported languages.
125 </p><dl>
126 <dt><i>lang</i></dt>
127 <dd>
128 new language to check syntax (str)
129 </dd><dt><i>path</i></dt>
130 <dd>
131 full path to the module (str)
132 </dd><dt><i>module</i></dt>
133 <dd>
134 name to import (str)
135 </dd><dt><i>getArgs</i></dt>
136 <dd>
137 function to collect the required arguments to call the
138 syntax checker on client side (function)
139 </dd><dt><i>getExt</i></dt>
140 <dd>
141 function that returns the supported file extensions of
142 the syntax checker (function)
143 </dd><dt><i>callback</i></dt>
144 <dd>
145 function on service response (function)
146 </dd><dt><i>onError</i></dt>
147 <dd>
148 callback function if client or service isn't available
149 (function)
150 </dd>
151 </dl><a NAME="SyntaxCheckService.getExtensions" ID="SyntaxCheckService.getExtensions"></a>
152 <h4>SyntaxCheckService.getExtensions</h4>
153 <b>getExtensions</b>(<i></i>)
154 <p>
155 Return all supported file extensions for the syntax checker dialog.
156 </p><dl>
157 <dt>Returns:</dt>
158 <dd>
159 set of all supported file extensions (set of str)
160 </dd>
161 </dl><a NAME="SyntaxCheckService.getLanguages" ID="SyntaxCheckService.getLanguages"></a>
162 <h4>SyntaxCheckService.getLanguages</h4>
163 <b>getLanguages</b>(<i></i>)
164 <p>
165 Return the supported language names.
166 </p><dl>
167 <dt>Returns:</dt>
168 <dd>
169 list of languanges supported (list of str)
170 </dd>
171 </dl><a NAME="SyntaxCheckService.removeLanguage" ID="SyntaxCheckService.removeLanguage"></a>
172 <h4>SyntaxCheckService.removeLanguage</h4>
173 <b>removeLanguage</b>(<i>lang</i>)
174 <p>
175 Remove the language from syntax check.
176 </p><dl>
177 <dt><i>lang</i></dt>
178 <dd>
179 language to remove (str)
180 </dd>
181 </dl><a NAME="SyntaxCheckService.syntaxCheck" ID="SyntaxCheckService.syntaxCheck"></a>
182 <h4>SyntaxCheckService.syntaxCheck</h4>
183 <b>syntaxCheck</b>(<i>lang, filename, source</i>)
184 <p>
185 Method to prepare to compile one Python source file to Python bytecode
186 and to perform a pyflakes check in another task.
187 </p><dl>
188 <dt><i>lang</i></dt>
189 <dd>
190 language of the file or None to determine by internal
191 algorithm (str or None)
192 </dd><dt><i>filename</i></dt>
193 <dd>
194 source filename (string)
195 </dd><dt><i>source</i></dt>
196 <dd>
197 string containing the code to check (string)
198 </dd>
199 </dl>
200 <div align="right"><a href="#top">Up</a></div>
201 <hr />
202 </body></html>

eric ide

mercurial