eclipse-pdt / pdt

PHP Development Tools project (PDT)
https://eclipse.org/pdt
Eclipse Public License 2.0
189 stars 46 forks source link

HTML template near to unreadable after save action format #171

Open collapsedev opened 1 year ago

collapsedev commented 1 year ago

Describe the bug Format, on save actions, of HTML template near to unreadable

Describe the eclipse environment Eclipse PDT PDT Profiler UI Plug-in 8.0.0.202306050832 org.eclipse.php.profiler

Eclipse IDE for Java Developers (includes Incubating components) Version: 2023-03 (4.27.0) Build id: 20230309-1520 OS: Linux, *, x86_64 / gtk 3.24.38, WebKit 2.40.2 Java vendor: Eclipse Adoptium Java runtime version: 17.0.6+10 Java version: 17.0.6

To Reproduce Steps to reproduce the behavior:

  1. Create a template:

3. Click on Source > Format

5. Enable: Window > Preferences > PHP > Editor > Save Actions > Format source code (Apply and close)
6. Ctrl + S
7. Result unreadable


**Expected behavior**
Formatted as expected in step 3
mlocati commented 1 year ago

What about avoiding the short open php tag? I mean, try to use <?php instead of <?

zulus commented 1 year ago

I think we need extra settings for short open tags, especially with alternate control structure syntaxes

brandung-sjorek commented 1 year ago

@zulus There have been several attempts to deprecate ASP-style tags and short-open-tags (even with its special control-structures):

I didn't read that far, but one (you? 🤔 ) should consider the current state.

collapsedev commented 1 year ago

Not related to short tags, useful in my opinion. Related to something strange that occurs with "format source code" on save (Window > Preferences > PHP > Editor > Save Actions > Format source code). As you can see in step 3 after (Source > Format), code format is "normal". (Source > Format) code format different from (File > Save) with format source code enabled.