Skip to content
Draft
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
128 changes: 128 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
name: release

on:
push:
tags:
- "v*"

permissions:
contents: write

env:
BIN_NAME: objectscript-lsp

jobs:
build-and-upload:
strategy:
fail-fast: false
matrix:
include:
# Linux (glibc)
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
platform: linux-x64
build: cargo

- os: ubuntu-latest
target: aarch64-unknown-linux-gnu
platform: linux-arm64
build: cross

# Linux (musl / Alpine)
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
platform: alpine-x64
build: cross

- os: ubuntu-latest
target: aarch64-unknown-linux-musl
platform: alpine-arm64
build: cross

# macOS
- os: macos-latest
target: x86_64-apple-darwin
platform: darwin-x64
build: cargo

- os: macos-latest
target: aarch64-apple-darwin
platform: darwin-arm64
build: cargo

# Windows
- os: windows-latest
target: x86_64-pc-windows-msvc
platform: win32-x64
build: cargo

- os: windows-latest
target: aarch64-pc-windows-msvc
platform: win32-arm64
build: cargo

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Cache cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
workspaces: objectscript-lsp -> target

- name: Build (native)
if: matrix.build == 'cargo'
working-directory: objectscript-lsp
run: cargo build --release --target ${{ matrix.target }}

- name: Install cross
if: matrix.build == 'cross'
run: cargo install cross

- name: Build (cross)
if: matrix.build == 'cross'
working-directory: objectscript-lsp
run: cross build --release --target ${{ matrix.target }}

# Package for macOS/Linux
- name: Package (tar.gz)
if: runner.os != 'Windows'
shell: bash
run: |
set -euo pipefail
TAG="${GITHUB_REF_NAME}"
OUT="${{ env.BIN_NAME }}-${TAG}-${{ matrix.platform }}"
BIN="${{ env.BIN_NAME }}"

mkdir -p "${OUT}/bin"
cp "objectscript-lsp/target/${{ matrix.target }}/release/${BIN}" "${OUT}/bin/"
chmod +x "${OUT}/bin/${BIN}"

tar -czf "${OUT}.tar.gz" -C "${OUT}" .
echo "ASSET=${OUT}.tar.gz" >> "$GITHUB_ENV"

# Package for Windows
- name: Package (zip)
if: runner.os == 'Windows'
shell: pwsh
run: |
$tag = "${{ github.ref_name }}"
$out = "${{ env.BIN_NAME }}-$tag-${{ matrix.platform }}"
$bin = "${{ env.BIN_NAME }}.exe"

New-Item -ItemType Directory -Force "$out/bin" | Out-Null
Copy-Item "objectscript-lsp\target\${{ matrix.target }}\release\$bin" "$out\bin\"
Compress-Archive -Path "$out\*" -DestinationPath "$out.zip"
"ASSET=$out.zip" | Out-File -FilePath $env:GITHUB_ENV -Append

- name: Upload asset to GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ${{ env.ASSET }}
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
/*.wasm
/target
target/
grammars/

**/*.rs.bk
Cargo.lock
# Optional: common local/IDE files
.DS_Store
.vscode/
.idea/
.tabnine/
vscode/
objectscript-lsp/objectscript-tests/local/
objectscript-lsp/documentation/
12 changes: 12 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[package]
name = "zed-objectscript"
version = "1.5.0"
edition = "2021"
license = "MIT"

[lib]
path = "src/objectscript.rs"
crate-type = ["cdylib"]

[dependencies]
zed_extension_api = "0.7.0"
12 changes: 8 additions & 4 deletions extension.toml
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
id = "objectscript"
name = "InterSystems ObjectScript"
version = "1.4.0"
version = "1.5.0"
schema_version = 1
authors = ["Dave McCaldon <davem@intersystems.com>","Hannah Kimura <hannah.kimura@intersystems.com>"]
description = "InterSystems IRIS ObjectScript Extension"
repository = "https://github.com/intersystems/zed-objectscript"

[grammars.objectscript_udl]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "ce29cca45e01ff3be4894204f681b0aecf9409a5"
commit = "d29750b076de8e9fce475225041ae008e357bf2c"
path = "udl"

[grammars.objectscript_routine]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "ce29cca45e01ff3be4894204f681b0aecf9409a5"
commit = "d29750b076de8e9fce475225041ae008e357bf2c"
path = "objectscript_routine"

[grammars.objectscript]
repository = "https://github.com/intersystems/tree-sitter-objectscript"
commit = "ce29cca45e01ff3be4894204f681b0aecf9409a5"
commit = "d29750b076de8e9fce475225041ae008e357bf2c"
path = "objectscript"

[grammars.xml]
repository = "https://github.com/tree-sitter-grammars/tree-sitter-xml"
commit = "5000ae8f22d11fbe93939b05c1e37cf21117162d"
path = "xml"

[language_servers.objectscript-lsp]
name = "objectscript-lsp"
languages = ["objectscript_udl", "objectscript_routine", "xml", "objectscript"]
29 changes: 10 additions & 19 deletions languages/objectscript/highlights.scm
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@
; === BEGIN EXPR ===
(pattern_expression) @string.regex

[
(json_number_literal)
(numeric_literal)
] @number
(numeric_literal) @number

[
(json_boolean_literal)
Expand All @@ -23,12 +20,17 @@
] @string

[
(keyword_pound_pound_super)
(keyword_super)
(keyword_pound_pound_class)
] @keyword

(system_defined_function) @constant.builtin

[
"("
")"
] @constant.builtin

; this is because . is grouped into system_defined_function
; and I want the dots to be the same color
(class_method_call
Expand Down Expand Up @@ -89,7 +91,6 @@
"']"
"']]"
"\""
"\"\""
"["
"]"
"]]"
Expand Down Expand Up @@ -129,8 +130,6 @@
"?"
] @operator

(bracket) @punctuation.bracket

; === END EXPR ===
; === BEGIN CORE ===
(macro_arg) @variant
Expand All @@ -139,11 +138,6 @@

(macro_def) @preproc

[
"("
")"
] @punctuation.bracket

[
(keyword_pound_define)
(keyword_pound_def1arg)
Expand Down Expand Up @@ -289,13 +283,9 @@
(elseif_block_dotted
"." @string.special.symbol)

(catch_block_dotted
"." @string.special.symbol)

(variable_datatype
"." @constant.builtin)

(instance_method_call
(variable_datatype
"." @constant.builtin)

; === END CORE ===
Expand Down Expand Up @@ -330,7 +320,7 @@
(class_keywords)
(query_keywords)
(trigger_keyword)
(method_keyword_language)
(method_keyword_external_language)
(relationship_keyword)
(foreignkey_keyword)
(parameter_keyword)
Expand Down Expand Up @@ -359,6 +349,7 @@
(storage_name)
(xml_identifier)
(index_property)
(column_name)
] @variant

[
Expand Down
Loading