Summary: | The code within @formatter:off block gets formatted when "Duplicate Lines" command is applied | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] JDT | Reporter: | Dmitry Katsubo <dma_k> | ||||||||
Component: | Text | Assignee: | JDT-Text-Inbox <jdt-text-inbox> | ||||||||
Status: | ASSIGNED --- | QA Contact: | |||||||||
Severity: | normal | ||||||||||
Priority: | P3 | CC: | daniel_megert, mateusz.matela | ||||||||
Version: | 4.6 | ||||||||||
Target Milestone: | --- | ||||||||||
Hardware: | PC | ||||||||||
OS: | Windows 7 | ||||||||||
Whiteboard: | stalebug | ||||||||||
Attachments: |
|
Created attachment 271310 [details]
Initial state
Created attachment 271311 [details]
Final state after Ctrl-D
Moving to jdt-text. Core formatter is not invoked in this scenario, there's a separate mechanism for fixing indentation. I'm afraid it could be quite messy making that mechanism respect formatter:off tags. Still an issue in Eclipse 4.8.0.v20180611-0656 / JDT 3.14.0.v20180611-0500. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. I have tested the issue on Eclipse v4.14.0.v20191210-0610 (build I20191210-0610) and the issue is still there. This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. If you have further information on the current state of the bug, please add it. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant. -- The automated Eclipse Genie. I have tested with Eclipse Platform v4.26.0.v20221123-1800 and the issue is there. |
Created attachment 271309 [details] Java snippet Initial setup: * Some code formatting rules, where "Off/On Tags" settings contain the following: Off tag: @formatter:off On tag: @formatter:on * Code fragment like in attached example.java. Steps: * Select complete Java function (see ). * Press Ctrl-D ("Duplicate lines") Actual: Newly inserted lines are formatted not taking into account "@formatter:off" directive. Expected: As given lines are already formatted according to formatting rules, the lines are duplicated literally.