FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Incorrect line number for errors when using imports · Issue #6 · marceloverdijk/lesscss-java · GitHub

This repository was archived by the owner on Jan 9, 2019. It is now read-only.

Repository navigation

This repository was archived by the owner on Jan 9, 2019. It is now read-only.

Incorrect line number for errors when using imports #6

Description

When compiling a file that @imports another LESS file, lesscss-java reports the wrong line number for syntax errors.

For example, suppose I have the following files:

parent.less

@import "include.less";

body { !@#$% syntax error ^&*) }

include.less

.some-mixin ( @param ) {
    /* ... */
}

.another-mixin ( @param ) {
    /* ... */
}

lesscss-java throws a LessException with the error message "Syntax Error on line 9" when the error is really on line 3.

Looking through the source code, it appears that this behavior is the result of concatenating the parent file with all of its imports in LessSource.resolveImports() (LessSource.java, line 147, which gets fed in to LessCompiler.java, line 302).

Is there a technical reason for this design choice? It would be really nice if we could let less.js take care of resolving imports and reporting the correct line number for syntax errors.

(Credit goes to micmcg for pointing this out.)

Thanks!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL