Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ eslint.config.mjs
justfile
tsconfig.json
webpack.config.js
syntaxes/tests/**
syntaxes/test-grammars/**

# Explicitly include bin directory for bundled just-lsp binaries
!bin/**
3 changes: 1 addition & 2 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ lint:
"yarn lint --fix"

translate:
docker compose run --rm dev /bin/sh -c \
"yarn --silent js-yaml syntaxes/just.tmLanguage.yml > syntaxes/just.tmLanguage.json"
docker compose run --rm dev /bin/sh -c "yarn --silent translate"
docker compose run --rm dev /bin/sh -c "yarn --silent gen-scopes"

package +ARGS="":
Expand Down
17 changes: 13 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@
},
"scripts": {
"compile-extension": "webpack",
"watch": "webpack --watch --verbose",
"watch": "webpack --watch",
"package": "webpack --mode production --devtool hidden-source-map",
"compile": "tsc -p . --outDir out",
"watch-tests": "tsc -p . -w --outDir out",
"pretest": "yarn compile && yarn compile-extension",
"pretest": "yarn translate && yarn compile && yarn compile-extension",
"test-extension": "vscode-test --disable-extensions",
"test-grammar": "vscode-tmgrammar-snap syntaxes/tests/**/*.just",
"test-grammar": "vscode-tmgrammar-snap syntaxes/tests/**/*.just -g syntaxes/test-grammars/JavaScript.tmLanguage.json -g syntaxes/test-grammars/MagicPython.tmLanguage.json -g syntaxes/test-grammars/MagicRegExp.tmLanguage.json -g syntaxes/test-grammars/perl.tmLanguage.json -g syntaxes/test-grammars/perl6.tmLanguage.json -g syntaxes/test-grammars/ruby.tmLanguage.json -g syntaxes/test-grammars/shell-unix-bash.tmLanguage.json -g syntaxes/test-grammars/TypeScript.tmLanguage.json",
"translate": "yarn --silent js-yaml syntaxes/just.tmLanguage.yml > syntaxes/just.tmLanguage.json",
"format": "prettier --log-level warn --cache .",
"lint": "eslint . --cache --cache-location node_modules/.cache/eslint",
"gen-scopes": "yarn compile && node out/genScopes.js"
Expand Down Expand Up @@ -61,7 +62,15 @@
{
"language": "just",
"scopeName": "source.just",
"path": "./syntaxes/just.tmLanguage.json"
"path": "./syntaxes/just.tmLanguage.json",
"embeddedLanguages": {
"source.js": "javascript",
"source.ts": "typescript",
"source.perl": "perl",
"source.python": "python",
"source.ruby": "ruby",
"source.shell": "shell"
}
}
],
"configuration": {
Expand Down
18 changes: 11 additions & 7 deletions syntaxes/just.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@
"$schema": "https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",
"name": "Just",
"scopeName": "source.just",
"fileTypes": ["just", "justfile", "Justfile"],
"fileTypes": [
"just",
"justfile",
"Justfile"
],
"firstLineMatch": "#![\\s\\t]*\\/.*\\just\\b",
"uuid": "8b0cfae0-229f-4688-a4b7-8b5c3db82855",
"patterns": [
Expand Down Expand Up @@ -669,7 +673,7 @@
{
"comment": "JavaScript",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?node.*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand All @@ -685,7 +689,7 @@
{
"comment": "Deno",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?deno.*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand All @@ -701,7 +705,7 @@
{
"comment": "Perl",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?perl.*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand All @@ -717,7 +721,7 @@
{
"comment": "Python",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?python.*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand All @@ -733,7 +737,7 @@
{
"comment": "Ruby",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?ruby.*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand All @@ -749,7 +753,7 @@
{
"comment": "Shell",
"begin": "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?(?:sh|bash|zsh|fish).*)$",
"end": "(?<=^[^\\s]+)",
"end": "(?=^[^\\s])",
"beginCaptures": {
"1": {
"name": "comment.line.number-sign.shebang.just"
Expand Down
12 changes: 6 additions & 6 deletions syntaxes/just.tmLanguage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ repository:
patterns:
- comment: JavaScript
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?node.*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand All @@ -503,7 +503,7 @@ repository:
- include: source.js
- comment: Deno
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?deno.*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand All @@ -512,7 +512,7 @@ repository:
- include: source.ts
- comment: Perl
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?perl.*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand All @@ -521,7 +521,7 @@ repository:
- include: source.perl
- comment: Python
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?python.*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand All @@ -530,7 +530,7 @@ repository:
- include: source.python
- comment: Ruby
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?ruby.*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand All @@ -539,7 +539,7 @@ repository:
- include: source.ruby
- comment: Shell
begin: "^\\s+(#!/usr/bin/env\\s+(?:-S\\s+)?(?:sh|bash|zsh|fish).*)$"
end: (?<=^[^\s]+)
end: (?=^[^\s])
beginCaptures:
'1':
name: comment.line.number-sign.shebang.just
Expand Down
Loading
Loading