|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric6.Plugins.PluginSyntaxChecker</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>eric6.Plugins.PluginSyntaxChecker</h1> |
|
23 <p> |
|
24 Module implementing the Syntax Checker plugin. |
|
25 </p> |
|
26 <h3>Global Attributes</h3> |
|
27 <table> |
|
28 <tr><td>author</td></tr><tr><td>autoactivate</td></tr><tr><td>className</td></tr><tr><td>deactivateable</td></tr><tr><td>error</td></tr><tr><td>longDescription</td></tr><tr><td>name</td></tr><tr><td>packageName</td></tr><tr><td>pyqtApi</td></tr><tr><td>python2Compatible</td></tr><tr><td>shortDescription</td></tr><tr><td>version</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 <table> |
|
32 <tr> |
|
33 <td><a href="#SyntaxCheckerPlugin">SyntaxCheckerPlugin</a></td> |
|
34 <td>Class implementing the Syntax Checker plugin.</td> |
|
35 </tr> |
|
36 </table> |
|
37 <h3>Functions</h3> |
|
38 <table> |
|
39 <tr><td>None</td></tr> |
|
40 </table> |
|
41 <hr /><hr /> |
|
42 <a NAME="SyntaxCheckerPlugin" ID="SyntaxCheckerPlugin"></a> |
|
43 <h2>SyntaxCheckerPlugin</h2> |
|
44 <p> |
|
45 Class implementing the Syntax Checker plugin. |
|
46 </p> |
|
47 <h3>Derived from</h3> |
|
48 QObject |
|
49 <h3>Class Attributes</h3> |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Class Methods</h3> |
|
54 <table> |
|
55 <tr><td>None</td></tr> |
|
56 </table> |
|
57 <h3>Methods</h3> |
|
58 <table> |
|
59 <tr> |
|
60 <td><a href="#SyntaxCheckerPlugin.__init__">SyntaxCheckerPlugin</a></td> |
|
61 <td>Constructor</td> |
|
62 </tr><tr> |
|
63 <td><a href="#SyntaxCheckerPlugin.__editorClosed">__editorClosed</a></td> |
|
64 <td>Private slot called, when an editor was closed.</td> |
|
65 </tr><tr> |
|
66 <td><a href="#SyntaxCheckerPlugin.__editorOpened">__editorOpened</a></td> |
|
67 <td>Private slot called, when a new editor was opened.</td> |
|
68 </tr><tr> |
|
69 <td><a href="#SyntaxCheckerPlugin.__editorShowMenu">__editorShowMenu</a></td> |
|
70 <td>Private slot called, when the the editor context menu or a submenu is about to be shown.</td> |
|
71 </tr><tr> |
|
72 <td><a href="#SyntaxCheckerPlugin.__editorSyntaxCheck">__editorSyntaxCheck</a></td> |
|
73 <td>Private slot to handle the syntax check context menu action of the editors.</td> |
|
74 </tr><tr> |
|
75 <td><a href="#SyntaxCheckerPlugin.__getPythonOptions">__getPythonOptions</a></td> |
|
76 <td>Private methode to determine the syntax check options.</td> |
|
77 </tr><tr> |
|
78 <td><a href="#SyntaxCheckerPlugin.__initialize">__initialize</a></td> |
|
79 <td>Private slot to (re)initialize the plugin.</td> |
|
80 </tr><tr> |
|
81 <td><a href="#SyntaxCheckerPlugin.__projectBrowserShowMenu">__projectBrowserShowMenu</a></td> |
|
82 <td>Private slot called, when the the project browser menu or a submenu is about to be shown.</td> |
|
83 </tr><tr> |
|
84 <td><a href="#SyntaxCheckerPlugin.__projectBrowserSyntaxCheck">__projectBrowserSyntaxCheck</a></td> |
|
85 <td>Private method to handle the syntax check context menu action of the project sources browser.</td> |
|
86 </tr><tr> |
|
87 <td><a href="#SyntaxCheckerPlugin.__projectShowMenu">__projectShowMenu</a></td> |
|
88 <td>Private slot called, when the the project menu or a submenu is about to be shown.</td> |
|
89 </tr><tr> |
|
90 <td><a href="#SyntaxCheckerPlugin.__projectSyntaxCheck">__projectSyntaxCheck</a></td> |
|
91 <td>Private slot used to check the project files for syntax errors.</td> |
|
92 </tr><tr> |
|
93 <td><a href="#SyntaxCheckerPlugin.__serviceError">__serviceError</a></td> |
|
94 <td>Private slot handling service errors.</td> |
|
95 </tr><tr> |
|
96 <td><a href="#SyntaxCheckerPlugin.__translateSyntaxCheck">__translateSyntaxCheck</a></td> |
|
97 <td>Private slot to translate the resulting messages.</td> |
|
98 </tr><tr> |
|
99 <td><a href="#SyntaxCheckerPlugin.activate">activate</a></td> |
|
100 <td>Public method to activate this plugin.</td> |
|
101 </tr><tr> |
|
102 <td><a href="#SyntaxCheckerPlugin.deactivate">deactivate</a></td> |
|
103 <td>Public method to deactivate this plugin.</td> |
|
104 </tr><tr> |
|
105 <td><a href="#SyntaxCheckerPlugin.serviceErrorJavaScript">serviceErrorJavaScript</a></td> |
|
106 <td>Public method handling service errors for JavaScript.</td> |
|
107 </tr><tr> |
|
108 <td><a href="#SyntaxCheckerPlugin.serviceErrorPy2">serviceErrorPy2</a></td> |
|
109 <td>Public method handling service errors for Python 2.</td> |
|
110 </tr><tr> |
|
111 <td><a href="#SyntaxCheckerPlugin.serviceErrorPy3">serviceErrorPy3</a></td> |
|
112 <td>Public method handling service errors for Python 2.</td> |
|
113 </tr> |
|
114 </table> |
|
115 <h3>Static Methods</h3> |
|
116 <table> |
|
117 <tr><td>None</td></tr> |
|
118 </table> |
|
119 <a NAME="SyntaxCheckerPlugin.__init__" ID="SyntaxCheckerPlugin.__init__"></a> |
|
120 <h4>SyntaxCheckerPlugin (Constructor)</h4> |
|
121 <b>SyntaxCheckerPlugin</b>(<i>ui</i>) |
|
122 <p> |
|
123 Constructor |
|
124 </p><dl> |
|
125 <dt><i>ui</i></dt> |
|
126 <dd> |
|
127 reference to the user interface object (UI.UserInterface) |
|
128 </dd> |
|
129 </dl><a NAME="SyntaxCheckerPlugin.__editorClosed" ID="SyntaxCheckerPlugin.__editorClosed"></a> |
|
130 <h4>SyntaxCheckerPlugin.__editorClosed</h4> |
|
131 <b>__editorClosed</b>(<i>editor</i>) |
|
132 <p> |
|
133 Private slot called, when an editor was closed. |
|
134 </p><dl> |
|
135 <dt><i>editor</i></dt> |
|
136 <dd> |
|
137 reference to the editor (QScintilla.Editor) |
|
138 </dd> |
|
139 </dl><a NAME="SyntaxCheckerPlugin.__editorOpened" ID="SyntaxCheckerPlugin.__editorOpened"></a> |
|
140 <h4>SyntaxCheckerPlugin.__editorOpened</h4> |
|
141 <b>__editorOpened</b>(<i>editor</i>) |
|
142 <p> |
|
143 Private slot called, when a new editor was opened. |
|
144 </p><dl> |
|
145 <dt><i>editor</i></dt> |
|
146 <dd> |
|
147 reference to the new editor (QScintilla.Editor) |
|
148 </dd> |
|
149 </dl><a NAME="SyntaxCheckerPlugin.__editorShowMenu" ID="SyntaxCheckerPlugin.__editorShowMenu"></a> |
|
150 <h4>SyntaxCheckerPlugin.__editorShowMenu</h4> |
|
151 <b>__editorShowMenu</b>(<i>menuName, menu, editor</i>) |
|
152 <p> |
|
153 Private slot called, when the the editor context menu or a submenu is |
|
154 about to be shown. |
|
155 </p><dl> |
|
156 <dt><i>menuName</i></dt> |
|
157 <dd> |
|
158 name of the menu to be shown (string) |
|
159 </dd><dt><i>menu</i></dt> |
|
160 <dd> |
|
161 reference to the menu (QMenu) |
|
162 </dd><dt><i>editor</i></dt> |
|
163 <dd> |
|
164 reference to the editor |
|
165 </dd> |
|
166 </dl><a NAME="SyntaxCheckerPlugin.__editorSyntaxCheck" ID="SyntaxCheckerPlugin.__editorSyntaxCheck"></a> |
|
167 <h4>SyntaxCheckerPlugin.__editorSyntaxCheck</h4> |
|
168 <b>__editorSyntaxCheck</b>(<i></i>) |
|
169 <p> |
|
170 Private slot to handle the syntax check context menu action of the |
|
171 editors. |
|
172 </p><a NAME="SyntaxCheckerPlugin.__getPythonOptions" ID="SyntaxCheckerPlugin.__getPythonOptions"></a> |
|
173 <h4>SyntaxCheckerPlugin.__getPythonOptions</h4> |
|
174 <b>__getPythonOptions</b>(<i></i>) |
|
175 <p> |
|
176 Private methode to determine the syntax check options. |
|
177 </p><dl> |
|
178 <dt>Returns:</dt> |
|
179 <dd> |
|
180 state of checkFlakes and ignoreStarImportWarnings (bool, bool) |
|
181 </dd> |
|
182 </dl><a NAME="SyntaxCheckerPlugin.__initialize" ID="SyntaxCheckerPlugin.__initialize"></a> |
|
183 <h4>SyntaxCheckerPlugin.__initialize</h4> |
|
184 <b>__initialize</b>(<i></i>) |
|
185 <p> |
|
186 Private slot to (re)initialize the plugin. |
|
187 </p><a NAME="SyntaxCheckerPlugin.__projectBrowserShowMenu" ID="SyntaxCheckerPlugin.__projectBrowserShowMenu"></a> |
|
188 <h4>SyntaxCheckerPlugin.__projectBrowserShowMenu</h4> |
|
189 <b>__projectBrowserShowMenu</b>(<i>menuName, menu</i>) |
|
190 <p> |
|
191 Private slot called, when the the project browser menu or a submenu is |
|
192 about to be shown. |
|
193 </p><dl> |
|
194 <dt><i>menuName</i></dt> |
|
195 <dd> |
|
196 name of the menu to be shown (string) |
|
197 </dd><dt><i>menu</i></dt> |
|
198 <dd> |
|
199 reference to the menu (QMenu) |
|
200 </dd> |
|
201 </dl><a NAME="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck" ID="SyntaxCheckerPlugin.__projectBrowserSyntaxCheck"></a> |
|
202 <h4>SyntaxCheckerPlugin.__projectBrowserSyntaxCheck</h4> |
|
203 <b>__projectBrowserSyntaxCheck</b>(<i></i>) |
|
204 <p> |
|
205 Private method to handle the syntax check context menu action of the |
|
206 project sources browser. |
|
207 </p><a NAME="SyntaxCheckerPlugin.__projectShowMenu" ID="SyntaxCheckerPlugin.__projectShowMenu"></a> |
|
208 <h4>SyntaxCheckerPlugin.__projectShowMenu</h4> |
|
209 <b>__projectShowMenu</b>(<i>menuName, menu</i>) |
|
210 <p> |
|
211 Private slot called, when the the project menu or a submenu is |
|
212 about to be shown. |
|
213 </p><dl> |
|
214 <dt><i>menuName</i></dt> |
|
215 <dd> |
|
216 name of the menu to be shown (string) |
|
217 </dd><dt><i>menu</i></dt> |
|
218 <dd> |
|
219 reference to the menu (QMenu) |
|
220 </dd> |
|
221 </dl><a NAME="SyntaxCheckerPlugin.__projectSyntaxCheck" ID="SyntaxCheckerPlugin.__projectSyntaxCheck"></a> |
|
222 <h4>SyntaxCheckerPlugin.__projectSyntaxCheck</h4> |
|
223 <b>__projectSyntaxCheck</b>(<i></i>) |
|
224 <p> |
|
225 Private slot used to check the project files for syntax errors. |
|
226 </p><a NAME="SyntaxCheckerPlugin.__serviceError" ID="SyntaxCheckerPlugin.__serviceError"></a> |
|
227 <h4>SyntaxCheckerPlugin.__serviceError</h4> |
|
228 <b>__serviceError</b>(<i>fn, msg</i>) |
|
229 <p> |
|
230 Private slot handling service errors. |
|
231 </p><dl> |
|
232 <dt><i>fn</i></dt> |
|
233 <dd> |
|
234 file name (string) |
|
235 </dd><dt><i>msg</i></dt> |
|
236 <dd> |
|
237 message text (string) |
|
238 </dd> |
|
239 </dl><a NAME="SyntaxCheckerPlugin.__translateSyntaxCheck" ID="SyntaxCheckerPlugin.__translateSyntaxCheck"></a> |
|
240 <h4>SyntaxCheckerPlugin.__translateSyntaxCheck</h4> |
|
241 <b>__translateSyntaxCheck</b>(<i>fn, problems</i>) |
|
242 <p> |
|
243 Private slot to translate the resulting messages. |
|
244 </p><p> |
|
245 If checkFlakes is True, warnings contains a list of strings containing |
|
246 the warnings (marker, file name, line number, message) |
|
247 The values are only valid, if nok is False. |
|
248 </p><dl> |
|
249 <dt><i>fn</i></dt> |
|
250 <dd> |
|
251 filename of the checked file (str) |
|
252 </dd><dt><i>problems</i></dt> |
|
253 <dd> |
|
254 dictionary with the keys 'error' and 'warnings' which |
|
255 hold a list containing details about the error/ warnings |
|
256 (file name, line number, column, codestring (only at syntax |
|
257 errors), the message, a list with arguments for the message) |
|
258 </dd> |
|
259 </dl><a NAME="SyntaxCheckerPlugin.activate" ID="SyntaxCheckerPlugin.activate"></a> |
|
260 <h4>SyntaxCheckerPlugin.activate</h4> |
|
261 <b>activate</b>(<i></i>) |
|
262 <p> |
|
263 Public method to activate this plugin. |
|
264 </p><dl> |
|
265 <dt>Returns:</dt> |
|
266 <dd> |
|
267 tuple of None and activation status (boolean) |
|
268 </dd> |
|
269 </dl><a NAME="SyntaxCheckerPlugin.deactivate" ID="SyntaxCheckerPlugin.deactivate"></a> |
|
270 <h4>SyntaxCheckerPlugin.deactivate</h4> |
|
271 <b>deactivate</b>(<i></i>) |
|
272 <p> |
|
273 Public method to deactivate this plugin. |
|
274 </p><a NAME="SyntaxCheckerPlugin.serviceErrorJavaScript" ID="SyntaxCheckerPlugin.serviceErrorJavaScript"></a> |
|
275 <h4>SyntaxCheckerPlugin.serviceErrorJavaScript</h4> |
|
276 <b>serviceErrorJavaScript</b>(<i>fx, lang, fn, msg</i>) |
|
277 <p> |
|
278 Public method handling service errors for JavaScript. |
|
279 </p><dl> |
|
280 <dt><i>fx</i></dt> |
|
281 <dd> |
|
282 service name (string) |
|
283 </dd><dt><i>lang</i></dt> |
|
284 <dd> |
|
285 language (string) |
|
286 </dd><dt><i>fn</i></dt> |
|
287 <dd> |
|
288 file name (string) |
|
289 </dd><dt><i>msg</i></dt> |
|
290 <dd> |
|
291 message text (string) |
|
292 </dd> |
|
293 </dl><a NAME="SyntaxCheckerPlugin.serviceErrorPy2" ID="SyntaxCheckerPlugin.serviceErrorPy2"></a> |
|
294 <h4>SyntaxCheckerPlugin.serviceErrorPy2</h4> |
|
295 <b>serviceErrorPy2</b>(<i>fx, lang, fn, msg</i>) |
|
296 <p> |
|
297 Public method handling service errors for Python 2. |
|
298 </p><dl> |
|
299 <dt><i>fx</i></dt> |
|
300 <dd> |
|
301 service name (string) |
|
302 </dd><dt><i>lang</i></dt> |
|
303 <dd> |
|
304 language (string) |
|
305 </dd><dt><i>fn</i></dt> |
|
306 <dd> |
|
307 file name (string) |
|
308 </dd><dt><i>msg</i></dt> |
|
309 <dd> |
|
310 message text (string) |
|
311 </dd> |
|
312 </dl><a NAME="SyntaxCheckerPlugin.serviceErrorPy3" ID="SyntaxCheckerPlugin.serviceErrorPy3"></a> |
|
313 <h4>SyntaxCheckerPlugin.serviceErrorPy3</h4> |
|
314 <b>serviceErrorPy3</b>(<i>fx, lang, fn, msg</i>) |
|
315 <p> |
|
316 Public method handling service errors for Python 2. |
|
317 </p><dl> |
|
318 <dt><i>fx</i></dt> |
|
319 <dd> |
|
320 service name (string) |
|
321 </dd><dt><i>lang</i></dt> |
|
322 <dd> |
|
323 language (string) |
|
324 </dd><dt><i>fn</i></dt> |
|
325 <dd> |
|
326 file name (string) |
|
327 </dd><dt><i>msg</i></dt> |
|
328 <dd> |
|
329 message text (string) |
|
330 </dd> |
|
331 </dl> |
|
332 <div align="right"><a href="#top">Up</a></div> |
|
333 <hr /> |
|
334 </body></html> |