Skip to content
プロジェクト

概要

just ファイル向けの VSCode シンタックスハイライト

その他のプロジェクト

この数値の測り方

できること

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

計測したスター増加

24時間
+2
7日間
+2
15日間
+5
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

vscode-just

license ci Gitmoji

VSCode syntax highlighting extension for the just language.

Contents:

Features

Basic syntax highlighting for just files:

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

Commands:

  • Format on save
  • Run recipe
  • Task running

Demo:

  • VSCode with just syntax highlighting

    syntax highlight example
  • GitHub syntax highlighting

    # Demo
    
    set tempdir := "/tmp"
    
    export MY_VAR := `./my_script.sh`
    
    [confirm("Continue?")]
    @foo PARAM_1="hello" PARAM_2="world" +ARGS="":
        echo {{ PARAM_1 }} {{ PARAM_2 }} {{ ARGS }}
    
    python:
        #!/usr/bin/env python3
        print('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 apply just highlighting within recipe bodies. This means just keywords/operators/etc, like if, 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 latest release 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

See CHANGELOG.md.

Roadmap

Outstanding:

  • Improve handling of recipe body highlighting
  • Improve handling of embedded languages
  • Inline command runner
  • Support code outline

Completed:

  • Initial release
  • Update with new just releases
  • Migrate to yaml grammar for composability and readability
  • Add snapshot testing
  • Publish to open source marketplaces
  • Format on save
  • Run recipe
  • Default formatter support
  • Integrate just-lsp

Contributing

See CONTRIBUTING.md.

References

関連プロジェクトを探す

読み込み中…