Complete code with Tab in Devin Desktop

Try Devin Desktop’s code suggestions, then check the inserted lines in a test file.

Updated 25 min

What you will create

Complete a small Python function using Devin Desktop’s suggestions, then review the changes instead of accepting them repeatedly. This exercise concerns editor completion, not autonomous project delegation to an agent.

Before you start

Use an already installed, authorized editor, a practice folder without secrets and an available Python environment. Save a copy of the original file. Do not open a confidential repository for this test or enable additional context merely to obtain a suggestion.

Define the function’s contract first: it takes a list of nonnegative integer prices in cents and returns their sum. An empty list must return zero. Type validation is outside this exercise.

Step-by-step

  1. Create a practice file and type the comment and function start below. Wait for a completion suggestion.
  2. Read every proposed line: suggestions can change code before or after the cursor. Check that the edit remains limited to the intended function.
  3. Accept with Tab only if appropriate; use Escape to dismiss it. Distinguish code insertion from a proposed cursor jump or import addition.
  4. Compare the file with the original copy. Remove unnecessary imports and out-of-scope changes before executing code.
  5. Add the proposed checks, save and run this local file after review. If a check fails, inspect the function before requesting another suggestion.

Example to adapt

Type this deliberately incomplete starting point:

# Sum nonnegative integer prices in cents.
# An empty list must return 0.
def total_cents(prices):

After completing and reviewing the function body, add:

assert total_cents([]) == 0
assert total_cents([125, 275]) == 400
assert total_cents([0, 90, 90]) == 180
original = [125, 275]
total_cents(original)
assert original == [125, 275]
print("Basic checks passed")

These assertions check summation, empty input and whether the supplied list is unchanged. They do not establish behavior for text, negative values or decimals.

Check your result

  • Does the function return a number rather than merely print it?
  • Does the initial zero allow empty input?
  • Does the input list remain unchanged?
  • Is the file free of network access, installations and operations on other files?
  • Can you explain every accepted line?

Common problems

Tab moves the cursor: read the displayed hint before pressing it again. No suggestion: check completion settings and account status; do not copy sensitive code to enrich context. Only one correct result: also check empty input and repeated values. An unexpected import: this addition requires no external library; reject an unjustified dependency.

Next steps

Extend the contract in a separate exercise, for example by explicitly deciding how to handle a negative value. See the Devin Desktop profile to distinguish completion from the editor’s other functions.