Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/OmniSharp/omnisharp-vim i…
Browse files Browse the repository at this point in the history
…nto support_folders
  • Loading branch information
cedarbaum committed Oct 7, 2018
2 parents b11b51a + ae774bd commit 74a7f03
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ale_linters/cs/omnisharp.vim
Expand Up @@ -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
Expand Down
8 changes: 0 additions & 8 deletions ftplugin/cs/OmniSharp.vim
Expand Up @@ -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(<q-args>)
command! -buffer -bar OmniSharpStopAllServers call OmniSharp#StopAllServers()
Expand Down Expand Up @@ -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<'

Expand Down
9 changes: 6 additions & 3 deletions python/ale_lint.py
Expand Up @@ -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,
Expand All @@ -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__':
Expand Down

0 comments on commit 74a7f03

Please sign in to comment.