Giter VIP home page Giter VIP logo

sublime-janet's Introduction

Janet language support for Sublime Text

This package provides Janet languge support and includes so far:

  • syntax highlighting
  • go to symbol navigation
  • running Janet code right from the editor
  • SublimeREPL integration

Supported Janet version: 1.28

Screenshots

dark

light with rainbow brackets

Installation

  1. Install Package Control.
  2. ctrl + shift + p (Win/Linux) / cmd + shift + p (Mac) → Package Control: Install PackageJanet

Manual

  1. Go to Sublime Text user packages directory:
  • Windows: %AppData%\Roaming\Sublime Text\Packages\User
  • macOS: ~/Library/Application Support/Sublime Text/Packages/User
  • Linux: ~/.config/sublime-text/Packages/User
  1. Clone this repository: git clone https://github.com/archydragon/sublime-janet

Feature details

Syntax highlighting

There is a known bug that it isn't very consistent when it comes to highlighting top level def calls. Other than that, should be fine.

Build system

For this and REPL, you need to have Janet binary under one of directories listed in PATH environment variable.

jpm

jpm is used as default build system, if project.janet file is present in the root directory.

Windows build note: you need to set vcvars_bat_path variable in your Sublime Text settings to match MSVC batch file used for initialization of build environment (e.g. "C:\\Program Files\\Microsoft Visual Studio\\2022\\Professional\\VC\\Auxiliary\\Build\\vcvars64.bat"). See MS documentation about command line toolset for extra details.

There are also shortcuts for jpm clean and jpm test available in command palette.

Single script evaluation

Strictly talking, it isn't a build system, just an evaluation of current file using available Janet interpreter. Partial evaluation of expressions isn't supported yet.

Integration with SublimeREPL

SublimeREPL upstream seems to be not really maintained for some years, but still works. Out of the box, if you have it installed, after adding Janet package to Sublime Text, its REPL should be available under ToolsSublimeREPLJanet. However, if you want it to be available through the command palette, you should do the following:

  1. Go to SublimeREPL installation directory (under user packages).
  2. Create a directory there config/Janet.
  3. Copy file SublimeREPL/Main.sublime-menu from this repo to config/Janet.
  4. Create a file config/Janet/Default.sublime-commands with the following content:
[
    {
        "caption": "SublimeREPL: Janet",
        "command": "run_existing_window_command", "args":
        {
            "id": "repl_janet",
            "file": "config/Janet/Main.sublime-menu"
        }
    }
]

Ctrl+, shortcuts still don't work, and I ain't sure if I did something wrong or just the age of SublimeREPL projects reveals itself.

License

MIT

sublime-janet's People

Contributors

archydragon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kamisori

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.