mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-08-31 05:47:22 +00:00
Fixed another line number issue. God they practically make themselves
This commit is contained in:
parent
6fd02abd9d
commit
2d5d074157
1 changed files with 4 additions and 2 deletions
|
@ -289,15 +289,17 @@ function processErrors(out: string, docURI: string, diagnostics: Map<string, Dia
|
|||
msg: match[4]
|
||||
}
|
||||
|
||||
const fileName = error.file.length - 1 ? error.file : docURI
|
||||
|
||||
const diag: Diagnostic = {
|
||||
severity: error.type,
|
||||
// had to do - 2 here instead of - 1, windows only perhaps?
|
||||
range: calcRange(error.line - (win ? 2 : 1), error.file.length - 1 ? error.file : docURI),
|
||||
range: calcRange(error.line - ((!hasDirective && includeGraph.get(fileName).parents.size === 0) ? 2 : 1), fileName),
|
||||
message: `Line ${error.line} ${replaceWords(error.msg)}`,
|
||||
source: 'mc-glsl'
|
||||
}
|
||||
|
||||
diagnostics.get(error.file.length - 1 ? error.file : docURI).push(diag)
|
||||
diagnostics.get(fileName).push(diag)
|
||||
|
||||
// if is an include, highlight an error in the parents line of inclusion
|
||||
propogateDiagnostic(error, diagnostics, hasDirective)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue