Thanks to visit codestin.com
Credit goes to github.com

Skip to content

EditorConfig validator: support for line/column, offset info with ParsingException #9

@angelozerr

Description

@angelozerr

It should be cool if we could have an utility method validate which waits a String content of an editorconfig and throws ParsingException when this content is not well formatted:

public class  EditorConfig {

....
  public void validate(String editorConfigContent) throws ParsingException {
    // here parse editorConfigContent and throws ParsingException  with line/column, offset info
  }
}

Here a sample with miss of close of [ for section names:

[*]
charset = utf-8

[*.md // <- here there is an error because section is not closed

The exception ParsingException should contains offset and line/column info where there is an error.

With this utility method validate, any IDE could support validation with marker.

Many thanks!

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