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 170712 - Wrong offsets in AST for namespaces limited with curly braces
Summary: Wrong offsets in AST for namespaces limited with curly braces
Status: RESOLVED FIXED
Alias: None
Product: php
Classification: Unclassified
Component: Editor (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: Ondrej Brejla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-20 15:24 UTC by Tomasz Slota
Modified: 2012-03-24 11:01 UTC (History)
0 users

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 Tomasz Slota 2009-08-20 15:24:03 UTC
The end offset in AST for namespaces limited with curly braces is wrong if they are not immediately followed with a declaration of another namespace, e.g:

namespace test {
    function function_name() {
        
    }
}

echo 1; // this is still within the block scope
Comment 1 Filip Zamboj 2010-09-15 12:29:48 UTC
batch reassigning
Comment 2 schkovich 2011-03-01 22:07:46 UTC
I voted for this issue since the only way to combine global non-namespaced code with namespaced code id to use bracketed syntax. See http://www.php.net/manual/en/language.namespaces.definitionmultiple.php

When working with legacy code this will be common case.
Comment 3 Petr Pisl 2011-03-07 15:04:57 UTC
This is here from beginning. The grammar for the parser doesn't work correctly here and I'm afraid that fixing this before code freeze is a little danger.
Comment 4 Petr Pisl 2011-03-07 15:22:11 UTC
There are two things, which are here mixed together. 

The firs one is PHP Documentor syntax where @var is used as tag to document the data type of class variables. So NetBeans expects the PHP Documentor style /** @var  */ for class variables. The @var tag is bold, because it's tag defined in the spec. You can write /** and hit enter before such class varible and the skeleton of php doc is generated.

The second think is /* @var   .... */ doesn't have nothing with PHP Documentor. It helps to recognized type of variable (not class one), when NetBeans can not resolve the type. It's not according a specification, it's a "deal" between user and the IDE. 

Unfortunately both cases use @var tag and this can be misleading.
Comment 5 Ondrej Brejla 2012-03-23 08:19:02 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/9354236a32ab
Comment 6 Quality Engineering 2012-03-24 11:01:51 UTC
Integrated into 'main-golden', will be available in build *201203240400* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/9354236a32ab
User: Ondrej Brejla <obrejla@netbeans.org>
Log: #170712 - Wrong offsets in AST for namespaces limited with curly braces