Wrong line numbers break tests relying on sourcemap information
We are trying to integrate Gemini screenshot testing with coverage information which itself relies on the generated sourcemaps. The coverage report is not generated correctly because of wrong line numbers, which we traced back to libsass's sourcemap generation. The behavior differs from Ruby Sass, which generates the correct sourcemaps line numbers and offsets.
When compiling the SCSS source with line number information, the line numbers inserted in the generated source are correct, whereas the line numbers included in the sourcemap are wrong. Both rules point to line number 1:
input.scss
.foo { // line 1
background: red;
&-bar { // line 4
background: green;
}
}
libsass 3.3.6
sassc -l --sourcemap test.scss test.css
/* line 1, [...]/test.scss */
.foo {
background: red; }
/* line 4, [...]/test.scss */
.foo-bar {
background: green; }
/*# sourceMappingURL=test.css.map */

ruby sass 3.4.22
sass -l --sourcemap=file test.scss test.css
/* line 1, test.scss */
.foo {
background: red; }
/* line 4, test.scss */
.foo-bar {
background: green; }
/*# sourceMappingURL=test.css.map */

version info:
$ sassc --version
sassc: 3.3.6-24-geee6
libsass: 3.3.6-144-g50a6-dirty
sass2scss: 1.1.0
sass: 3.4
Help needed?
I'm currently debugging libsass trying to find the source of the problem. Is this issue already known? If not, I would investigate and try to fix the bug.