Skip to content

chore: set line.separator=\n in source-bearing bundles (step 2/3)#1353

Closed
joaodinissf wants to merge 1 commit into
chore/emit-lf-step-1from
chore/emit-lf-step-2
Closed

chore: set line.separator=\n in source-bearing bundles (step 2/3)#1353
joaodinissf wants to merge 1 commit into
chore/emit-lf-step-1from
chore/emit-lf-step-2

Conversation

@joaodinissf
Copy link
Copy Markdown
Collaborator

What

Step 2 of the LF-alignment stack. Fixes Eclipse-side emission (the IDE save path).

Adds .settings/org.eclipse.core.runtime.prefs to 59 source-bearing bundles (every bundle with a src/ directory that didn't already have one). Each new file is two lines:

eclipse.preferences.version=1
line.separator=\n

Why

EclipseResourceFileSystemAccess2 (the FSA Xtext uses when generating from inside Eclipse) honours the project's line.separator preference. Without it, the workspace default applies — on Windows that's CRLF — producing committed src-gen that fights .gitattributes and the project's LF convention.

This is the second layer of the same fix:

Only one bundle (ddk-configuration) had this preference before this PR, and step 1 fixed its previously-CRLF value. This PR propagates it to the remaining 59.

Excluded bundles (intentionally)

  • ddk-target, ddk-repository, *.feature bundles — no src/ directory, no code emission.

Stack

Stacked on chore/emit-lf-step-1 (#1352). When step 1 merges, GitHub auto-retargets this PR's base to master.

Verification

  • mvn clean verify -T 3C -f ./ddk-parent/pom.xml is expected to pass — Maven ignores Eclipse-only .settings/ content.
  • After merge of steps 1+2, a Windows reviewer regenerating any .check / .checkcfg / .scope / .format / .export file in Eclipse should produce LF output natively (without the LfNormalizingFileSystemAccess decorator). This is the precondition for step 3.

Add `.settings/org.eclipse.core.runtime.prefs` with `line.separator=\n`
to every dsl-devkit bundle that has a `src/` directory and didn't
already have one.

This fixes Eclipse-side emission: `EclipseResourceFileSystemAccess2`
honours the per-project `line.separator` preference when writing
generated files inside Eclipse. Without it, the workspace default
applies — CRLF on Windows by default — producing committed src-gen
that fights `.gitattributes` and the project's LF convention.

Step 1 of this stack fixed the MWE2 (Maven-side) path. This commit
fixes the Eclipse (IDE-side) path. Step 3 will then be able to remove
the `LfNormalizingFileSystemAccess` decorator, which exists purely to
fight the now-superseded misconfiguration.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@andrewL-avlq
Copy link
Copy Markdown
Collaborator

The additional preferences files should not be needed as they already exist as links in the workspace to the preferences in ddk-configuration.

joaodinissf added a commit that referenced this pull request May 20, 2026
Delete `LfNormalizingFileSystemAccess.java` and remove its wrap calls
from `CheckGenerator.xtend` and `CheckCfgGenerator.xtend`.

The decorator was introduced in PR #1331 as a post-hoc normaliser
against CRLF leaks from various emission paths. After:

- step 1 of this stack (#1352) — `.mwe2` `lineDelimiter` and
  `ddk-configuration` runtime prefs both flipped to `\n`
- step 2 (#1353) — `line.separator=\n` propagated to every
  source-bearing bundle's `.settings/org.eclipse.core.runtime.prefs`
- the preceding commit on this branch — `KeywordAnalysisHelper` no
  longer uses `PrintWriter.println()`

…every emission path now produces LF natively. The wrapper is no-op
work and the conditional `instanceof IFileSystemAccess2` cast it
introduced is no longer needed.

Closes #1345 — the planned extension of the same wrapper to
`Scope` / `Format` / `Export` generators is no longer needed for the
same reason. Those generators are already clean of `Strings.newLine()`,
`System.lineSeparator()`, and hardcoded `"\r\n"` emission (audited).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants