Removed single use function and the if check in preprocess

This commit is contained in:
Noah Santschi-Cooney 2018-06-13 01:09:59 +01:00
parent 8c3f0e3e2c
commit fcab989bb7
No known key found for this signature in database
GPG key ID: 3B22282472C8AE48

View file

@ -37,11 +37,9 @@ const tokens: {[key: string]: string} = {
'RIGHT_BRACE': '}' 'RIGHT_BRACE': '}'
} }
const matchesFilters = (s: string) => filters.some(reg => reg.test(s))
const filterMatches = (output: string) => output const filterMatches = (output: string) => output
.split('\n') .split('\n')
.filter(s => s.length > 1 && !matchesFilters(s)) .filter(s => s.length > 1 && !filters.some(reg => reg.test(s)))
.map(s => s.match(reDiag)) .map(s => s.match(reDiag))
.filter(match => match && match.length === 4) .filter(match => match && match.length === 4)
@ -55,8 +53,6 @@ const replaceWord = (msg: string) => {
} }
export function preprocess(document: TextDocument) { export function preprocess(document: TextDocument) {
if (conf.minecraftPath === 'shaderpacks') return
//const root = document.uri.replace(/^file:\/\//, '').replace(conf.minecraftPath, '').replace(path.basename(document.uri), '') //const root = document.uri.replace(/^file:\/\//, '').replace(conf.minecraftPath, '').replace(path.basename(document.uri), '')
lint(document.getText(), document.uri) lint(document.getText(), document.uri)
} }