Computer programmers often work with large computer programs that are spread across numerous files. When a programmer attempts to correct a bug in a program, the programmer may struggle with understanding the code structure and flow of the program because of the size and/or complexity of the program. The programmer may traverse large swaths of code in trying to locate the bug. Although code editors may provide search tools that allow the programmer to search the code, the programmer may get lost in the code when different searches are performed.
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the Detailed Description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
An integrated development environment displays a diagram that indicates relationships of code elements navigated by a user. The diagram provides a visualization of the navigation history of the user to allow the user to understand the code structure and flow of a program. A navigation history engine extracts the navigation history, generates the diagram, and displays the diagram adjacent to code displayed by a code editor.
The accompanying drawings are included to provide a further understanding of embodiments and are incorporated in and constitute a part of this specification. The drawings illustrate embodiments and together with the description serve to explain principles of embodiments. Other embodiments and many of the intended advantages of embodiments will be readily appreciated as they become better understood by reference to the following detailed description. The elements of the drawings are not necessarily to scale relative to each other. Like reference numerals designate corresponding similar parts.
In the following Detailed Description, reference is made to the accompanying drawings, which form a part hereof, and in which is shown by way of illustration specific embodiments in which the invention may be practiced. In this regard, directional terminology, such as “top,” “bottom,” “front,” “back,” “leading,” “trailing,” etc., is used with reference to the orientation of the Figure(s) being described. Because components of embodiments can be positioned in a number of different orientations, the directional terminology is used for purposes of illustration and is in no way limiting. It is to be understood that other embodiments may be utilized and structural or logical changes may be made without departing from the scope of the present invention. The following detailed description, therefore, is not to be taken in a limiting sense, and the scope of the present invention is defined by the appended claims.
It is to be understood that the features of the various exemplary embodiments described herein may be combined with each other, unless specifically noted otherwise.
IDE 10 is executable by the computer system to provide tools for software development in one or more programming languages. The tools may include but are not limited to a source code editor, a source code analyzer, a compiler and/or interpreter, a debugger, a profiler, a version controller, a class browser, and/or an object inspector. The tools may also include tools to automate the building of a complete program from libraries and other components and/or tools to help create a graphical user interface. IDE 10 supports one or more programming languages and is used by a developer to write, execute, debug, and/or analyze programs.
Computer system 100 represents any suitable processing device configured for a general purpose or a specific purpose. Examples of computer system 100 include a server, a personal computer, a laptop computer, a tablet computer, a personal digital assistant (PDA), a mobile telephone, and an audio/video device. The components of computer system 100 (i.e., processor packages 102, memory system 104, input/output devices 106, display devices 108, peripheral devices 110, network devices 112, and interconnections 114) may be contained in a common housing (not shown) or in any suitable number of separate housings (not shown).
Processor packages 102 each include one or more execution cores. Each execution core is configured to access and execute instructions stored in memory system 104. The instructions may include a basic input output system (BIOS) or firmware (not shown), IDE 10, source code files 12, kernel 14, and navigation history engine 16. Navigation history engine 16 includes navigation history 18 and navigation tracker 20. In one embodiment, IDE 10 includes navigation history engine 16. Each execution core may execute the instructions in conjunction with or in response to information received from input/output devices 106, display devices 108, peripheral devices 110, and/or network devices 112.
Computer system 100 boots and executes kernel 14. Kernel 14 includes instructions executable by execution cores to manage the components of computer system 100 and provide a set of functions that allow programs, including IDE 10, source code files 12, and navigation history engine 16 to access and use the components. Kernel 14 and any additional runtime libraries generate a runtime environment to allow IDE 10, source code files 12, and navigation history engine 16 to be executed. In one embodiment, kernel 14 is the Windows operating system. In other embodiments, kernel 14 is another operating system suitable for use with computer system 100.
Memory system 104 includes any suitable type, number, and configuration of volatile or non-volatile storage devices configured to store instructions and data. The storage devices of memory system 104 represent computer readable storage media that store computer-executable instructions. The instructions are executable by computer system 100 to perform the functions and methods described herein. Memory system 104 stores instructions and data received from processor packages 102, input/output devices 106, display devices 108, peripheral devices 110, and network devices 112. Memory system 104 provides stored instructions and data to processor packages 102, input/output devices 106, display devices 108, peripheral devices 110, and network devices 112. Examples of storage devices in memory system 104 include hard disk drives, random access memory (RAM), read only memory (ROM), flash memory drives and cards, and magnetic and optical disks.
Input/output devices 106 include any suitable type, number, and configuration of input/output devices configured to input instructions or data from a user to computer system 100 and output instructions or data from computer system 100 to the user. One or more input/output devices 106 may be configured to allow a user to interact with IDE 10, source code files 12, kernel 14, and navigation history engine 16. Examples of input/output devices 106 include a keyboard, a mouse, a touchpad, a touchscreen, buttons, dials, knobs, and switches.
Display devices 108 include any suitable type, number, and configuration of display devices configured to output textual and/or graphical information to a user of computer system 100. One or more display devices 108 may be configured to output visual format, such as visual format for IDE 10 illustrated in
Peripheral devices 110 include any suitable type, number, and configuration of peripheral devices configured to operate with one or more other components in computer system 100 to perform general or specific processing functions.
Network devices 112 include any suitable type, number, and configuration of network devices configured to allow computer system 100 to communicate across one or more networks (not shown). Network devices 112 may be configured to allow execution data to be transmitted to or received from another computer system (not shown) or storage device (not shown). Network devices 112 may operate according to any suitable networking protocol and/or configuration to allow information to be transmitted by computer system 100 to a network or received by computer system 100 from a network.
In one embodiment, in-situ visualization of navigation history 24 is provided to a code model generation application programming interface (API) 26 (e.g., a progression model API). Code model generation API 26 communicates with one or more language providers 28, which communicate with a corresponding language service 30. Examples of language providers include C#, visual basic (VB) providers, or any other suitable programming language provider. For each given code element, navigation history engine 16 calculates a parent hierarchy employing a suitable available language service 30. For example, navigation history 16 uses a C# language service 30 for a C# code element and uses a VB language service for a VB code element.
At 204, a diagram is generated by an IDE (e.g., IDE 10) that illustrates relationships of at least two code elements in the navigation history. The diagram provides a visualization of the navigation history to the user. In one embodiment, the visual representation of navigation history is automatically generated based on navigation history being tracked inside the IDE. In one embodiment, the automatic generation of a visual representation of navigation history is provided by integrated navigation assets in the IDE, such as code reference navigation and/or code definition navigation (e.g., Find All References and/or Go To Definition commands). In one example, elements from a Task-Based Management feature of the IDE are employed that can track which files were recently opened/used etc.
At 206, the IDE displays the diagram adjacent to code displayed by a code editor of the IDE. In one embodiment, the IDE displays the diagram in-situ in the code editor to allow the user to see the diagram side-by-side with the code and actually use the diagram to navigate to previous items. The diagram provides a user selectable visual representation that is responsive to user input to navigate the user to selected code elements. In one embodiment, the user can use the diagram to navigate to sibling/parent code elements. For example, a user can double click on nodes and/or links to navigate to sibling/parent code elements. In one embodiment, the diagram moves to be displayed in-situ in the code editor to whatever file is being viewed.
In one embodiment, the diagram is a directed graph markup language (DGML) diagram. DGML is an extensible markup language (XML) based file format for directed graphs. A directed graph is a set of nodes connected by links. The nodes and links are graph elements. The DGML diagram can use XML to visualize the navigation history (i.e., historical context of items that have been navigated) of the user and analyze the navigation history. In one embodiment, the DGML diagram provides for each item, visualization of the item's parent chain (i.e., where the item is located relative to other high-level parents). In one embodiment, the DGML diagram provides for each item, visualization of siblings of the item that have a high-level of importance.
In one embodiment, the DGML diagram provides the user with a visual representation of the navigation history that can be navigated in IDE 10. For example, double clicking on certain elements in DGML diagram can actually take the user to the selected code elements in the code editor of IDE 10.
In one embodiment, navigation history engine 16 generates a visualization of the relationship between code elements including node-link container representation. In one embodiment, the DGML diagram provides the user with a visual representation of item context of the navigation history not just historical context. For example, a method also has the method's containing class, namespace, and/or assembly.
In one embodiment, the DGML diagram provides the user with a visual representation of the context around the item (e.g., for a given method, other methods also in that class that are either called by, or calling the method, and for a class, other classes that have a code dependency relationship with this class etc).
In one example of extracting the navigation history at 202, code elements (e.g., classes, methods, fields, namespaces etc.) become nodes in the DGML diagram.
In one example, Go To Definition and/or Find All References commands in the code editor of IDE 10 are utilized by the user to explore large swaths of code. After a selected number (e.g., 3) Go To Definition and/or Find All References commands, a navigation icon is triggered in the DGML diagram. In one example, after user has some selected number (e.g., 7) elements in the navigation history based on Go To Definition and/or Find All References commands, navigation history is displayed in the DGML diagram. In one example, a F12 keyboard shortcut invokes a Go To Definition command. In this example, the Go To Definition command works on types, members, locals, range variables, etc. The Go To Definition command uses a compiler's internal understanding of the code to make sure it takes the user to the right member, even when there are many overloads or if the user's code is using a lot of type inference. The Go To Definition command can also use previously visited overloads (i.e., the user's historical navigation preferences).
Other examples for adding items to the DGML diagram in the code editor of IDE 10 include Ctrl+2, Ctrl+{grave over ( )} (on top of the Shift+Ctrl +˜on an ENU keyboard), drag & drop, scroll to and click on, right click, keyboard shortcut, and source-assist window.
In one example, data for the navigation history is collected by the navigation history engine and/or existing runtime environment data is leveraged to obtain the navigation history data. In one embodiment, the navigation history engine collects only methods and fields of Go To Definition and/or Find All References commands.
In one example of generating a diagram that illustrates relationships of code elements in the navigation history at 204, a DGML diagram is generated with appropriate qualified identifiers (QID) representing the items that have been navigated.
First, relationships between code elements are determined. A navigation history engine (e.g., navigation history engine 16) is employed that can take the navigation history of a user from IDE 10 and generate a DGML diagram. In one embodiment, navigation history engine 16 transforms a code element to a QID, queries a provider for the code element, and creates a node for that code element (e.g., method, class, etc.). In one embodiment, for each of these code elements, navigation history engine 16 calculates a parent hierarchy using the language service(s) available (e.g., for a C# code element—use a C# language service and for a visual basic (VB) code element—use a VB language service). In this way, methods can also have their container classes and namespaces as nodes in the diagram.
For each such code element that the user has navigated to, one embodiment of IDE 10 provides a Find All References search across providers (using the language service) to find if there are other code elements related to that code element that the user navigated to. This embodiment of IDE 10 can give the user more context and other possible avenues that the user might want to navigate. One embodiment of IDE 10 utilizes Find All References actions/queries that are exposed by the language services.
One embodiment of IDE 10, facilitates navigation graph control with a control bar on the DGML diagram that includes user selectable commands (e.g., clear command to clear navigation history and open full window command that opens the DGML diagram in a full window DGML document).
In one embodiment of IDE 10, when a user selects a method that is not obviously related to the code (e.g., separate file, more than one hop way, etc) a question mark (?) appears on the link when the selected item is added to the DGML diagram. If the user does not click on the question mark (?), the link and the question mark (?) will disappear to leave only the unattached node. When the user clicks on the question mark (?), multiple possible paths on the DGML diagram are filled in.
In one embodiment of IDE 10, reference links are created in the direction of code. In one example, a user employs Find All References to navigate in the DGML diagram and the reference links are in the direction of the actual references in the code but in the opposite direction of the user's navigation using Find All References. In one embodiment of IDE 10, however, layout of the nodes is in the direction of navigation. This embodiment ensures that the visuals appear where the user would expect them.
In one embodiment of navigation history engine 16, when a user navigates to a new item, the diagram automatically updates (i.e., a listener is attached to the navigation history) and any changes to the navigation history cause a notification to update the diagram with new nodes/links/containers. One embodiment of navigation history engine 16 provides an incremental layout engine, which can ensure the relative positions of most items will remain fairly stable and nodes and links are laid out where the user expects them.
Embodiments of IDE 10 can minimize visual noise and facilitate user focus on the code editor. In one embodiment, the DGML diagram includes a sufficient number of shapes in the directed graph to be helpful yet not too many shapes that could cause a user to get lost in the side-by-side display of code and DGML diagram in-situ in the code editor. In one embodiment, user preferences are employed with filtering that allows the user to specify the kind of intelligent noise reduction the user desires, such as hide namespaces, hide overloads, etc.
Although specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that a variety of alternate and/or equivalent implementations may be substituted for the specific embodiments shown and described without departing from the scope of the present invention. This application is intended to cover any adaptations or variations of the specific embodiments discussed herein. Therefore, it is intended that this invention be limited only by the claims and the equivalents thereof.
Number | Name | Date | Kind |
---|---|---|---|
4931928 | Greenfeld | Jun 1990 | A |
6018342 | Bristor | Jan 2000 | A |
6993466 | Kodosky | Jan 2006 | B2 |
7110936 | Hiew et al. | Sep 2006 | B2 |
7200838 | Kodosky et al. | Apr 2007 | B2 |
7496830 | Rubin et al. | Feb 2009 | B2 |
7694273 | Kodosky et al. | Apr 2010 | B2 |
7769698 | Matic | Aug 2010 | B2 |
7954082 | Joffrain et al. | May 2011 | B2 |
7958486 | Tsyganskiy | Jun 2011 | B2 |
8171428 | Ding | May 2012 | B2 |
8271943 | Hudson, III | Sep 2012 | B2 |
8413108 | Groves | Apr 2013 | B2 |
8423985 | Ishikawa | Apr 2013 | B2 |
8434063 | Argue et al. | Apr 2013 | B2 |
8448130 | Pillarisetti | May 2013 | B1 |
8453106 | DeLine | May 2013 | B2 |
8522196 | Kim et al. | Aug 2013 | B1 |
8539378 | El-Nakhily et al. | Sep 2013 | B2 |
8561015 | Rowan et al. | Oct 2013 | B2 |
8825561 | Bellamy | Sep 2014 | B2 |
9182948 | O'Riordan | Nov 2015 | B1 |
9223461 | Brown | Dec 2015 | B1 |
9342276 | Lin | May 2016 | B1 |
20020122073 | Abrams et al. | Sep 2002 | A1 |
20030041143 | Ronald et al. | Feb 2003 | A1 |
20030056192 | Burgess | Mar 2003 | A1 |
20060059457 | Pandit | Mar 2006 | A1 |
20060064674 | Olson et al. | Mar 2006 | A1 |
20060241961 | Tsyganskiy | Oct 2006 | A1 |
20070061777 | Vashi et al. | Mar 2007 | A1 |
20070192759 | Ishii et al. | Aug 2007 | A1 |
20070268294 | Eagen et al. | Nov 2007 | A1 |
20070277149 | Stevens | Nov 2007 | A1 |
20070288885 | Brunel | Dec 2007 | A1 |
20080022259 | MacKlem | Jan 2008 | A1 |
20080316213 | Eagen et al. | Dec 2008 | A1 |
20090024937 | Lauff | Jan 2009 | A1 |
20090031256 | El-Nakhily et al. | Jan 2009 | A1 |
20090055769 | Ding | Feb 2009 | A1 |
20090125877 | Kuzsma, Jr. | May 2009 | A1 |
20090150861 | Cowan | Jun 2009 | A1 |
20090172633 | Tsyganskiy | Jul 2009 | A1 |
20090204937 | Kodosky et al. | Aug 2009 | A1 |
20090293044 | Boettcher | Nov 2009 | A1 |
20090307654 | Ishikawa | Dec 2009 | A1 |
20090319955 | Malek et al. | Dec 2009 | A1 |
20100023926 | Sugawara | Jan 2010 | A1 |
20100057417 | Hudson, III | Mar 2010 | A1 |
20100251211 | Dutta | Sep 2010 | A1 |
20100262949 | Jacobsen et al. | Oct 2010 | A1 |
20100293519 | Groves | Nov 2010 | A1 |
20110035343 | Bellamy | Feb 2011 | A1 |
20110113359 | Massey et al. | May 2011 | A1 |
20110161846 | Dutta | Jun 2011 | A1 |
20110185342 | Argue et al. | Jul 2011 | A1 |
20110249002 | Duplessis | Oct 2011 | A1 |
20120079447 | Arnott et al. | Mar 2012 | A1 |
20120117537 | Sierk et al. | May 2012 | A1 |
20120159452 | DeLine | Jun 2012 | A1 |
20130204874 | Frey | Aug 2013 | A1 |
20170102844 | Brown | Apr 2017 | A1 |
20170171238 | Milener | Jun 2017 | A1 |
Entry |
---|
Robert Douglas Elves, NavTracks—Helping Developers Navigate Source Code, University of Victoria, 2005, pp. 1-70. |
Hartmann et al., HyperSource: Bridging the Gap Bwtween Source and Code-Related Web Site, published CHI 2011, May 7-12, 2011, Vancouver, BC, Canada, pp. 2207-2210. |
Murphy et al., How Are Java Software Developers Using the Eclipse IDE?, Published by IEEE Computer Society, 2006, pp. 76-83. |
Lintern et al Plugging-in Visualization: Experiences Integrating a Visualization Tool with Eclipse, ACM Symposium on Software Visualization, pp. 47-56 and 209, 2003. |
Jeff Levinson, Inside VSTS Exploring Directed Graph Markup Language in VS2010, published by Visual Studio magazine, Mar. 11, 2010, pp. 1-4. |
Barry Burd, Eclipse for Dummies, published by Wiley Publishing, Inc, 2005 pp. 1-361. |
Singer, et al., “NavTracks: Supporting Navigation in Software Maintenance,” Proceedings of the 21st IEEE International Conference on Software Maintenance, Sep. 26-29, 2005, pp. 10. |
RAD Studio, “Tour of the IDE,” Retrieved at <<http://docwiki.embarcadero.com/RADStudio/en/Tour_of_the_IDE, >>Retrieved Date:Dec. 27, 2010, pp. 8. |
Carneiro, et al., “Proposing a Visual Approach to Support the Characterization of Software Comprehension Activities,” Proceedings of the 17th IEEE International Conference on Program Comprehension, May 17-19, 2009, pp. 291-292. |
Roethlisberger, et al., “Supporting task-oriented navigation in IDEs with configurable HeatMaps,” Retrieved at <<http://rmod.lille.inria.fr/archives/papers/Roet09a-ICPC2009-HeatMaps.pdf>>, Proceedings of the 17th IEEE International Conference on Program Comprehension, May 17-19, 2009, pp. 253-257. |
Number | Date | Country | |
---|---|---|---|
20120324423 A1 | Dec 2012 | US |