Skip to content

intersystems-dach/ownobjectscriptextension

Repository files navigation


OwnObjectScriptExtensionLogo

OwnObjectScriptExtension

A Visual Studio Code extension that supplies tools for InterSystems ObjectScript.



Features

Open InterSystems Class Documentation

Remembering all your class names and their properties can be difficult. The Open InterSystems Class Documentation command makes it easy to access the documentation of any class. Simply place your cursor within a class name and execute the command. The command will automatically open the documentation of the class on the side or in your favorite browser.

png

Add Method Description

Writing comprehensive method descriptions is essential for maintaining code clarity and promoting collaboration. Simply place your cursor within a method and execute the Add Method Description command. The command will automatically generate a description template for the method, making it easy to provide meaningful documentation.

demoAddDescription

png

Tip: You can change the template with the Edit Method Description Template command.

Make Select Statement

When working with ObjectScript, you often need to interact with databases. The Make Select Statement feature simplifies the process of generating SQL SELECT statements. By analyzing the currently opened ObjectScript file, the extension creates a SELECT statement based on the class name.

demoMakeSelectStatement

Tip: Install the SQLTools extension to execute the statement directly within Visual Studio Code.

Create New Wizard BETA

Creating new ObjectScript classes, messages, business services, or business operations is made more convenient with the Create New Wizard feature. This wizard-like interface guides you through the process of generating new components, resembling the familiar InterSystems Studio Wizard. By executing the command and following the instructions, you can quickly set up new ObjectScript artifacts, saving you time and effort.

DemoCreateNewClass

This feature is currently in beta and may not work as expected. You may have to adjust the generated code.

Translate Embedded Python BETA

In certain scenarios, you may want to leverage the power of Python within your ObjectScript code. The Translate Embedded Python feature allows you to translate ObjectScript methods to embedded Python methods. By executing the command, the extension generates a new method with the same name, prefixed with py. This enables you to incorporate Python functionality while maintaining the structure and organization of your codebase.

demoTranslateEmbeddedPython

This feature is currently in beta and may not work as expected. You may have to adjust the generated code.


Requirements

  • Visual Studio Code 1.73.0 or higher
  • The InterSystems ObjectScript Extension should be installed and an active Texteditor with an Intersystems ObjectScript file should be open.

Installation

Install from VSCode Marketplace

  • Open the Extensions sidebar in Visual Studio Code
  • Search for OwnObjectScriptExtension
  • Click Install

Install from GitHub

  • Clone this repository (recommended under ~/.vscode/extensions):
git clone https://github.com/intersystems-dach/ownobjectscriptextension C:\Users\<your-user>\.vscode\extensions\ownobjectscriptextension

or download the latest realease and extract the file into ~/.vscode/extensions.

  • Go to the extension folder and run npm install in the terminal.
  • If the extension did not got installed, run the command Developer: Install Extension from Location... and choose the extension folder.

Workspace

This extension will create a directory named ownobjectscriptextension-workspace in the same directory as the extension. The workspace contains all files, so your changes in those files will not be lost when installing a new version.


Commands

Own ObjectScript Create

  • Create New Wizard: Creates a new ObjectScript class. See here for more information.

Own ObjectScript Modifier

  • Add ObjectScript Modifier: Adds Set, Do and Write modifier to your ObjectScript code.
  • Show ObjectScript Keywords: Shows the current list of keywords.
  • Add ObjectScript Keyword: Adds an Objectscript keyword to options.json. If a line starts with one of those keywords no modifier will be added.
  • Remove ObjectScript Keyword: Remove an ObjectScript keyword.

Tip: Lines starting with a keyword will be ignored by the command Add ObjectScript Modifier.

Own ObjectScript Documentation

  • Add Method Description: Adds a description template to your Method or ClassMethod. See here for more information.
  • Edit Method Description Template: Opens the MethodDescriptionTemplate.json file so you can edit the method template. Reload Window after editing!
  • Add Inline Comments: Adds a comment in the current Method every specified count of lines without any comment (Default is every 5 lines).
  • Open InterSystems Class Documentation: Opens the documentation of the current class. See here for more information.
  • InterSystems Web Search: Search a question about InterSystems ObjectScript on the web. It will open a new tab in your browser with the search results for your question together with the keywords intersystems and objectscript.

Own ObjectScript SQL

  • Make Select Statement: Copies a SQL-Select-Statement based on the currently opened file to the clipboard. If the configuration OpenSQLFile is enabled a sql file will be generated.

Own ObjectScript Translate

  • Translate Embedded Python: Translates an Objectscript method to a new method with embedded python. See here for more information.

Configuration

Go to File > Preferences > Settings and than navigate to Extensions > OwnObjectscriptExtension.

  • Save File: Set if the current opened file will be saved after a command (Default: disabled).
  • Show Messages: Set if the extension will show information messages (Default: enabled).

Sql

  • Open SQLFile: Set if a sql file will be opened with Own ObjectScript SQL: Make SQL Select File (Default: disabled).

Comment

  • In Line Comment Count: Sets the line count between added comments for Own ObjectScript Comment: Add Inline Comments (Default: 5).

Create

  • Ask For Package First: Set if the extension should ask for the package first (Default: disabled).
  • Service: Add Target Config Names: If enabled a property called TargetConfigNames will be added to your service, that represent the business partners inside of the production. (Default: disabled).

Documentation

  • Open In Browser: If enabled the command Own ObjectScript Documentation: Open InterSystems Class Documentation will open the documentation in the browser otherwise it will open in VSCode (Default: disabled).
  • Use Duck Duck Go: If enabled the command Own ObjectScript Documentation: InterSystems Web Search will use the searchengine DuckDuckGo otherwise it will use Google (Default: disabled).

Color Theme

The extension will add a new color theme called InterSystems Real Dark. You can change it via File > Preferences > Theme > Color Theme.

InterSystemsRealDarkExample


Bugs

  • no known bugs

  • Bug fixes
  • Own ObjectScript Documentation: Open InterSystems Class Documentation improved

View on Marketplace.


by Philipp B.

powered by InterSystems.

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own responsibility.