|
@@ -147,6 +147,30 @@ def AddDiagnosticSyntaxMatch( line_num,
|
|
|
group, line_num, column_num, line_end_num, column_end_num ) )
|
|
|
|
|
|
|
|
|
+def SetLocationList( diagnostics ):
|
|
|
+ """Diagnostics should be in qflist format; see ":h setqflist" for details."""
|
|
|
+ vim.eval( 'setloclist( 0, {0} )'.format( json.dumps( diagnostics ) ) )
|
|
|
+
|
|
|
+
|
|
|
+def ConvertDiagnosticsToQfList( diagnostics ):
|
|
|
+ def ConvertDiagnosticToQfFormat( diagnostic ):
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ location = diagnostic[ 'location' ]
|
|
|
+ return {
|
|
|
+ 'bufnr' : GetBufferNumberForFilename( location[ 'filepath' ] ),
|
|
|
+ 'lnum' : location[ 'line_num' ] + 1,
|
|
|
+ 'col' : location[ 'column_num' ] + 1,
|
|
|
+ 'text' : diagnostic[ 'text' ],
|
|
|
+ 'type' : diagnostic[ 'kind' ],
|
|
|
+ 'valid' : 1
|
|
|
+ }
|
|
|
+
|
|
|
+ return [ ConvertDiagnosticToQfFormat( x ) for x in diagnostics ]
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
def LoadDictIntoVimGlobals( new_globals, overwrite = True ):
|