Opened 4 years ago
Closed 17 months ago
#764 closed Bugs (fixed)
Ctrl-Shift-P fails to find previous brace with when multi-line string contains a hash symbol
| Reported by: | alyandon | Owned by: | robekras |
|---|---|---|---|
| Priority: | 1 | Milestone: | |
| Component: | PHP Editor | Version: | |
| Keywords: | Cc: |
Description
if (some_possibly_true_condition) {
$x = 1000;
$sql = "update some_table
set notes='VLAN #".$x."'
where some_condition";
}
If you place the cursor after the first brace and hit ctrl-shift-P, Eclipse will correctly find the closing brace. However, if you place the cursor after the closing brace and hit ctrl-shift-p you will end up someplace jumping to someplace completely unexpected.
Removing the # from the multi-line string makes the problem go away so I'm assuming that the parser is getting confused somehow.
Problem occurs in 1.2.1.200903240602NGT - haven't tested any previous builds.
Change History (2)
comment:1 Changed 17 months ago by robekras
- Owner set to robekras
- Status changed from new to assigned
comment:2 Changed 17 months ago by robekras
- Resolution set to fixed
- Status changed from assigned to closed
Parser fixed, so he ignores single line comments (# and ) within strings.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/eclipsebutton_med.png)
The problem is situated in PHPCodeReader.java.
When reading from a closing brace backwards to the opening brace, the parser does not recognize whether the hash (#) is within a string or not.