Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

VSCode syntax highlighting for just files

License

NotificationsYou must be signed in to change notification settings

nefrob/vscode-just

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

licenseciGitmoji

VSCode syntax highlighting extension for thejust language.

Contents:

Features

Basic syntax highlighting forjust files:

  • Comments
  • Variable assignment and settings
  • Strings & interpolation blocks
  • Recipes: recipe attributes, names, params and dependencies
  • Keywords, constants and operators
  • Some embedded languages

Commands:

  • Format on save
  • Run recipe
  • Task running

Demo:

  • VSCode withjust syntax highlightingsyntax highlight example

  • GitHub syntax highlighting

    # Demosettempdir:="/tmp"exportMY_VAR:=`./my_script.sh`[confirm("Continue?")]@fooPARAM_1="hello"PARAM_2="world"+ARGS="":    echo{{ PARAM_1}}{{ PARAM_2}}{{ ARGS}}python:#!/usr/bin/env python3print('Hello from python!')

Known Issues

This extension does simple and/or best effort syntax highlighting. It is not intended to be 100% comprehensive, but rather provide a good enough experience for most users. That being said, if you find a bug or missing feature, please open an issue or a pull request.

Nesting and scoping

Since expressions can have deep nesting and we cannot tell the scope based on indentation or other markers, we run into the following issues. These are limitations of TextMate grammars and is not easily fixable.

  • Expression and recipe specific rules pollute the global repository scopes, meaning we applyjust highlighting within recipe bodies. This meansjust keywords/operators/etc, likeif, will highlight everywhere. This is necessary to highlight expressions correctly elsewhere.

  • Some nested expressions will break due to lack of awareness of depth and preemptively match a closing character. Ex.

    echo{{'{{ string}}' }}

    will echo{{ string }} since braces within the string are escaped and part of the string's scope. Textmate can't handle this without a full parser, so will match on the first closing brace it finds.

  • Line breaking and expressions that span multiple lines may not highlight correctly. As a simple example

    foo param1 \    param2='foo':echo{{param1}}{{param2}}

Publishing

This extension is available on the following marketplaces:

If you are using an open source build of VSCode, you might need to install the extension manually. To do so:

  1. Navigate to the latestrelease and download the.vsix file.
  2. Copy the file to your.vscode/extensions directory.
  3. Install via the command line:code --install-extension .vscode/extensions/vscode-just-X.Y.Z.vsix

Release Notes

SeeCHANGELOG.md.

Roadmap

Outstanding:

  • Update to matchjust grammar more accurately
  • Improve escaping within strings

Completed:

  • Initial release
  • Update with newjust releases
  • Migrate toyaml grammar for composability and readability
  • Add snapshot testing
  • Publish toopen source marketplaces
  • Format on save
  • Run recipe

Beyond

  • Semantic highlighting / LSP

    To avoid implementing a parser for files, it would be ideal forjust to expose the AST or other APIs for editor extensions to leverage. This would allow for more advanced features like semantic highlighting, code folding, and more.

    If VSCode works to support tree-sitter,that would be a possible alternative.

Contributing

SeeCONTRIBUTING.md.

References


[8]ページ先頭

©2009-2025 Movatter.jp