SimpleOne API Extension for Visual Studio Code

The SimpleOne API extension for Visual Studio Code provides hover tooltips, auto-completion, and syntax highlighting for SimpleOne client and server API classes and methods when editing JavaScript files.

Associating Scripts with API Types

To use the extension, you must associate scripts with a specific API type (client or server). To do this, simply open any JS file after installing the extension and select the association for the folder containing the file in the pop-up window. Associations are applied to all files in the folder, so we recommend storing scripts of different types in separate folders.

image

You can change the association later using the Associate Folder option in the folder’s context menu.

You can also add a comment //server or //client in the first line of an individual JS file to link it to the corresponding API type. This setting takes precedence over the folder-level association.

Syntax Highlighting and Tooltips

The extension adds syntax highlighting for SimpleOne API classes and methods in JS files.

You can override highlight styles in the settings.json file:

You can also completely disable syntax highlighting in the IDE settings:

When hovering over an API method or object, a tooltip appears with brief information and a link to the corresponding documentation article:

Auto-Completion

While writing scripts, the extension suggests SimpleOne API classes and methods in the auto-completion list and displays a tooltip with a brief description:

You can find the extension directly within the IDE by searching for keywords, or download it from the marketplace.

5 Likes

Good afternoon!

I would like to request consideration of the following improvements:

  1. Modify/improve the file association check using comments (//server, //client).
    For example, we use the first line of the file to store metadata comments, which breaks your current structure. While we could theoretically include your association comment in our metadata, your current logic would still misclassify a script as client-side if the word “client” appears anywhere in the metadata—even if the script is server-side. Example:

/* type: server, metadata: sys_id=169088642802415187; name=Get client Id; application=Simple */

Your current check code:
const firstLine = document.lineAt(0).text.trim();

if (/^(\s*//|\s*#|\s*/*)/.test(firstLine)) {
if (firstLine.includes(“client”)) return “clientSideAPI”;
if (firstLine.includes(“server”)) return “serverSideAPI”;
}

In general, we’ve adapted and found a workaround for this issue, but it would be great if you could consider a more universal and robust method for detecting file associations.

  1. Popup suggestion window upon opening a file.
    Please fix this—it is very disruptive. Every time we switch associations upon opening a file, the suggestion popup appears.

Your current implementation:
setTimeout(() => {
vscode.commands.executeCommand(“editor.action.triggerSuggest”);
}, 100);

Example: I’m working on a server-side file, switch to a client-side file—popup appears. Switch back to server-side—popup appears again. Open any unrelated file (e.g., a config file), then return to the server script—popup appears again.

If this feature is useful for some users, please add a configuration toggle to disable it, similar to the existing simpleSemantic.enabled setting.

Thank you!

1 Like

Thank you for the feedback; we will schedule a task to resolve the issues / enhance the solution. We will keep you informed!

1 Like