Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
all:
cd padre && cargo build

clean:
cd padre && cargo clean
65 changes: 7 additions & 58 deletions autoload/padre/debugger.vim
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function! padre#debugger#Debug(...)
endfunction

function! padre#debugger#Run()
call padre#socket#Send({"cmd": "run"}, function('padre#debugger#RunCallback'))
call padre#socket#Send({"cmd": "run"}, function('padre#debugger#GenericCallback'))
endfunction

function! padre#debugger#Stop()
Expand All @@ -161,7 +161,7 @@ function! padre#debugger#Stop()
endfunction

function! s:SetBreakpointInDebugger(line, file)
call padre#socket#Send({"cmd": "breakpoint", "file": a:file, "line": str2nr(a:line)}, function('padre#debugger#BreakpointCallback'))
call padre#socket#Send({"cmd": "breakpoint", "file": a:file, "line": str2nr(a:line)}, function('padre#debugger#GenericCallback'))
endfunction

function! padre#debugger#Breakpoint()
Expand All @@ -173,19 +173,19 @@ function! padre#debugger#Breakpoint()
endfunction

function! padre#debugger#StepIn()
call padre#socket#Send({"cmd": "stepIn"}, function('padre#debugger#StepInCallback'))
call padre#socket#Send({"cmd": "stepIn"}, function('padre#debugger#GenericCallback'))
endfunction

function! padre#debugger#StepOver()
call padre#socket#Send({"cmd": "stepOver"}, function('padre#debugger#StepOverCallback'))
call padre#socket#Send({"cmd": "stepOver"}, function('padre#debugger#GenericCallback'))
endfunction

function! padre#debugger#PrintVariable(variable)
call padre#socket#Send({"cmd": "print", "variable": a:variable}, function('padre#debugger#PrintVariableCallback'))
call padre#socket#Send({"cmd": "print", "variable": a:variable}, function('padre#debugger#GenericCallback'))
endfunction

function! padre#debugger#Continue()
call padre#socket#Send({"cmd": "continue"}, function('padre#debugger#ContinueCallback'))
call padre#socket#Send({"cmd": "continue"}, function('padre#debugger#GenericCallback'))
endfunction

""""""""""""""""
Expand All @@ -198,63 +198,12 @@ function! padre#debugger#SignalPADREStarted()
endfor
endfunction

function! padre#debugger#RunCallback(channel_id, data)
function! padre#debugger#GenericCallback(channel_id, data)
if a:data['status'] != 'OK'
call padre#debugger#Log(2, 'Error: ' . string(a:data))
return
endif

if has_key(a:data, 'pid')
call padre#debugger#Log(4, 'Process ' . a:data['pid'] . ' Running')
endif
endfunction

function! padre#debugger#BreakpointCallback(channel_id, data)
if a:data['status'] == 'OK'
elseif a:data['status'] == 'PENDING'
call padre#debugger#Log(4, 'Breakpoint pending')
else
call padre#debugger#Log(2, 'Error: ' . string(a:data))
endif
endfunction

function! padre#debugger#BreakpointSet(fileName, lineNum)
let l:msg = 'Breakpoint set file=' . a:fileName . ', line=' . a:lineNum
call padre#debugger#Log(4, l:msg)
endfunction

function! padre#debugger#StepInCallback(channel_id, data)
if a:data['status'] != 'OK'
call padre#debugger#Log(2, 'Error: ' . string(a:data))
endif
endfunction

function! padre#debugger#StepOverCallback(channel_id, data)
if a:data['status'] != 'OK'
call padre#debugger#Log(2, 'Error: ' . string(a:data))
endif
endfunction

function! padre#debugger#ContinueCallback(channel_id, data)
if a:data['status'] != 'OK'
call padre#debugger#Log(2, 'Error: ' . string(a:data))
endif
endfunction

function! padre#debugger#PrintVariableCallback(channel_id, data)
let l:status = remove(a:data, 'status')
if l:status != 'OK'
call padre#debugger#Log(2, 'Error printing variable: ' . string(a:data))
return
endif

let l:variable_name = remove(a:data, 'variable')

execute "let l:json = system('python -m json.tool', '" . substitute(json_encode(a:data), "'", "''", "g") . "')"
let l:msg = 'Variable ' . l:variable_name . "=\n" . l:json
call padre#debugger#Log(4, l:msg)
endfunction

function! padre#debugger#JumpToPosition(file, line)
let l:msg = 'Stopped file=' . a:file . ' line=' . a:line
call padre#debugger#Log(4, l:msg)
Expand Down
3 changes: 2 additions & 1 deletion ci/install-rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ steps:
- script: |
set -e
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
echo "##vso[task.setvariable variable=PATH;]$PATH:$HOME/.cargo/bin"
echo "##vso[task.setvariable variable=PATH;]$HOME/.cargo/bin:$PATH"
rustup update
displayName: Install rust

- script: |
Expand Down
Loading