<commit_before>
"Set a default value for the server address
if !exists('g:OmniSharp_host')
	let g:OmniSharp_host='http://localhost:2000'
endif

augroup plugin-OmniSharp
	autocmd! * <buffer
	" Auto syntax check.
	autocmd BufWritePre <buffer>
    \   if g:OmniSharp_BufWritePreSyntaxCheck
    \|      let b:OmniSharp_SyntaxChecked = 1
	\|		call OmniSharp#FindSyntaxErrors()
	\|	else
	\|		let b:OmniSharp_SyntaxChecked = 0
	\|	endif

	autocmd CursorHold <buffer>
	\	if g:OmniSharp_CursorHoldSyntaxCheck && !get(b:, "OmniSharp_SyntaxChecked", 0)
	\|		let b:OmniSharp_SyntaxChecked = 1
	\|		call OmniSharp#FindSyntaxErrors()
	\|	endif

	autocmd BufLeave <buffer>
	\ 	if !pumvisible()
	\|		call OmniSharp#UpdateBuffer()
	\|	endif	
	
augroup END

" Commands
command! -buffer -bar OmniSharpFindType            call ctrlp#init(findtype#id())
command! -buffer -bar OmniSharpFindSymbol          call ctrlp#init(findsymbols#id())
command! -buffer -bar OmniSharpFindMembers         call OmniSharp#FindMembers()
command! -buffer -bar OmniSharpFindUsages          call OmniSharp#FindUsages()
command! -buffer -bar OmniSharpFindImplementations call OmniSharp#FindImplementations()
command! -buffer -bar OmniSharpGotoDefinition      call OmniSharp#GotoDefinition()
command! -buffer -bar OmniSharpFindSyntaxErrors    call OmniSharp#FindSyntaxErrors()
command! -buffer -bar OmniSharpGetCodeActions      call OmniSharp#GetCodeActions()
command! -buffer -bar OmniSharpTypeLookup          call OmniSharp#TypeLookupWithoutDocumentation()
command! -buffer -bar OmniSharpDocumentation       call OmniSharp#TypeLookupWithDocumentation()
command! -buffer -bar OmniSharpBuild               call OmniSharp#Build()
command! -buffer -bar OmniSharpBuildAsync          call OmniSharp#BuildAsync()
command! -buffer -bar OmniSharpRename              call OmniSharp#Rename()
command! -buffer -bar OmniSharpReloadSolution      call OmniSharp#ReloadSolution()
command! -buffer -bar OmniSharpCodeFormat          call OmniSharp#CodeFormat()
command! -buffer -bar OmniSharpStartServer         call OmniSharp#StartServer()
command! -buffer -bar OmniSharpStopServer          call OmniSharp#StopServer()
command! -buffer -bar OmniSharpAddToProject        call OmniSharp#AddToProject()
command! -buffer -bar OmniSharpHighlightTypes      call OmniSharp#EnableTypeHighlighting()
command! -buffer -bar OmniSharpRunTests      	   call OmniSharp#RunTests('single')
command! -buffer -bar OmniSharpRunTestFixture      call OmniSharp#RunTests('fixture')
command! -buffer -bar OmniSharpRunAllTests         call OmniSharp#RunTests('all')
command! -buffer -bar OmniSharpRunLastTests        call OmniSharp#RunTests('last')


command! -buffer -nargs=1 OmniSharpRenameTo
\	call OmniSharp#RenameTo(<q-args>)

command! -buffer -nargs=1 -complete=file
\	OmniSharpStartServerSolution
\	call OmniSharp#StartServerSolution(<q-args>)

command! -buffer -nargs=1 -complete=file OmniSharpAddReference         
\   call OmniSharp#AddReference(<q-args>)

setlocal omnifunc=OmniSharp#Complete



if exists('b:undo_ftplugin')
	let b:undo_ftplugin .= ' | '
else
	let b:undo_ftplugin = ''
endif
let b:undo_ftplugin .= '
\	execute "autocmd! plugin-OmniSharp * <buffer>"
\
\|	delcommand OmniSharpFindType
\|	delcommand OmniSharpFindSymbol
\|	delcommand OmniSharpFindUsages
\|	delcommand OmniSharpFindImplementations
\|	delcommand OmniSharpGotoDefinition
\|	delcommand OmniSharpFindSyntaxErrors
\|	delcommand OmniSharpGetCodeActions
\|	delcommand OmniSharpTypeLookup
\|	delcommand OmniSharpBuild
\|	delcommand OmniSharpBuildAsync
\|	delcommand OmniSharpRename
\|	delcommand OmniSharpReloadSolution
\|	delcommand OmniSharpCodeFormat
\|	delcommand OmniSharpStartServer
\|	delcommand OmniSharpStopServer
\|	delcommand OmniSharpAddToProject
\
\|	delcommand OmniSharpRenameTo
\|	delcommand OmniSharpStartServerSolution
\|	delcommand OmniSharpAddReference
\|  delcommand OmniSharpRunTests
\|  delcommand OmniSharpRunTestFixture
\|  delcommand OmniSharpRunAllTests
\|  delcommand OmniSharpRunLastTests
\
\|	setlocal omnifunc< errorformat< makeprg<'
<commit_msg>omnifunc shouldn't be set here as it could interfere with other plugins<commit_after>"Set a default value for the server address
if !exists('g:OmniSharp_host')
	let g:OmniSharp_host='http://localhost:2000'
