Project 4: Go to Definition

Final Submission Due Date: Wednesday, May 15, 2024 @ 11:59PM


Note There is no new GitHub classroom assignment for this project. Please use the same repository as we have been using for previous projects.
Please do your work for Project 4 in a new branch that you create (do not use the feedback branch or other existing branches).

Motivation

The goal of this assignment is to use Github Copilot features to comprehend and generate code. Specifically, you will be adding a new feature to IDLE that allows users to Go to Definition of the method that the user’s cursor is on. This feature is an extremely useful way for programmers to understand what exactly a method does while reading some code that uses the feature.

Task

Your specific task will be to add a menu item to the set of options that appear when a user does a <Control + Click> event (when a user holds down the Control button and clicks). This menu can also be invoked by clicking with two fingers on a Mac system or a right-click on a Windows system. See the image below for an example of the menu.

Menu

When a user selects this option while on a method name, the cursor should then go to the definition of that method. If the cursor is not on a method implementation or the method does not appear in the current Python file, then it should ring the Tkinter bell to indicate that we cannot go to the definition of that method. There are other features in IDLE that also ring this bell for certain events.

For now, our feature only needs to handle method names. Do not worry about classes, variables, or any other objects. Other aspects of the design of the features (including the code organization of your added code) are left up to you.

Submission

Please submit this by 11:59PM on Wednesday, May 15. In the final pull request description, please summarize the changes you made (which features you implemented) and include screenshots of your new feature in action.

Project Folder: Create a folder named “Project 4”.

You do not need to submit a design document for this project!

Process Journal File (journal.md): The process journal for this project will be slightly different since we want to understand how you interacted with Github Copilot to complete this project. You do not need to follow the guidelines for the process journal we have previously provided. Instead, please refer to the instructions below for what to include.

  1. Provide a high-level description of how you used each of the following features in Github Copilot:
    • /explain
    • /fix
    • /tests
    • /docs
    • Copilot chat feature
    • Code Generation via function docstring comments
    • Code Generation via single-line comments (i.e., one line at a time)

If you did not use one of the features above, please explicitly mention that you did not use that feature.

  1. Upload the .json file of your Copilot chats related to this project. You can export a Copilot Chat session in Visual Studio Code to a JSON file via Ctrl+Shift+P and then Chat: Export Session... or by choosing View > Command Palette | Chat: Export Session.... Please upload the .json file(s) in the Project 4 subfolder.

You do not need to submit a design document for this project!