Skip to content

Commit

Permalink
Allow User to set log directory
Browse files Browse the repository at this point in the history
If User doesn't specify, use a directory that should be unique enough to not cause overlap of logs for users running multiple sessions
  • Loading branch information
corbob committed Apr 18, 2019
1 parent 2e00f92 commit b759a72
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions plugin/coc-pses.vim
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ let s:vimscript_dir = expand('<sfile>:p:h')
let g:pses_dir = resolve(expand(s:vimscript_dir . '/../PowerShellEditorServices/PowerShellEditorServices'))
let g:pses_script = g:pses_dir . "/Start-EditorServices.ps1"

" Let the user specify the log directory for PSES.
" If the user doesn't specify a location, use the root of vov-pses in a .pses
" directory.
if(!exists("g:pses_logs_dir"))
let g:pses_logs_dir = resolve(expand(s:vimscript_dir . '/../.pses/logs/' . strftime('%Y%m%d') . '-' . getpid()))
endif

if(!exists("g:pses_powershell_executable"))
let g:pses_powershell_executable = "powershell"
if(executable("pwsh"))
Expand All @@ -23,12 +30,12 @@ function! s:PSESSetup ()
\ "-HostName", "coc.vim",
\ "-HostProfileId", "0",
\ "-HostVersion", "2.0.0",
\ "-LogPath", g:pses_dir . "/log.txt",
\ "-LogPath", g:pses_logs_dir . "/log.txt",
\ "-LogLevel", "Diagnostic",
\ "-FeatureFlags", "[]",
\ "-BundledModulesPath", g:pses_dir . "/../",
\ "-Stdio",
\ "-SessionDetailsPath", g:pses_dir . "/session"
\ "-SessionDetailsPath", g:pses_logs_dir . "/session"
\ ]
\ }
\ }
Expand Down

0 comments on commit b759a72

Please sign in to comment.