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 257353 - Breakpoints cannot be set for PHP code inside tags
Summary: Breakpoints cannot be set for PHP code inside tags
Status: RESOLVED FIXED
Alias: None
Product: debugger
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: Martin Entlicher
URL:
Keywords:
: 257074 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-31 19:54 UTC by usernamex12j1532jk
Modified: 2016-07-20 01:51 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description usernamex12j1532jk 2015-12-31 19:54:40 UTC
In versions 8.1 it is not possible to add a breakpoint if the PHP line looks like this:

    <?php echo $tableColumn; ?>

but if it is broken into multiple lines then the breakpoint can be added

    <?php 
        echo $tableColumn;
    ?>

Version 8.0 would allow the breakpoints.
Comment 1 Tomas Mysik 2016-06-02 13:10:21 UTC
I just verified that it used to work in NB 8.0.

@mentlicher: Martine, could you please give me an advice where to have a look? It is strange because I do not think there were any changes in this PHP area between NB 8.0 and 8.1 so it could be maybe a problem in the debugger common support?

Thanks.
Comment 2 Martin Entlicher 2016-06-02 14:26:16 UTC
I'm not sure what could be the reason, offhand. I need to investigate...
I'll look at it...
Comment 3 Tomas Mysik 2016-06-03 05:49:45 UTC
*** Bug 257074 has been marked as a duplicate of this bug. ***
Comment 4 Tomas Mysik 2016-06-29 07:44:21 UTC
The problem is in the common debugger support, here:

EditorContextDispatcher.getDefault().getMIMETypesOnLine(line)

This method returns incorrect MIME type for one line PHP in an HTML file. Sample file:

------------------------
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
    </head>
    <body>
        <?php echo 10; ?>
    </body>
</html>
------------------------

Not sure if it is P2. Adding Sváťa to CC, he can advice how to get proper MIME type for an offset.

Thanks.
Comment 5 Tomas Mysik 2016-06-29 07:45:15 UTC
(In reply to Tomas Mysik from comment #4)
> Not sure if it is P2.

Sorry, I meant P3, of course.
Comment 6 Svata Dedic 2016-07-01 07:39:47 UTC
It's not 100% appropriate for this context, since Debugger needs to enumerate all mimetypes on a line. But for a given offset, working code can be found in editor.completion module, class org.netbeans.modules.editor.completion.CompletionImpl, lines 634 and above. Drilldown for an entire line range could deserve some optimization (?)
Comment 7 Martin Entlicher 2016-07-19 15:54:02 UTC
Fixed by changeset:   299407:0f3dfe005e93
http://hg.netbeans.org/core-main/rev/0f3dfe005e93
Comment 8 Quality Engineering 2016-07-20 01:51:43 UTC
Integrated into 'main-silver', will be available in build *201607200002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/0f3dfe005e93
User: mentlicher@netbeans.org
Log: #257353: Languages on the line were not detected correctly.