NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
EditorConfig support


Joined: 21 Jan 2010
Posts: 4
Reply with quote
EditorConfig is a very nice configuration standard for "file formats" (line breaks, charset, tab width etc.)

Especially when working on different projects that have different code styles, it is extremely helpful to have the basic style rules per-project. EditorConfig reads the settings from a file, so they can even go into the project repository very easily, and every developer automatically has them available.

So, PhpED support for EditorConfig would be really nice!

(see editorconfig.org for reference)
View user's profileFind all posts by roller246Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Charset can be set by directory and by the project -- no problem here.
Linebreak can be set to Auto to preserve what so ever was used in the files and can be set when you save a new file after it is created.
Tab width is perhaps the only thing you may want to pick with projects, but hey... I'm not sure how you want this to work. For example: you have fileA.php open in the editor and placed some tabs.. Now you click another project in the workspace which demands to use spaces instead of the tabs. What now? Would pressing tabs in fileA.php enter spaces? Sounds like absurd.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
How it should work


Joined: 16 Jan 2013
Posts: 2
Reply with quote
It should work like all other project overrides.

If you structure is this:

Workspace
-- Project 1
-- -- File A
-- Project 2
-- -- File B

Project 1's settings would be set to 4 spaces per tab.
Project 2's settings would be set to 2 spaces per tab.

When editing File A and pressing tab, 4 spaces should be entered.
When editing File B and pressing tab, 2 spaces should be entered.

Many code projects follow different coding standards:
Symfony: (4 spaces)
Zend: (4 spaces)
Pear: (4 spaces)
Drupal: (2 spaces)
Wordpress: (1 tab)
SilverStripe: (1 tab)
CodeIgnitor: (1 tab)
Ruby: (2 spaces) Used for many config management and deployment systems (Puppet, Chef, etc.) for PHP sites.
Python: (4 spaces)
... among many others, including clients with specific requirements of their own.

I have used PHPed for many years and love it. However, this missing feature is starting to become a deal breaker.
View user's profileFind all posts by dragonwizeSend private message
Guru master

Joined: 24 Jul 2009
Posts: 737
Reply with quote
It is a bit of a pain, particularly as I switch between projects a lot and I'm very fussy about my code formatting. So I set my tabs to 2 spaces then in the projects that require 4 spaces I have to press tab twice. Works, but annoying.

To answer Dmitri's question about clicking between files in different projects in a workspace, I would actually be happy for it to be a workspace rather than project setting, which then wouldn't be so absurd. But seeing as workspaces do not have settings then maybe having it as a project setting would be easier to implement and would be more flexible for those instances where different standards are required for each project. Doesn't sound absurd to me Smile
View user's profileFind all posts by plugnplaySend private message
EditorConfig support
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic