Project 4: Go to Definition

Final Submission Due Date: Tuesday, May 13, 2025 @ 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).

Before you begin working on this project, create a new Chat session by pressing the “+” (plus icon) in the Github Copilot chat view

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. In addition, the Go to Definition feature only needs to be able to navigate to the function definition if it is within the current editor window that is open.

Submission

Please submit this by 11:59PM on Tuesday, May 13. Use the pull request template and make sure to 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: 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. Note: You do not have to create a journal.md file.

  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.

  2. Please fill out this survey after you submit Project 4: https://forms.gle/Se2FLsZJNiaYTNNc9. Completing this survey will be worth 2% of your Project 4 grade.

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