Skip to content

An Online Navigator to browse Java code and provide dynamic link to all the symbol and provide navigation between files.

License

Notifications You must be signed in to change notification settings

DnsZhou/online-Java-navigator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser-based source code navigation

An Online Navigator to browse Java code that provide dynamic link to all the symbol and navigation between files.

Introduction

In the past, software development usually refers to coding in a local environment, using IDE to browse and edit their code, download all libraries that referred to in the project. As technology develops, we introduced online version control tools (like Git or SVN) and build automation tools (like Maven), which make software development more flexible and expandable. Developers occasionally wish to review and navigate JAVA source code that is not locally resident, in another word, not imported into their desktop IDE. For single file cases, this is sometimes possible, just like what is provided by GitHub.

However, things get much more complicated when we deal with something like maven repositories, which have source jars. Usually, it is only supported by downloading the entire jar, but not looking inside it directly. Multi-file cases are even more problematic as, although many rendering systems will provide syntax highlighting, few allow navigation between files by clicking on the type or method declarations. While exceptions do exist, like zGrepCode, none currently allows the linking between files to be dynamically configured by the user. For users accustomed to the rich navigation support offered by IDEs, this is not satisfactory.

Some Online IDE (e.g. GitPod) may provide the navigation feature just like a local IDE, but it cost a lot of resources to build a server-side JVM that compiling all the time, and their performances are not good enough in terms of the response time when processing complex repositories. A similar function can be easily developed for other types of programming language such as JavaScript and Node.js, but the complexity of JAVA language itself makes it more difficult to be implemented.

Thus, this project is aimed to produce a web-based Java code repository navigator which addresses the issues, particularly by introducing the novel feature of allowing a user-provided classpath to influence the navigation, i.e. support dynamic symbol resolution. In this project, I will emphasise on the research about Java code parsing, syntax trees like AST, and suchlike.

On the other hand, as a web application to be presented, some practical research will also be involved such as deployment and operations at scale, cloud-based environment, so that to put the developed service into production. Also, the research on the Computational linguistics and the mechanism of how the computer understands advanced programming language like JAVA is also included in this project.

Technology Stack

Open source repositories that is referenced (or may referenced) by this project:

High-level Design

There are two main stages within this source code navigation system:

  1. Source code analysing
  2. Web-based code browsing and navigation

Also, there are four modules that will cooperate with each other to provide the entire service.

  • Web Module: A front-end application that interacts with the user via a web browser, sending requests to the web server and presenting the data that response from the backend.
  • Navigation Module: The component that resolves the HTTP request from front-end and returns the target path with other information to the front-end.
  • Analysis Module: The core component that parses the source code and generating static HTML files with the necessary information and index by AST from the compilation unit.
  • Storage Module: Stores the information generated by Analysis Module, including static HTML files, compilation unit data and index data.

UML Screenshot

Before any user can start to use this system, some specific source code should be selected and pre-processed by this system.

In stage 1, the Analysis Module will parse and analyse the source code including all jar files, generating ASTs and static HTML files which provide syntax highlighting feature, then save it to the storage module.

In stage 2, user can access this Web Module of the system with a web browser, finding the java class they want to review. The java source code will be presented as a webpage with syntax highlight so that they can click the Types (classes, interfaces) within this webpage and get navigated to the correct target java file presented as a webpage as well. They can also provide their own classpath file, and the navigation system will filter out those packages that are not included in the classpath file, which will make the result more accurate as what it is like in a local IDE environment.

About

An Online Navigator to browse Java code and provide dynamic link to all the symbol and provide navigation between files.

Resources

License

Stars

Watchers

Forks

Packages

No packages published