Fixed single line comments breaking the whole thing

This commit is contained in:
Noah Santschi-Cooney 2018-06-16 01:09:01 +01:00
parent d8e374496b
commit 7259283c6e
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48

View file

@ -61,14 +61,13 @@ export function preprocess(document: TextDocument) {
const line = lines[i]
if (line.includes('/*')) inComment = true
if (line.includes('*/')) inComment = false
if (line.trim().startsWith('//')) break
if (line.trim().startsWith('//')) continue
if (!inComment && reVersion.test(line)) {
lines.splice(i + 1, 0, include)
break
}
if (i === lines.length - 1) lines.splice(0, 0, include)
}
//console.log(lines.join('\n'))
//const root = document.uri.replace(/^file:\/\//, '').replace(conf.minecraftPath, '').replace(path.basename(document.uri), '')
lint(lines.join('\n'), document.uri)