Bug 191495 - Autocomplete of functions and constants from "root" namespace
Autocomplete of functions and constants from "root" namespace
Status: CLOSED FIXED
Product: php
Classification: Unclassified
Component: Editor
6.x
All All
: P2 with 1 vote (vote)
: 7.0
Assigned To: Ondrej Brejla
issues@php
: 70_HR_FIX
Depends on:
Blocks:
  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
:


Attachments

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.

Example:

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.

Example:

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. http://netbeans.org/bugzilla/show_bug.cgi?id=187674
Comment 3 OndrejBrejla 2011-03-25 15:00:04 UTC
Fixed in web-main: http://hg.netbeans.org/web-main/rev/598be003369f
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 http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/598be003369f
User: Ondrej Brejla <OndrejBrejla@netbeans.org>
Log: #191495 - Autocomplete of functions and constants from "root" namespace
Comment 6 Vladimir Riha 2011-03-28 12:51:34 UTC
verified
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,
nhatzbulawan

(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.

[1] https://netbeans.org/community/releases/80/


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