endif

augroup plugin-OmniSharp
	autocmd! * <buffer
	" Auto syntax check.
	autocmd BufWritePre <buffer>
    \   if g:OmniSharp_BufWritePreSyntaxCheck
    \|      let b:OmniSharp_SyntaxChecked = 1
	\|		call OmniSharp#FindSyntaxErrors()
	\|	else
	\|		let b:OmniSharp_SyntaxChecked = 0
	\|	endif

	autocmd CursorHold <buffer>
	\	if g:OmniSharp_CursorHoldSyntaxCheck && !get(b:, "OmniSharp_SyntaxChecked", 0)
	\|		let b:OmniSharp_SyntaxChecked = 1
	\|		call OmniSharp#FindSyntaxErrors()
	\|	endif

	autocmd BufLeave <buffer>
	\ 	if !pumvisible()
	\|		call OmniSharp#UpdateBuffer()
	\|	endif	
	
augroup END

" Commands
command! -buffer -bar OmniSharpFindType            call ctrlp#init(findtype#id())
command! -buffer -bar OmniSharpFindSymbol          call ctrlp#init(findsymbols#id())
command! -buffer -bar OmniSharpFindMembers         call OmniSharp#FindMembers()
command! -buffer -bar OmniSharpFindUsages          call OmniSharp#FindUsages()
command! -buffer -bar OmniSharpFindImplementations call OmniSharp#FindImplementations()
command! -buffer -bar OmniSharpGotoDefinition      call OmniSharp#GotoDefinition()
command! -buffer -bar OmniSharpFindSyntaxErrors    call OmniSharp#FindSyntaxErrors()
command! -buffer -bar OmniSharpGetCodeActions      call OmniSharp#GetCodeActions()
command! -buffer -bar OmniSharpTypeLookup          call OmniSharp#TypeLookupWithoutDocumentation()
command! -buffer -bar OmniSharpDocumentation       call OmniSharp#TypeLookupWithDocumentation()
command! -buffer -bar OmniSharpBuild               call OmniSharp#Build()
command! -buffer -bar OmniSharpBuildAsync          call OmniSharp#BuildAsync()
command! -buffer -bar OmniSharpRename              call OmniSharp#Rename()
command! -buffer -bar OmniSharpReloadSolution      call OmniSharp#ReloadSolution()
command! -buffer -bar OmniSharpCodeFormat          call OmniSharp#CodeFormat()
command! -buffer -bar OmniSharpStartServer         call OmniSharp#StartServer()
command! -buffer -bar OmniSharpStopServer          call OmniSharp#StopServer()
command! -buffer -bar OmniSharpAddToProject        call OmniSharp#AddToProject()
command! -buffer -bar OmniSharpHighlightTypes      call OmniSharp#EnableTypeHighlighting()
command! -buffer -bar OmniSharpRunTests      	   call OmniSharp#RunTests('single')
command! -buffer -bar OmniSharpRunTestFixture      call OmniSharp#RunTests('fixture')
command! -buffer -bar OmniSharpRunAllTests         call OmniSharp#RunTests('all')
command! -buffer -bar OmniSharpRunLastTests        call OmniSharp#RunTests('last')


command! -buffer -nargs=1 OmniSharpRenameTo
\	call OmniSharp#RenameTo(<q-args>)

command! -buffer -nargs=1 -complete=file
\	OmniSharpStartServerSolution
\	call OmniSharp#StartServerSolution(<q-args>)

command! -buffer -nargs=1 -complete=file OmniSharpAddReference         
\   call OmniSharp#AddReference(<q-args>)


if exists('b:undo_ftplugin')
	let b:undo_ftplugin .= ' | '
else
	let b:undo_ftplugin = ''
endif
let b:undo_ftplugin .= '
\	execute "autocmd! plugin-OmniSharp * <buffer>"
\
\|	delcommand OmniSharpFindType
\|	delcommand OmniSharpFindSymbol
\|	delcommand OmniSharpFindUsages
\|	delcommand OmniSharpFindImplementations
\|	delcommand OmniSharpGotoDefinition
\|	delcommand OmniSharpFindSyntaxErrors
\|	delcommand OmniSharpGetCodeActions
\|	delcommand OmniSharpTypeLookup
\|	delcommand OmniSharpBuild
\|	delcommand OmniSharpBuildAsync
\|	delcommand OmniSharpRename
\|	delcommand OmniSharpReloadSolution
\|	delcommand OmniSharpCodeFormat
\|	delcommand OmniSharpStartServer
\|	delcommand OmniSharpStopServer
\|	delcommand OmniSharpAddToProject
\
\|	delcommand OmniSharpRenameTo
\|	delcommand OmniSharpStartServerSolution
\|	delcommand OmniSharpAddReference
\|  delcommand OmniSharpRunTests
\|  delcommand OmniSharpRunTestFixture
\|  delcommand OmniSharpRunAllTests
\|  delcommand OmniSharpRunLastTests
\
\|	setlocal omnifunc< errorformat< makeprg<'

{'fraction_non_alphanumeric': 0.08751529987760098, 'fraction_numerical': 0.0026927784577723377, 'mean_word_length': 4.823948681397006, 'pattern_counts': {'":': 0, '<': 25, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1042311', 'n_tokens_mistral': 2763, 'n_tokens_neox': 2536, 'n_words': 578}