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.

Bug 253861

Summary: Allow hint to trigger for guarded code
Product: java Reporter: Svata Dedic <sdedic>
Component: HintsAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal Keywords: API_REVIEW_FAST
Priority: P3    
Version: 8.1   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:
Bug Depends on:    
Bug Blocks: 253553    
Attachments: Proposed changes

Description Svata Dedic 2015-07-27 13:28:42 UTC
Currently hint code using @TriggerTreeKind is not invoked for Trees inside guarded blocks: typically the hint would produce a warning the user could not remove as the guarded section cannot be changed.

Some hint(s) may however use the @TriggerTreeKind to collect information from the source tree - see issue #253553, so the hint implementor should be able to opt out off the automagic filter.

See the diff for implementation and use.
Comment 1 Svata Dedic 2015-07-27 13:29:10 UTC
Created attachment 154950 [details]
Proposed changes
Comment 2 Svata Dedic 2015-08-03 14:37:40 UTC
Last call, if no objections are sent, I'll apply the patch tomorrow.
Comment 3 Ralph Ruijs 2015-08-03 20:46:51 UTC
R1. Why mix the names guarded and locked?

Sorry for the late reply :-)
Comment 4 Svata Dedic 2015-08-04 06:45:07 UTC
Initially it seemed to me that a more general term would cover more kinds of "code which is usually not changed"; on the second thought, I don't think we'll ever have something different than guarded blocks to protect editor's contents. Constant and its value will change to PROCESS_GUARDED and "processGuarded". Thanks.
Comment 5 Svata Dedic 2015-08-04 07:30:53 UTC
Will be implemented as jet-main#ee478d3d4ad8
Comment 6 Svata Dedic 2015-08-04 07:31:21 UTC
Oops sorry, jet-main#2f4864be94d4
Comment 7 Quality Engineering 2015-08-05 01:20:38 UTC
Integrated into 'main-silver', will be available in build *201508050002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/2f4864be94d4
User: Svata Dedic <sdedic@netbeans.org>
Log: #253861: TriggerOptions allows hint to specify additional trigger constraints