Error now highlights entire line.

This commit is contained in:
Noah Santschi-Cooney 2018-05-19 19:30:04 +01:00
parent a025355d8d
commit 8d1bf4ff48
3 changed files with 9 additions and 4 deletions

View file

@ -7,5 +7,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
## [Unreleased] ## [Unreleased]
### Added ### Added
- Deletion of temp files when VSCode closed.
- Basic linting with highlighting. - Basic linting with highlighting.
- Support for .fsh, .vsh and .gsh files - Support for .fsh, .vsh, .glsl and .gsh files.

View file

@ -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?): 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: Install dependencies:
`cd vscode-mc-shader && npm i` `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 ## Submitting a Pull Request
Please adhere to the following guidelines before submitting a pull request: Please adhere to the following guidelines before submitting a pull request:

View file

@ -160,7 +160,8 @@ export default class GLSLProvider implements vscode.CodeActionProvider {
return return
} }
const [lineNum, message] = matches.slice(1,3) const [lineString, message] = matches.slice(1,3)
const lineNum = parseInt(lineString)
// Default to error // Default to error
let severity: vscode.DiagnosticSeverity = vscode.DiagnosticSeverity.Error let severity: vscode.DiagnosticSeverity = vscode.DiagnosticSeverity.Error
@ -169,7 +170,8 @@ export default class GLSLProvider implements vscode.CodeActionProvider {
severity = vscode.DiagnosticSeverity.Warning 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)) diags.push(new vscode.Diagnostic(range, message, severity))
}) })
this.diagnosticCollection.set(document.uri, diags) this.diagnosticCollection.set(document.uri, diags)