eric6/Documentation/Source/eric6.Plugins.PluginSyntaxChecker.html

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

eric ide

mercurial