@@ -160,11 +160,6 @@ def __init__(self, **kwargs):
160
160
# the kernel a lot so it is opt-in for now).
161
161
self .completion_enabled = False
162
162
163
- # Accumulate successfully-executed code, for the completer. This
164
- # accumulates code even when completion is disabled, so that completion
165
- # works if it's enabled later.
166
- self .accumulated_code = ''
167
-
168
163
self ._init_repl_process ()
169
164
self ._init_kernel_communicator ()
170
165
self ._init_int_bitwidth ()
@@ -338,16 +333,10 @@ def _execute(self, code):
338
333
codeWithLocationDirective , self .expr_opts )
339
334
340
335
if result .error .type == lldb .eErrorTypeInvalid :
341
- self .accumulated_code += codeWithLocationDirective + '\n '
342
336
return SuccessWithValue (result )
343
337
elif result .error .type == lldb .eErrorTypeGeneric :
344
- self .accumulated_code += codeWithLocationDirective + '\n '
345
338
return SuccessWithoutValue ()
346
339
else :
347
- # TODO: We should accumulate code if there is a runtime error. But
348
- # I don't know how to distinguish between compile and runtime error
349
- # here. Note that this TODO is throwaway work, because I intend to
350
- # make the completer work without accumulated code soon.
351
340
return SwiftError (result )
352
341
353
342
def _after_successful_execution (self ):
@@ -530,7 +519,7 @@ def do_complete(self, code, cursor_pos):
530
519
531
520
code_to_cursor = code [:cursor_pos ]
532
521
sbresponse = self .target .CompleteCode (
533
- self .swift_language , None , self . accumulated_code + code_to_cursor )
522
+ self .swift_language , None , code_to_cursor )
534
523
prefix = sbresponse .GetPrefix ()
535
524
insertable_matches = []
536
525
for i in range (sbresponse .GetNumMatches ()):
0 commit comments