Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 343572 - PDT reading incorrect tabs/spaces setting
Summary: PDT reading incorrect tabs/spaces setting
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: PDT (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P1 normal (vote)
Target Milestone: ---   Edit
Assignee: PHP UI CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-21 12:07 EDT by Daniel Robert CLA
Modified: 2020-05-14 10:17 EDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Robert CLA 2011-04-21 12:07:55 EDT
I have my general Text Editors tab policy to be set to use tabs rather than spaces.  While editing PHP files, hitting 'enter' on a new line causes an indentation based on spaces rather than tabs (the new line begins with spaces and is not indented as deep as the line above it).

It seems this value is taken from my "Web -> HTML Files -> Editor" settings which has a "2 spaces" indentation policy.

It looks like it's converting the tabs from the previous line into spaces and using that as the indentation of my new line.

So the bug is: why is this reading my HTML Editor settings at all?
Comment 1 Zhongwei Zhao CLA 2011-06-24 10:59:10 EDT
hi,I tested it just now,pdt reads Preferences->PHP->Code Style->Formatter.
Comment 2 Daniel Robert CLA 2011-06-24 11:36:42 EDT
This is no way to handle a ticket.  I included the version information and o/s of ecipse and pdt.  Listed the steps to reproduce the problem, and yes, I'm still having this problem.  

The follow-up comment was "works for me." then you mark it 'resolved' and 'fixed'?  This is ridiculous.  At the very, very least, it's "WORKSFORME" rather than "FIXED".  

If it is actually fixed, what version is it fixed in?  What version of pdt/eclipse did you test with?  Was your php file entirely php? Or did it include a mix of html tags and php?

I'm reopening this until I can learn something about about what just happened.
Comment 3 Zhongwei Zhao CLA 2011-06-24 11:47:04 EDT
So the bug is: why is this reading my HTML Editor settings at all?

my version is Indigo and it does not read my HTML Editor settings at all...
Comment 4 Zhongwei Zhao CLA 2011-06-24 11:48:59 EDT
ah,sorry,my fault,it should be "WORKSFORME",and are you ok with this?
Comment 5 Daniel Robert CLA 2011-06-24 14:07:18 EDT
I would say no, I'm not ok with this.

"Indigo" is not a version of PDT, it's a version of eclipse.  It's also not the version of eclipse I was running when I reported this ticket (I'm on Helios in Linux using Oracle's 1.6.0_23 jdk).  Similarly, I have yet to hear anything about the file you were editing, what version of PDT you were using, what OS you're on, or how you ensured that this is not a bug.  "I tried editing a php file and things are fine" is pretty inadequate.

In case my original "steps to reproduce" are not clear:
* I have a .php file that contains both HTML markup and php blocks
* the html blocks are indented using tabs
* window -> preferences -> php -> code style -> formatter has "tab policy" set to "tabs"
* window -> preferences -> web -> HTML files -> editor has "indent using spaces" and "indentation size" set to "2"

When I open my .php file (which is associated with "PHP Editor") and insert a carriage return at the end of a line indented with at least one Tab, the next line is indented with n*2 spaces, where n is the number of tabs of indentation in the previous line.

This is the bug I'm seeing.  I can confirm it is still happening for me.

Eclipse: Helios Service Release 2 20110218-0911
PDT:   PHP Development Tools (PDT) SDK Feature 2.2.1.v20101001-2300-53184QAN4JBQgLYPWMLcXn6Na9Od

I will likely have time to upgrade eclipse and test after this upcoming weekend, and it very well be that this bug has been fixed.  But I'm really not ok with this ticket being closed with next to no due diligence.  I took the time to report the ticket, the steps to reproduce, and necessary version information, and I would expect the same from your side before this can be considered resolved.
Comment 6 Zhongwei Zhao CLA 2011-06-24 23:15:19 EDT
yes,I only tested it in php file that only contains php,thanks for your reporting and explain,I will have a look at it again asap,thanks again:)
Comment 7 Dawid Pakula CLA 2020-01-23 08:55:18 EST
Since couple releases, tab policy is always taken from formatter settings.