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.
Code completion list should contain all supported php tags <?php <? as well as html tags.
Clarification: -------------- A code completion list should contain proposal(s) for the PHP Opening Tag(s) *only if* it is generated for the scope of the preprocessed text, i.e. it should be provided for the "foreign scope" that is located outside of any PHP block. The PHP module can't serve foreign scopes and its functionality must not have any influences on code completion outside of the PHP scopes. Therefore, this issue should be readdressed and propagated to all NB modules that support languages which can be integrated with PHP, including (but not limited!) SGML family (HTML, XHTML, XML, ...) and so on. Nevertheless, if it is need then the PHP module might provide some support to create such proposals that can be used by other modules. Investigation: -------------- See http://www.php.net/manual/en/language.basic-syntax.php for more information about tags used to escaping PHP scope. A set of the tags may depends on both the language of the preprocessed text and the PHP interpreter configuration: a) the <?php tag can be proposed if the PHP interpreter will be able to recognize it as a start of the PHP code block in the context of the processed language, otherwise the language can't be used in conjunction with the PHP language. b) the <script language="php"> tag has the same limitation as a). This tag is not recommended in the PHP Manual. c) both the <? tag and the <?= tag are only available when they are enabled via the short_open_tag php.ini configuration file directive, or if php was configured with the --enable-short-tags option. d) both the <% tag and the <%= tag (i.e. ASP style tags) are only available when they are enabled via the asp_tags php.ini configuration file directive. Therefore, only the <?php tag can be recommended as an universal independent proposal for many of the hypertext related languages.
Pavel, you mentioned that we can somehow insert things like <?php into html code completion. Could you please point us to the how-to or just to the right person ?
This should be very easy through a code completion provider (from editor api) returns the appropriate items.
Fixed. Adding the PHP code block (i.e. "<?php ?>") is enabled at any position inside of any file that is registered in the NetBeans IDE with the MIME type "text/x-php5". Of course, nesting of the PHP code blocks has been excepted. Note, the current version of the Plugin for PHP assumes that associations of the file name extensions with the MIME type "text/x-php5" is recorded in the file <CVSWorkingDir>\php\editing\src\org\netbeans\modules\languages\php\resources\PHP.xml A user can also change these associations through UI via the Advanced Option dialog (see the item Options/IDE Configuration/System/File Types/PHP.xml).
*** Issue 122307 has been marked as a duplicate of this issue. ***
I'm sorry, but I can not see any php delimiter in the html code completion for .php files. I have todays build (20080204).
It was checked again. Bild: http://bits.netbeans.org/download/trunk/nightly/2008-02-04_01-01-52/ NetBeans Pack All Free, 187 MB Selected Packs and Runtimes to install: Base IDE, Ruby, PHP JDK: jdk1.5.0_14 Platform: Windows XP Resolution: There is expected behavior for all files associated with with the MIME type "text/x-php5". Note, only the following file name extensions are registered for the MIME type "text/x-php5" by default: <ext name="php"/> <ext name="php5"/> <ext name="phtml"/> <ext name="inc"/> Therefore, you can't expect CC in html file until association of it with the MIME type "text/x-php5".
BTW, Petre, once you are at it do not forget ?> inside php block. Last I checked it was not there either. Thanks.
Pavel, there are no any reasons to always(!) see the closing tag inside of PHP blocks. It will be visible as noise in the list of proposals. Moreover, such proposal will generate illegal code, e.g. <?php // inserted tag ?> ?> I'll close the issue, because implementation is completely matched with reached agreements.