Fix tracebacks when the debug adapter dies very quickly
This commit is contained in:
parent
866e6fe9b1
commit
37fefafe35
4 changed files with 28 additions and 14 deletions
|
|
@ -879,7 +879,11 @@ class DebugSession( object ):
|
|||
status )
|
||||
self.Clear()
|
||||
|
||||
self._connection.Reset()
|
||||
if self._connection is not None:
|
||||
# Can be None if the server dies _before_ StartDebugSession vim function
|
||||
# returns
|
||||
self._connection.Reset()
|
||||
|
||||
self._stackTraceView.ConnectionClosed()
|
||||
self._variablesView.ConnectionClosed()
|
||||
self._outputView.ConnectionClosed()
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from vimspector import utils
|
||||
from vimspector import utils,install
|
||||
|
||||
import vim
|
||||
import json
|
||||
|
|
@ -49,10 +49,7 @@ class OutputView( object ):
|
|||
for b in set( BUFFER_MAP.values() ):
|
||||
self._CreateBuffer( b )
|
||||
|
||||
self._CreateBuffer(
|
||||
'Vimspector',
|
||||
file_name = vim.eval( 'expand( "~/.vimspector.log" )' ) )
|
||||
|
||||
self._CreateBuffer( 'Vimspector', file_name = utils.LOG_FILE )
|
||||
self._ShowOutput( 'Console' )
|
||||
|
||||
def Print( self, categroy, text ):
|
||||
|
|
@ -161,6 +158,10 @@ class OutputView( object ):
|
|||
|
||||
if file_name is not None:
|
||||
assert cmd is None
|
||||
if install.GetOS() == "windows":
|
||||
# FIXME: Can't display fiels in windows (yet?)
|
||||
return
|
||||
|
||||
cmd = [ 'tail', '-F', '-n', '+1', '--', file_name ]
|
||||
|
||||
if cmd is not None:
|
||||
|
|
|
|||
|
|
@ -23,8 +23,10 @@ import string
|
|||
import functools
|
||||
|
||||
|
||||
_log_handler = logging.FileHandler( os.path.expanduser( '~/.vimspector.log' ),
|
||||
mode = 'w' )
|
||||
LOG_FILE = os.path.expanduser( os.path.join( '~', '.vimspector.log') )
|
||||
|
||||
_log_handler = logging.FileHandler( LOG_FILE, mode = 'w' )
|
||||
|
||||
_log_handler.setFormatter(
|
||||
logging.Formatter( '%(asctime)s - %(levelname)s - %(message)s' ) )
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue