Skip to content

VSCode extension for the Inox platform and programming language.

License

Notifications You must be signed in to change notification settings

inoxlang/inox-vscode

Repository files navigation

👉 Once the extension is installed make sure to read Requirements and Usage.

Inox extension

Click Here if you use VSCodium

Go to https://marketplace.visualstudio.com/items?itemName=graphr00t.inox and click on Download Extension to download the VSIX file for the extension:
image

You can install the extension in VSCodium by going to the Extensions tab and clicking here:
image

This extension provides support for the Inox programming language and for Hyperscript code embedded in Inox programs.

  • Tutorials
  • Syntax highlighting
  • Convenient snippets
  • LSP support
    • Error diagnostics
    • Hover information
    • Completions
    • Formatting
  • Debugging

Requirements

This extension should work on all platforms. If you only want to start playing with the language without installing the binary, you can create a project on the community server.

By default the extension a project server to be listening on wss://localhost:8305. This server can only run on Linux for now.

How to change an extension setting.

WebSocket setting change

A) You have a local VM running Linux

Show installation instructions

Install the inoxd daemon to start the project server automatically (recommended) or start it manually with the following command: inox project-server &.

Make sure to forward the TCP ports 8100, 8102, and 8305 to the VM.

B) You have a local machine running Linux

Show installation instructions

The extension will automatically start the project server. By default the launch command is inox project-server, and projects are stored in $HOME/inox-projects.

You can change the launch command in the settings: for configuring the projects' location add -config={"projectsDir":"/home/username/other-dir"}. It is recommended to update the launch command setting before creating any project.

C) You have a remote machine running Linux (e.g VPS)

Show installation instructions

⚠️ This setup is not recommended for now: the Inox binary is not production ready and probably has memory leaks.

  • Install the inoxd daemon to start the project server automatically.
  • Update the WebSocket Endpoint setting to the following value: wss://<server-ip>:8305

Usage

Creating a project

Instructions
  • Create a folder (example: inox-web-app)
  • Open the folder in a new VSCode window
  • Execute the VSCode command Inox: Create New Project in Current Folder

👉 If you created the project server after having opened the folder you can use the command Developer: Reload Window to restart the LSP client.

You can now open the project.

Creating a project on the community server

Instructions (no account needed)
  • Create a folder (example: inox-web-app)
  • Open the folder in a new VSCode window
  • Execute the VSCode command Inox: [Remote Community Server] Create New Temporary Project in Current Folder

You can now open the project.

Note: programs running on the community server are only allowed to make HTTP requests to the following hosts: localhost, jsonplaceholder.typicode.com, and example.com.

Opening a project

Instructions
  • The first time open the <name>.code-workspace file and click on the floating button 'Open Workspace'
  • Subsequent times you can directly go in File > Open Recent:

recent workspace

The connection status to the server is indicated near the bottom right corner of the window. If the connection is established the status should be the following:
remote FS status

😡 Having an issue ? You are welcome to join the Inox Discord Server and ask for help.

Running and debugging a program

  • Click on the same icon as in the screenshot.
  • Select the Launch Current Module task, the other task always executes /main.ix.
  • Click on the green arrow.

run & debug

Learn about debug actions and breakpoints: https://code.visualstudio.com/Docs/editor/debugging#_debug-actions

debug action bar

Tutorials

Create a file named learn.tut.ix inside an Inox project and follow the instructions. Happy learning :).

tutorial demo

Debugging

img

Hyperscript

The extension provides support for Hyperscript code in Inox programs only.

The language's grammar and configuration are from https://github.com/dz4k/vscode-hyperscript (Copyright 2021 Deniz Akşimşek, MIT Licensed).