diff --git a/autoload/kendoui.vim b/autoload/kendoui.vim index a762367..02f149c 100644 --- a/autoload/kendoui.vim +++ b/autoload/kendoui.vim @@ -14,12 +14,44 @@ if !exists("s:kui_command") endif function! kendoui#version() - return '0.0.1' + return '0.0.2' endfunction function! s:Lint(mode) + " clear the current message, if any silent !clear - execute "!" . s:kui_command . " --".a:mode . " " . bufname("%") + + " make sure kendo-lint is installed + if !executable(s:kui_command) + echo "D'OH! The kendo-lint tool is not installed or could not be found. :(" + echo "Please run 'npm install -g kendo-lint' to install it." + return + endif + + " run the kendo-lint tool in the correct mode + let l:result = system(s:kui_command . " --".a:mode . " " . bufname("%")) + + if result != "" + " example error message: + " imagegallery.js[4,2]: Option stepUp2TheStreets not found + set errorformat=%f[%l\\,%c]:\ %m + + " load the error results in to the location list + " and make them clickable, to go to that location + lexpr result + laddexpr "" + lwindow + else + + " clear the location list, close it and show + " a friendly message about how awesome you are! + lexpr! "" + lclose + echo "Kendo UI Lint: No Errors Found! :)" + + endif + + endfunction function! kendoui#KUILintJS() diff --git a/changelog.md b/changelog.md index 0dae3b6..efd733c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,3 +1,9 @@ -## v0.0.1 +### v0.0.2 [view commit logs](https://github.com/kendo-labs/kendoui-lint.vim/compare/v0.0.1...v0.0.2) + +* Show the list of errors in the "location list", clickable to go to that location +* Clear and hide the "location list" if no errors are found +* If KendoUI-Lint is not installed, show a message saying so + +### v0.0.1 * Initial Release