mirror of
https://github.com/Strum355/mcshader-lsp.git
synced 2025-07-15 23:35:31 +00:00
Error now highlights entire line.
This commit is contained in:
parent
a025355d8d
commit
8d1bf4ff48
3 changed files with 9 additions and 4 deletions
|
@ -7,5 +7,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|||
## [Unreleased]
|
||||
|
||||
### Added
|
||||
- Deletion of temp files when VSCode closed.
|
||||
- Basic linting with highlighting.
|
||||
- Support for .fsh, .vsh and .gsh files
|
||||
- Support for .fsh, .vsh, .glsl and .gsh files.
|
|
@ -10,12 +10,14 @@ Development requirements (did I miss any? Submit a PR!):
|
|||
|
||||
Fork the repo (you are using [SSH keys](https://help.github.com/articles/connecting-to-github-with-ssh/), right?):
|
||||
|
||||
`git@github.com:Strum355/vscode-mc-shader.git`
|
||||
`git clone git@github.com:Strum355/vscode-mc-shader.git`
|
||||
|
||||
Install dependencies:
|
||||
|
||||
`cd vscode-mc-shader && npm i`
|
||||
|
||||
Follow [this](https://code.visualstudio.com/docs/extensions/overview) link to learn your way around making extensions.
|
||||
|
||||
## Submitting a Pull Request
|
||||
|
||||
Please adhere to the following guidelines before submitting a pull request:
|
||||
|
|
|
@ -160,7 +160,8 @@ export default class GLSLProvider implements vscode.CodeActionProvider {
|
|||
return
|
||||
}
|
||||
|
||||
const [lineNum, message] = matches.slice(1,3)
|
||||
const [lineString, message] = matches.slice(1,3)
|
||||
const lineNum = parseInt(lineString)
|
||||
|
||||
// Default to error
|
||||
let severity: vscode.DiagnosticSeverity = vscode.DiagnosticSeverity.Error
|
||||
|
@ -169,7 +170,8 @@ export default class GLSLProvider implements vscode.CodeActionProvider {
|
|||
severity = vscode.DiagnosticSeverity.Warning
|
||||
}
|
||||
|
||||
const range = new vscode.Range(parseInt(lineNum) - 1, 0, parseInt(lineNum) - 1, 0)
|
||||
const eol = document.lineAt(lineNum - 1).text.length
|
||||
const range = new vscode.Range(lineNum - 1, 0, lineNum - 1, eol - 1)
|
||||
diags.push(new vscode.Diagnostic(range, message, severity))
|
||||
})
|
||||
this.diagnosticCollection.set(document.uri, diags)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue