Skip to content

Conversation

Achal1607
Copy link
Member

This PR introduces support for Java Notebooks with the file extension .ijnb.

Key Features

Interactive Java Notebooks (.ijnb):

  • Provides an interactive notebook experience for Java developers.
  • Can be opened in the context of a project, enabling seamless access to project dependencies and configuration.
  • Supports standard notebook features such as code cells, output rendering, and inline results.

JShell Integration:

  • Added the ability to open a JShell REPL in the context of a project.
  • Offers a powerful way to experiment with Java code snippets while leveraging the project's classpath and configuration.

Benefits

  • Enables rapid prototyping and exploration of Java code.
  • Simplifies learning and experimenting with Java features.
  • Provides a consistent developer experience within the VSCode environment.
  • The notebooks fully integrate with the workspace, ensuring that code execution is aware of the project context.
  • No external tools or configuration required beyond the existing Java extension setup.

Example Interface Image

image

@Achal1607 Achal1607 added this to the JVSC 25.0.0 milestone Sep 13, 2025
@Achal1607 Achal1607 requested a review from sid-srini September 13, 2025 05:50
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Sep 13, 2025
Copy link
Member

@sid-srini sid-srini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot @Achal1607, @shivam71 and @subhash-arabhi for this new and useful feature. It is a lot of good work that you have added @Achal1607. 👍 💯
Please find some suggestions/thoughts on the user-visible text below.

@Achal1607 Achal1607 force-pushed the final-java-notebook branch 2 times, most recently from 9f58b53 to 3b5947e Compare September 23, 2025 09:32
Copy link

Thank you for your pull request and welcome to our community! To contribute, please sign the Oracle Contributor Agreement (OCA).
The following contributors of this PR have not signed the OCA:

To sign the OCA, please create an Oracle account and sign the OCA in Oracle's Contributor Agreement Application.

When signing the OCA, please provide your GitHub username. After signing the OCA and getting an OCA approval from Oracle, this PR will be automatically updated.

If you are an Oracle employee, please make sure that you are a member of the main Oracle GitHub organization, and your membership in this organization is public.

@oracle-contributor-agreement oracle-contributor-agreement bot added OCA Required At least one contributor does not have an approved Oracle Contributor Agreement. and removed OCA Verified All contributors have signed the Oracle Contributor Agreement. labels Sep 24, 2025
sid-srini
sid-srini previously approved these changes Sep 29, 2025
Copy link
Member

@sid-srini sid-srini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot. LGTM 👍

Achal1607 and others added 10 commits September 30, 2025 15:36
- registers support
- save outputs
- classpath option
- code completions in the notebook
- recovers from out-of-order cell state changes

Note: notebooks module in nbcode
Uses RequestProcessor for async Jshell init and code eval
- Structure validation using nbformat schema
- Updated licenses and copyright
- Added proper id to each cell
- Added proper execution count
- Added validation in serialization step
- Added logs

Co-authored-by: Achal Talati <achal.talati@oracle.com>
- added input output stream support
    - added streaming support of cell execution, enhanced output stream
    - added protocol for listening to cell execution notifications
    - added streaming support in the frontend for notebooks and improved kernel
- added interrupt handler
- added cellId to be passed in the cell execution request
- added jshell context in the editor context
- fixed issue of command truncation
- improved code completion provider
- fixed some build issues and bugs, e.g. init of configurations
- Corrected execution counter
- Introduced mimeTypeHandler and executionSummary and refactored code
- Added new commands to localisation english file
- Added tests for mimeType and executionSummary of notebook code
- New and unexecuted cells will not display success or failure
1. Added mock lsp client helper class
2. Added test for NotebookConfigs class
3. Updated test dependency in project.xml
- Added opening notebooks in context of a project
    - Also added change project context button in the notebook toolbar
    - Added few more tests
- Added localization in notebooks
- Fixed jshell flow and updated open jshell label
- Other cleanup and fixes
    - updated netbeans patch
    - cleanup of some unused code and added license header to missing files
    - formatted files and removed unused imports
    - updated ajv to latest version: 8.17.1
    - updated artifactory urls
    - fixed the execution status issue
    - removed console.log and replaced with standard extension logger
sid-srini
sid-srini previously approved these changes Sep 30, 2025
sid-srini
sid-srini previously approved these changes Sep 30, 2025
sid-srini
sid-srini previously approved these changes Sep 30, 2025
Achal1607 and others added 2 commits September 30, 2025 21:10
- Addressed review comments
- Fixed some labels
- Improvements to NotebookUtils for conversions between line-based positions and string offsets
    - Avoiding unnecessary string split and joins
    - Added unit tests
- Notebook configurations related changes
    1. Made classpath,modulepath and add modules configs as array type on frontend
    2. Corresponding changes on backend to process the array
    3. Updated notebook configs unit tests
- Add enable-preview flag from the project context if not configured
- Addressed minor gaps in notebook cell execution
    - Correctly printing the runtime errors stacktrace
    - Handling null output stream callback
    - Performing lineEnding normalization only where required in cell setContent.
    - Minor performance improvements

Co-authored-by: Achal Talati <achal.talati@oracle.com>
Co-authored-by: Shivam Madan <shivam.madan@oracle.com>
Co-authored-by: Siddharth Srinivasan <siddharth.srinivasan@oracle.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OCA Required At least one contributor does not have an approved Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants