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 245774 - Indetation not working properly
Summary: Indetation not working properly
Status: NEW
Alias: None
Product: php
Classification: Unclassified
Component: Formatting & Indentation (show other bugs)
Version: 8.0
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Tomas Mysik
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-18 00:56 UTC by techflat
Modified: 2016-09-23 11:16 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
How NetBeans IDE 8.0 formats (144.34 KB, image/png)
2014-07-18 00:56 UTC, techflat
Details
How it should look (175.77 KB, image/png)
2014-07-18 00:57 UTC, techflat
Details

Note You need to log in before you can comment on or make changes to this bug.
Description techflat 2014-07-18 00:56:40 UTC
Created attachment 148121 [details]
How NetBeans IDE 8.0 formats

Auto formatting isn't formatting code in a nice readable, comprehensive way.

I would like to have it indent properly from within a method calling, class initialization, array. The program messes everything and it becomes really hard to read.

Note that I think this should only happen when you jump to a newline for arguments. If you put the arguments inline now indentation should happen to keep the code as needed.

Here's an example.

When I would like to have this:
// How I think code should look
$menu[0]->menu[1] = new \flat\tight\classes\adminMenuItem(
		'footer',
		'Configuraciones del footer',
		'',
		'',
		new \flat\tight\classes\mdaRequestObj(
			'\flat\boots\modules\configuration',
				'read',
				array(
					'title' => 'Footer',
					'description' => 'Configuraciones del footer',
					'type' => 'configuration',
					'buttonSave' => new flat\tight\classes\mdaParamsButton(
						'Salvar',
						'\flat\boots\modules\configuration',
						'update'
					),
					'buttonCancel' => new flat\tight\classes\mdaParamsButton('Cancelar'),
					'fields' => array(
					'Teléfono',
					'Dirección'
					)
				)
		)
);

I get this:
// How NetBeans IDE 8.0 formats
$menu[0]->menu[1] = new \flat\tight\classes\adminMenuItem(
		'footer', 'Configuraciones del footer', '', '', new \flat\tight\classes\mdaRequestObj(
		'\flat\boots\modules\configuration', 'read', array(
	'title' => 'Footer',
	'description' => 'Configuraciones del footer',
	'type' => 'configuration',
	'buttonSave' => new flat\tight\classes\mdaParamsButton(
			'Salvar', '\flat\boots\modules\configuration', 'update'
	),
	'buttonCancel' => new flat\tight\classes\mdaParamsButton('Cancelar'),
	'fields' => array(
		'Teléfono',
		'Dirección')
		)
		)
);
Comment 1 techflat 2014-07-18 00:57:48 UTC
Created attachment 148122 [details]
How it should look
Comment 2 Ondrej Brejla 2014-07-18 05:48:36 UTC
Editor issue, must be evaluated, definitely not P2. It's a common array formatting issue. You say "I would like to have". It's great, but we are not able to satisfy request of all users. We can just add some general options. You can try to play with tools - options - editor - formatting - php settings, maybe it will help you.
Comment 3 techflat 2014-07-18 16:18:34 UTC
Thanks for your comment. I have tried doing some experimentation with tools - options - editor - formatting but I get nothing that improves readability...
Comment 4 Tomas Mysik 2016-06-10 10:59:25 UTC
Reproducible. Thanks for reporting.