Difference between revisions of "Lite IDE Ignore"
(→Lite is set in Eclipse) |
(→Advanced Template) |
||
(9 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | When using Lite in an IDE (see https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html ), you can use the power of the IDE to mark some issues in the code as to be ignored. Globalyzer uses a set of standard comments, |
+ | When using Lite in an IDE (see https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html ), you can use the power of the IDE to mark some issues in the code as to be ignored. Globalyzer uses a set of standard comments, namely <code>$NON-NLS-L$</code>. There are many ways to do so. We will illustrate one such way with Lite in Eclipse. |
= Lite is set in Eclipse = |
= Lite is set in Eclipse = |
||
To set Lite in your Eclipse environment, refer to https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html#Eclipse ; There are two sections, one for Linux, one for Windows. |
To set Lite in your Eclipse environment, refer to https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html#Eclipse ; There are two sections, one for Linux, one for Windows. |
||
+ | |||
+ | |||
[[File:LiteConfigured.gif]] |
[[File:LiteConfigured.gif]] |
||
Line 9: | Line 11: | ||
=> Lite analyzes the relevant files based on the Globalyzer Project Definition file and shows the clickable results in the Console view. |
=> Lite analyzes the relevant files based on the Globalyzer Project Definition file and shows the clickable results in the Console view. |
||
+ | |||
+ | [[File:LiteRun.gif]] |
||
= Navigate to the Issue = |
= Navigate to the Issue = |
||
Line 16: | Line 20: | ||
= Refactor the Code or Ignore the Issue= |
= Refactor the Code or Ignore the Issue= |
||
− | Depending on what the developer sees, the issue either needs to be refactored or ignored. If the issue needs to be ignored: |
+ | Depending on what the developer sees, the issue either needs to be refactored or ignored. If the issue needs to be ignored, the //$NON-NLS-L$ comment needs to be added at the end of that line. One can simply add it by typing it. Some short cut exist and some can be created. For instance: |
+ | |||
+ | * Go to the end of the line to ignore and type <Ctr><Space> |
||
+ | * Choose "nls - non externalize string marker" in the list of templates. |
||
+ | |||
+ | or |
||
+ | |||
* Add the string "nls" and type <Ctr><Space> |
* Add the string "nls" and type <Ctr><Space> |
||
* Eclipse proposes the standard $NLS notation by default. Select that notation and type L. |
* Eclipse proposes the standard $NLS notation by default. Select that notation and type L. |
||
+ | |||
+ | [[File:LiteNlsCtrSpace.gif]] |
||
+ | |||
+ | |||
The line now reads: |
The line now reads: |
||
− | Locale locale = new Locale("en", "US"); //$NON-NLS-L$ |
+ | <code>Locale locale = new Locale("en", "US"); //$NON-NLS-L$</code> |
* Repeat the process for other false positives |
* Repeat the process for other false positives |
||
− | Lines tagged with the //$NON-NLS-L$ will be ignored by Globalyzer the next time you run the Lite external tool. |
+ | Lines tagged with the <code>//$NON-NLS-L$</code> will be ignored by Globalyzer the next time you run the Lite external tool. |
+ | |||
+ | = Advanced Template = |
||
+ | The previous illustration was done using the default template. You can modify the template to have directly <code>//$NON-NLS-L$</code> on other key combination or the same <code>nls<Ctr><Space></code>. |
||
+ | |||
+ | The following image shows how to use <code>nll<Ctr><Space></code> to insert directory <code>//$NON-NLS-L$</code>. |
||
+ | |||
+ | [[File:NllTemplate.gif]] |
||
+ | |||
− | Note: This is using the default template. You can modifiy the template to have directly //$NON-NLS-L$ on other key combination or the same nls<Ctr><Space>. |
||
− | This is one way of adding //$NON-NLS-L$ at the end of the line. Some developers will decide on other methods. |
+ | This is one way of adding <code>//$NON-NLS-L$</code> at the end of the line. Some developers will decide on other methods. |
Latest revision as of 16:20, 14 March 2018
When using Lite in an IDE (see https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html ), you can use the power of the IDE to mark some issues in the code as to be ignored. Globalyzer uses a set of standard comments, namely $NON-NLS-L$
. There are many ways to do so. We will illustrate one such way with Lite in Eclipse.
Contents
Lite is set in Eclipse
To set Lite in your Eclipse environment, refer to https://www.globalyzer.com/gzserver/help/referenceLite/globalyzer-lite-IDE-usage.html#Eclipse ; There are two sections, one for Linux, one for Windows.
Run Lite
- Select the directory or file you want to analyze
- Click on the external tools button
=> Lite analyzes the relevant files based on the Globalyzer Project Definition file and shows the clickable results in the Console view.
- Click on the issue in the Console
=> It opens the file and highlights the line with the issue.
Refactor the Code or Ignore the Issue
Depending on what the developer sees, the issue either needs to be refactored or ignored. If the issue needs to be ignored, the //$NON-NLS-L$ comment needs to be added at the end of that line. One can simply add it by typing it. Some short cut exist and some can be created. For instance:
- Go to the end of the line to ignore and type <Ctr><Space>
- Choose "nls - non externalize string marker" in the list of templates.
or
- Add the string "nls" and type <Ctr><Space>
- Eclipse proposes the standard $NLS notation by default. Select that notation and type L.
The line now reads:
Locale locale = new Locale("en", "US"); //$NON-NLS-L$
- Repeat the process for other false positives
Lines tagged with the //$NON-NLS-L$
will be ignored by Globalyzer the next time you run the Lite external tool.
Advanced Template
The previous illustration was done using the default template. You can modify the template to have directly //$NON-NLS-L$
on other key combination or the same nls<Ctr><Space>
.
The following image shows how to use nll<Ctr><Space>
to insert directory //$NON-NLS-L$
.
This is one way of adding //$NON-NLS-L$
at the end of the line. Some developers will decide on other methods.