diff --git a/ale_linters/cs/omnisharp.vim b/ale_linters/cs/omnisharp.vim index 9b87b1f6c..140f7e02a 100644 --- a/ale_linters/cs/omnisharp.vim +++ b/ale_linters/cs/omnisharp.vim @@ -27,9 +27,9 @@ function! ale_linters#cs#omnisharp#GetCommand(bufnum) abort let linter = OmniSharp#util#path_join(['python', 'ale_lint.py']) let host = OmniSharp#GetHost(a:bufnum) let cmd = printf( - \ '%%e %s --filename %%s --host %s --level %s --cwd %s --delimiter %s', + \ '%%e %s --filename %%s --host %s --level %s --cwd %s --delimiter %s --encoding %s', \ ale#Escape(linter), ale#Escape(host), ale#Escape(g:OmniSharp_loglevel), - \ ale#Escape(getcwd()), ale#Escape(s:delimiter)) + \ ale#Escape(getcwd()), ale#Escape(s:delimiter), &encoding) if g:OmniSharp_translate_cygwin_wsl let cmd = cmd . ' --translate' endif diff --git a/ftplugin/cs/OmniSharp.vim b/ftplugin/cs/OmniSharp.vim index e0d372ad6..244ab07b9 100644 --- a/ftplugin/cs/OmniSharp.vim +++ b/ftplugin/cs/OmniSharp.vim @@ -52,10 +52,6 @@ command! -buffer -bar OmniSharpOpenPythonLog call OmniShar command! -buffer -bar OmniSharpRename call OmniSharp#Rename() command! -buffer -bar OmniSharpRestartAllServers call OmniSharp#RestartAllServers() command! -buffer -bar OmniSharpRestartServer call OmniSharp#RestartServer() -command! -buffer -bar OmniSharpRunAllTests call OmniSharp#RunTests('all') -command! -buffer -bar OmniSharpRunLastTests call OmniSharp#RunTests('last') -command! -buffer -bar OmniSharpRunTestFixture call OmniSharp#RunTests('fixture') -command! -buffer -bar OmniSharpRunTests call OmniSharp#RunTests('single') command! -buffer -bar OmniSharpSignatureHelp call OmniSharp#SignatureHelp() command! -buffer -bar -nargs=? -complete=file OmniSharpStartServer call OmniSharp#StartServer() command! -buffer -bar OmniSharpStopAllServers call OmniSharp#StopAllServers() @@ -99,10 +95,6 @@ let b:undo_ftplugin .= ' \| delcommand OmniSharpStopAllServers \| delcommand OmniSharpStopServer \| delcommand OmniSharpTypeLookup -\| delcommand OmniSharpRunAllTests -\| delcommand OmniSharpRunLastTests -\| delcommand OmniSharpRunTestFixture -\| delcommand OmniSharpRunTests \ \| setlocal omnifunc< errorformat< makeprg<' diff --git a/python/ale_lint.py b/python/ale_lint.py index aae9a2e89..c0229260f 100755 --- a/python/ale_lint.py +++ b/python/ale_lint.py @@ -50,16 +50,18 @@ def main(): choices=log_levels.keys(), default='info') parser.add_argument('--translate', action='store_true', help="If provided, translate cygwin/wsl paths") + parser.add_argument('--encoding', required=True, + help="Encoding for output") args = parser.parse_args() logger = _setup_logging(log_levels[args.level]) try: do_codecheck(logger, args.filename.strip(), args.host, args.cwd, - args.translate, args.delimiter) + args.translate, args.delimiter, args.encoding) except Exception as e: logger.exception("Error doing codecheck") -def do_codecheck(logger, filename, host, cwd, translate, delimiter): +def do_codecheck(logger, filename, host, cwd, translate, delimiter, encoding): ctx = UtilCtx( buffer_name=filename, translate_cygwin_wsl=translate, @@ -74,7 +76,8 @@ def do_codecheck(logger, filename, host, cwd, translate, delimiter): keys = ['filename', 'lnum', 'col', 'type', 'subtype', 'text'] for item in quickfixes: - print(delimiter.join([str(item.get(k, '')) for k in keys])) + s = delimiter.join([str(item.get(k, '')) for k in keys]) + '\n' + sys.stdout.buffer.write(s.encode(encoding)) if __name__ == '__main__':