Skip to content

SourceAnchors for external files should know the line ending convention ? #1538

@NicolasAnquetil

Description

@NicolasAnquetil

If a model is created on a different machine (and OS) than where it is used, there could be an issue with lineEndings

For exmaple:

  • build a model on a CI (running linux). LineEndings is LF
  • clone the project on Windows (with git config --global core.autocrlf = true, git converts all lineEndings to CRLF)
  • now the sourceAnchors are off 1 additional character for each line
    That is to say on line 1 they are ok, on line 2 they are 1 character too short, on line 3: 2 characters short,..., on line 1000, the source anchor is completely wrong
  • so of course displaying the sourceText or computing clones become a problem

The only solution I see is that the model knows what convention was used, and moose figure out what convention is used in the files it opens, and it adjusts the position if the 2 do not match

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions