Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311408 - Function breakpoint toggle depends on cursor position
Summary: Function breakpoint toggle depends on cursor position
Status: RESOLVED FIXED
Alias: None
Product: JSDT
Classification: WebTools
Component: Debug (show other bugs)
Version: 3.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.2 RC1   Edit
Assignee: Michael Rennie CLA
QA Contact: Simon Kaegi CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-03 14:31 EDT by Michael Rennie CLA
Modified: 2010-05-04 10:09 EDT (History)
1 user (show)

See Also:
thatnitind: review+


Attachments
fix (9.30 KB, patch)
2010-05-03 14:31 EDT, Michael Rennie CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Rennie CLA 2010-05-03 14:31:33 EDT
Created attachment 166829 [details]
fix

code from HEAD

using the following test script:

var func1 = func1 || {};
func1.fib = function f1(n) {};
var func2 = function f2(n) {};
function f3(n){};

trying to toggle function breakpoints with the cursor to the LHS of the assignment operator will fail in the editor, because we are trying to resolve the JS element at the cursor locale, which might not be what we want. The better solution would be to compute the start position while visiting the AST to find the valid locale for the breakpoint.

This would make a good RC1 fix, as it makes toggling a function breakpoint behave as expected.
Comment 1 Michael Rennie CLA 2010-05-04 10:09:30 EDT
applied patch to HEAD