Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 191495 - Autocomplete of functions and constants from "root" namespace
Autocomplete of functions and constants from "root" namespace
Product: php
Classification: Unclassified
Component: Editor
All All
: P2 with 1 vote (vote)
: 7.0
Assigned To: Ondrej Brejla
Depends on:
  Show dependency treegraph
Reported: 2010-10-31 09:39 UTC by chEbba
Modified: 2014-04-16 13:15 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT


Note You need to log in before you can comment on or make changes to this bug.
Description chEbba 2010-10-31 09:39:21 UTC
When you write code in a namespace and use functions and constants from "root" namespace (like built-un functions and constants) autocompletition inserts a function/constant name with a backslash.


namespace NS\Test;

$dir = __D[ctrl+space] -> \__DIR__
$includePath = get_inc[ctrl+space] -> \get_include_path()

Name resolving for functions and constants is different from resolving classes: backslash is not required. Moreover, backslash is not used in modern coding standards for such situations.

So it will be cool to have another default behaviour for root functions and constants, or just an option in settings to change it.


namespace NS\Test;

$dir = __D[ctrl+space] -> __DIR__
$includePath = get_inc[ctrl+space] -> get_include_path()
Comment 1 OndrejBrejla 2011-03-25 14:30:16 UTC
Backslash prefixing global functions was removed.
Comment 2 OndrejBrejla 2011-03-25 14:55:09 UTC
Related "function backslash" bug.
Comment 3 OndrejBrejla 2011-03-25 15:00:04 UTC
Fixed in web-main:
Comment 4 OndrejBrejla 2011-03-25 15:49:58 UTC
I would like to transplat it into 7.0. Could I ask QA to test it? Thanks.
Comment 5 Quality Engineering 2011-03-28 08:46:40 UTC
Integrated into 'main-golden', will be available in build *201103280400* on (upload may still be in progress)
User: Ondrej Brejla <>
Log: #191495 - Autocomplete of functions and constants from "root" namespace
Comment 6 Vladimir Riha 2011-03-28 12:51:34 UTC
Comment 7 Petr Pisl 2011-03-29 09:32:42 UTC
The fix was transplanted to the release70
Comment 8 nhatzbulawan 2014-03-02 13:34:13 UTC
To Whom It may concern,

Can someone help me to remove this backslash prefixing?
I am using mac and this backslash always show when I select Classes or Functions in the dropdown of the autocomplete.

Much appreciated your help.

Thank you and regards,

(In reply to OndrejBrejla from comment #1)
> Backslash prefixing global functions was removed.
Comment 9 Ondrej Brejla 2014-03-02 13:38:26 UTC
Do not reopen verified and fixed issues, thanks. Especially if you just have a question. If you have some problem, try the latest dev build (e.g. 8.0 RC1 [1]) and if the problem persists, then file a new issue a describe step-by-step reproducible test case. Thanks.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo