Article
· 20 hr ago 3m read

Modern and Easy-to-Use VSCode Plugin for InterSystems ObjectScript: Class Diagram Visualization with PlantUMLContestant

Motivation

I started programming back in 2015, when I was doing my bachelor's in computer science. I didn't know about ObjectScript until I started my new job four months ago. Objectscript isn't actually a young programming language. Compared to C++, Java and Python, the community isn't as active, but we're keen to make this place more vibrant, aren't we?

 

I've noticed that some of my colleagues are finding it tricky to get their heads around the class relationships in these huge projects. There aren't any easy-to-use modern class diagram tool for ObjectScript.

Related Work

I have tried relavant works:

- InterSystems class view:
1. https://github.com/intersystems-community/ClassExplorer
This is great work, and the class diagram looks really good and clean. But there's still an issue with the docker build: "#0 0.512 exec ./irissession.sh: no such file or directory". I'm guessing it's a support feature for the studio rather than VSCode. It seems to need to import your project manually. It seems like it needs some configuration to use this product.

2. https://github.com/gjsjohnmurray/vscode-objectscript-class-view
This is another great work which gives me inspiration. The class structure is clear and it supports not only class in project also class from library. But it looks like a enhanced version of vscode outline. 

- Other language VSCode class diagramm view plugins

1. https://github.com/OH318/J-Diagram
The readme shows the running results with draw.io really well. But when I tested it locally, I couldn't use it. So I won't use it as a reference.

2. https://github.com/pierre3/PlantUmlClassDiagramGenerator
It's relative good and it requires some configuration. I took the idea of generating uml first, then use PlantUML to generate class diagram.

- Best Implementation of class diagram:
1. Jetbrains products, like Intellij Idea and Pycharm, are amazing for class diagrams. Just drag and drop classes, click a hyperlink, and you're all set to generate a powerful class diagram.

2. VSCode typescript class diagram plugin
https://marketplace.visualstudio.com/items?itemName=AlexShen.classdiagra...
drag, drop, hyperlink click, support of folder class diagram generation.

I took the design idea from them. Unfortunately, they are closed source, so I'll have to design the project on my own.

InterSystems ObjectScript Class Diagram View

is a Visual Studio Code extension that generates UML class diagrams from InterSystems ObjectScript (.cls) files. It provides interactive visualization and navigation features, built on PlantUML for reliable diagram rendering.

Key Features

  • Generates UML class diagrams for individual files or entire folders
  • Right-click context menu support in both the editor and file explorer
  • Interactive browsing: Clickable class elements for quick navigation
  • Supports zooming and panning for better visualization
  • InterSystems Object Extension Pack not required

I tested the plugin on another great objectscript project apiPub

For a single class:

For a folder:

For the whole project. The class diagram is in SVG format, and it's always sharp and clear.

Requirements

  • VS Code (version 1.96.0 or higher)
  • Java Runtime Environment (JRE) (version 8 or higher)

Usage

  • Open a .cls file and generate a class diagram using:
    • Ctrl+Alt+U shortcut
    • Right-click on a file or folder and select "Generate Class Diagram"
  • Click on elements in the diagram to jump to class definitions, properties, and methods

Known Issues

  • Navigation does not work for external library classes
  • Missing support for subclass-specific diagrams
  • Performance issues when handling large projects
  • Developed based on Win11, not tested on Linux
  • Library class (%RegisteredObject..) click is not supported

Contributing & License

  • Open for contributions via GitHub
  • Licensed under MIT

You can find this plugin on the marketplace, feel free to create issues at issue and contribute with PR.

Discussion (2)3
Log in or sign up to continue