The Linux Foundation Projects
Skip to main content
Blog | Mentorship | Zowe

Winter 2025 Mentorship: Enhancing Zowe Explorer for IntelliJ IDEA with COBOL Language Recognition

By | May 27, 2025

Written by Artemiy Vishnyakov, a Western University student

Western University is an Academic member of Open Mainframe Project, which offered a winter mentorship to students. Three students joined the Zowe Mentorship led by Uladzislau Kalesnikau. These students share their experience and key learnings in the blogs. 

Blog by Artemiy Vishnyakov, Open Mainframe ProjectAs a part of an ongoing effort to improve Zowe Explorer plugin for IntelliJ IDEA, I recently implemented a content language recognition feature specifically designed for COBOL language. This enhancement allows the system with pre-installed Zowe Explorer plugin for IntelliJ IDEA to automatically detect COBOL code even when files lack a typical extension (.cbl, .cobol, .cob, etc.), providing a more intuitive experience for developers working with mainframe applications. 

The problem 

Before the feature is implemented, Zowe COBOL Language Support plugin for IntelliJ IDEA was recognizing and providing highlighting and LSP features support only for the files with a typical extension. But most of the z/OS datasets and members do not contain an extension in their HLQs. 

The parts 

Previously, it was discovered that VS Code can define the language of the file even when there is no extension. That feature is provided by Guesslang library (https://github.com/yoeo/guesslang) that predicts the probability of the language the file content is written in. There are 54 languages that could be recognized by the library’s ML model, and COBOL is one of them. So, Zowe IntelliJ team decided to reuse the ML model to implement the same feature in IntelliJ IDEA platform, that would be provided by Zowe Explorer for IntelliJ IDEA. 

Zowe COBOL Language Support for IntelliJ IDEA is the perfect place to reuse the API, so it is needed to combine these parts to provide the feature. 

The Implementation Process 

The core of the new feature is a TensorFlow model that analyzes the contents of a file to predict its programming language. When a user opens a file without an extension, the content is processed by the model. If the model identifies the file as COBOL code, the system sends a notification to the user, informing them that the file is indeed COBOL. 

Upon successful implementation of the text recognition functionality, I expanded its usability by developing an API within the plugin. This API enables other plugins to integrate and interact with the language classification feature. It provides a straightforward mechanism to determine the type of content of a given file. If the file contains COBOL code, the API returns “COBOL”; otherwise, it returns “Unrecognized.” 

Integration with Zowe COBOL Language Support 

To further extend the utility of this feature, the Zowe COBOL Language Support extension was integrated. When Zowe Explorer for IntelliJ IDEA is installed, Zowe COBOL Language Support connects to the language recognition API to identify COBOL files. If a file is recognized as COBOL, the Zowe COBOL Language Support extension automatically highlightings COBOL-specific syntax. 

How It Works: A Code Example 

Here is a simplified code fragment demonstrating how the language classification works using the pretrained TensorFlow model: 

class ExternalContentProviderService{ 

fun getPrediction(content: String): String { 

val predictions = ModelOperations().runModel(content) 

var responseLanguage = predictions.keys.first() 

if(responseLanguage=="cbl") { 

return "COBOL" 

} 

return "Unrecognized" 

} 

} 

 

This function processes the content of a file and uses the model to predict its language. If the model returns “cbl” (the label associated with COBOL), the method returns “COBOL”; otherwise, it returns “Unrecognized.” 

Managing Dependencies Between Zowe Explorer for IntelliJ IDEA and Zowe COBOL Language Support 

To ensure proper functionality, Zowe COBOL Language Support requires Zowe Explorer for IntelliJ IDEA to be installed. This dependency is specified in the plugin.xml file: 

<depends optional=”true”>org.zowe.explorer</depends> 

This line ensures that Zowe Explorer for IntelliJ IDEA is present and runs alongside the Zowe COBOL Language Support extension. However, this dependency is optional, allowing the Zowe COBOL Language Support extension to function independently. Despite this, when Zowe Explorer for IntelliJ IDEA is installed, the COBOL content language recognition feature is enabled to highlight datasets, providing a seamless experience for COBOL developers. 

Open Mainframe Project will be announcing the mentees for the 2025 Summer Mentorship shortly. You can watch past mentee presentations on the Mentorship playlist here

Keep up to date with Open Mainframe Project: