Breakpoints returned from servers rarely have source set
For line-breakpoints we already know it, so just use what we said originally. For method breakpoints, we have no clue. While some servers return a line, it could be in any file, so we just ignore them.
This commit is contained in:
parent
d814091692
commit
9d9c2214f3
2 changed files with 18 additions and 16 deletions
|
|
@ -17,6 +17,7 @@ import logging
|
|||
import vim
|
||||
import json
|
||||
import os
|
||||
import functools
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
|
|
@ -213,8 +214,8 @@ class DebugSession( object ):
|
|||
'arguments': self._configuration[ 'configuration' ]
|
||||
} )
|
||||
|
||||
def _UpdateBreakpoints( self, message ):
|
||||
self._codeView.AddBreakpoints( message[ 'body' ][ 'breakpoints' ] )
|
||||
def _UpdateBreakpoints( self, source, message ):
|
||||
self._codeView.AddBreakpoints( source, message[ 'body' ][ 'breakpoints' ] )
|
||||
self._codeView.ShowBreakpoints()
|
||||
|
||||
def OnEvent_initialized( self, message ):
|
||||
|
|
@ -222,15 +223,16 @@ class DebugSession( object ):
|
|||
|
||||
for file_name, line_breakpoints in self._breakpoints.items():
|
||||
breakpoints = [ { 'line': line } for line in line_breakpoints.keys() ]
|
||||
source = {
|
||||
'name': os.path.basename( file_name ),
|
||||
'path': file_name,
|
||||
}
|
||||
self._connection.DoRequest(
|
||||
self._UpdateBreakpoints,
|
||||
functools.partial( self._UpdateBreakpoints, source ),
|
||||
{
|
||||
'command': 'setBreakpoints',
|
||||
'arguments': {
|
||||
'source': {
|
||||
'name': os.path.basename( file_name ),
|
||||
'path': file_name,
|
||||
},
|
||||
'source': source,
|
||||
'breakpoints': breakpoints,
|
||||
'lines': [ line for line in line_breakpoints.keys() ],
|
||||
'sourceModified': False,
|
||||
|
|
@ -239,7 +241,7 @@ class DebugSession( object ):
|
|||
)
|
||||
|
||||
self._connection.DoRequest(
|
||||
self._UpdateBreakpoints,
|
||||
functools.partial( self._UpdateBreakpoints, None ),
|
||||
{
|
||||
'command': 'setFunctionBreakpoints',
|
||||
'arguments': {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue