Missing source reference for comments
aldhsu opened this issue ยท 3 comments
aldhsu commented
Expected
Comments always have source
From postcss-scss parser
Comment {
raws: { before: '\n', inline: true, left: ' ', right: ' ', text: 'a' },
type: 'comment',
parent:
Root {
raws: { semicolon: false, after: '' },
type: 'root',
nodes: [ [Circular], [Object] ],
source: { input: [Object], start: [Object] } },
source:
{ start: { line: 2, column: 1 },
input: Input { css: '\n// a \n/* b */', id: '<input css 4>' },
end: { line: 2, column: 5 } },
text: 'a' }
Actual
Comments do not have source
From snapshot:
postcss-sass/__tests__/__snapshots__/parse.test.js.snap
Lines 1147 to 1156 in 0e6edad
Potential Problem
http://api.postcss.org/global.html#source
If you create a node manually (e.g., with postcss.decl()), that node will not have a source property and will be absent from the source map.
Lines 343 to 351 in 0e6edad
This is addressed in the other ndoe types but not in comments.
Grawl commented
AleshaOleg commented
Hey @aldhsu. Thanks for reporting, I'll try to fix this today.
AleshaOleg commented