This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Warning on Current Line 'Global variable is not defined' doesn't work | ||
---|---|---|---|
Product: | javascript | Reporter: | Petr Pisl <ppisl> |
Component: | Editor | Assignee: | Petr Pisl <ppisl> |
Status: | VERIFIED FIXED | ||
Severity: | normal | CC: | mmirilovic, pjiricka, sdedic, vriha |
Priority: | P2 | ||
Version: | 7.3 | ||
Hardware: | PC | ||
OS: | Linux | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
Petr Pisl
2013-01-03 10:16:11 UTC
Negative; I've configured e.g. Unused Variables and Unitialized Variables as Warning on Current Line, and I am still able to see them in the left sidebar (assignment from an uninitialized, undeclared variable). Please provide more detailed info. I can reproduce it as well in PHP. - have following source: <?php $test = 1; $test = 1; ?> - in IDE settings for hint, change Immutable Variables PHP hint to "Warning on current line" and confirm - back in editor, place cursor to either one of the line with $test => no hint, the same goes for Uninitialized Variables hint Product Version: NetBeans IDE Dev (Build web-main-9657-on-20130108) Java: 1.7.0_10; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb) Ehm ... well, PHP calls HintsManager.getHints(onLine = false, ruleContext). This means it will receive all enabled hints EXCEPT warning on current line. The PHP Hints provider never calls HintsManager.getHints(onLine = true, ruleContext) - in fact getHints() is never called with onLine parameter se to true at all. So EL, JS, HTML should suffer from the same problem. Passing in true as onLine parameter will cause ONLY the warning-on-current-line to be returned. The motivation of the API design is (probably - no comments or javadocs present) to save computation time, so WOL hints must be probably processed specially, so they are only executed on the caret current line text. Sorry I've returned the defect to the wrong product. The relevant bug in PHP is a P3 - issue #143677. This issue was originally motivated due to the fact that the hint "The global variable is not defined" has by default the severity "Warning on Current line". So this hint stop the work with the default value. I have change a little the infrastructure of hints in JS Editor and now it allows implement hints that are able to work with caret offset, which is required when a hint has the mentioned severity. I have also changed hint "The global variable is not defined" that is able to work in all cases. So now the hint should work. The change is here: http://hg.netbeans.org/web-main/rev/fb91b59a4577 Integrated into 'main-golden', will be available in build *201301160001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/fb91b59a4577 User: Petr Pisl <ppisl@netbeans.org> Log: #224413 - Warning on Current Line doesn't work The fix seems to be fine. verified in trunk Product Version: NetBeans IDE Dev (Build 201301160001) Java: 1.7.0_10; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb) The fix integrated into release73 branch: http://hg.netbeans.org/releases/rev/c14370ebd980 Integrated into 'releases', will be available in build *201301162100* or newer. Wait for official and publicly available build. Changeset: http://hg.netbeans.org/releases/rev/c14370ebd980 User: Petr Pisl <ppisl@netbeans.org> Log: #224413 - Warning on Current Line doesn't work (transplanted from fb91b59a457792f17579516aa54839fba805aeb8) verified in RC1 Product Version: NetBeans IDE 7.3 RC1 (Build 201301172100) Java: 1.7.0_10; Java HotSpot(TM) Client VM 23.6-b04 Runtime: Java(TM) SE Runtime Environment 1.7.0_10-b18 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb) |