diff --git a/.github/workflows/duper_lsp.yaml b/.github/workflows/duper_lsp.yaml deleted file mode 100644 index 9038412..0000000 --- a/.github/workflows/duper_lsp.yaml +++ /dev/null @@ -1,110 +0,0 @@ -on: - workflow_dispatch: - -permissions: - contents: read - -env: - RUST_VERSION: "1.92.0" - CARGO_INCREMENTAL: "0" - CARGO_PROFILE_TEST_DEBUG: "0" - -jobs: - prepare: - runs-on: ubuntu-24.04 - outputs: - version: ${{ steps.duper_lsp_version.outputs.version }} - steps: - - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: false - - name: Get duper_lsp version - id: duper_lsp_version - run: | - echo "version=$(cargo metadata | jq -r '.packages[] | select(.name == "duper_lsp") | .version')" >> "$GITHUB_OUTPUT" - build: - strategy: - fail-fast: false - matrix: - include: - - runner: ubuntu-24.04 - target: x86_64-unknown-linux-gnu - suffix: linux-x64 - os: linux - - runner: ubuntu-24.04 - target: aarch64-unknown-linux-gnu - suffix: linux-arm64 - os: linux - - runner: windows-latest - target: x86_64-pc-windows-msvc - suffix: win32-x64 - os: windows - - runner: windows-latest - target: aarch64-pc-windows-msvc - suffix: win32-arm64 - os: windows - - runner: macos-15 - target: x86_64-apple-darwin - suffix: darwin-x64 - os: macos - - runner: macos-15 - target: aarch64-apple-darwin - suffix: darwin-arm64 - os: macos - name: Build and distribute duper_lsp_${{ matrix.suffix }} - runs-on: ${{ matrix.runner }} - needs: - - prepare - environment: codeberg - steps: - - name: Checkout repository - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 - with: - persist-credentials: true - - name: Fetch MSRV and add target - run: | - rustup toolchain install ${RUST_VERSION} - rustup override set ${RUST_VERSION} - rustup target add ${{ matrix.target }} - - name: Install Zig - if: matrix.runner == 'ubuntu-24.04' - uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 - with: - version: latest - - name: Install cargo-zigbuild (Linux) - if: matrix.runner == 'ubuntu-24.04' - uses: taiki-e/install-action@a24ba45235ed716ff76646268742990dc9458860 # v2.62.42 - with: - tool: cargo-zigbuild - - name: Install lld (macOS) - if: matrix.os == 'macos' - run: | - brew install lld - - name: Install lld (Windows) - if: matrix.os == 'windows' - run: | - choco install llvm - - name: Build with cargo-zigbuild (Linux) - if: matrix.runner == 'ubuntu-24.04' - run: | - cargo zigbuild --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml - - name: Build with cargo (macOS / Windows) - if: matrix.runner != 'ubuntu-24.04' - run: | - cargo build --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml - - name: Push binary to Codeberg (Linux / macOS) - if: matrix.os != 'windows' - run: | - curl --fail \ - --header "Authorization: token ${{ secrets.CODEBERG_PACKAGE_WRITE_TOKEN }}" \ - --upload-file target/${{ matrix.target }}/release/duper_lsp \ - "https://codeberg.org/api/packages/EpicEric9/generic/duper_lsp/${{ needs.prepare.outputs.version }}/duper_lsp_${{ matrix.suffix }}" - - name: Push binary to Codeberg (Windows) - if: matrix.os == 'windows' - shell: bash - run: | - curl --fail \ - --header "Authorization: token ${{ secrets.CODEBERG_PACKAGE_WRITE_TOKEN }}" \ - --upload-file target/${{ matrix.target }}/release/duper_lsp.exe \ - "https://codeberg.org/api/packages/EpicEric9/generic/duper_lsp/${{ needs.prepare.outputs.version }}/duper_lsp_${{ matrix.suffix }}.exe" diff --git a/.github/workflows/release-rust.yaml b/.github/workflows/release-rust.yaml index 9687aa6..7faa5c0 100644 --- a/.github/workflows/release-rust.yaml +++ b/.github/workflows/release-rust.yaml @@ -19,12 +19,117 @@ env: CARGO_PROFILE_TEST_DEBUG: "0" jobs: + prepare_duper_lsp: + if: startsWith(github.ref_name, 'duper_lsp@') + runs-on: ubuntu-24.04 + outputs: + version: ${{ steps.duper_lsp_version.outputs.version }} + steps: + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: false + - name: Get duper_lsp version + id: duper_lsp_version + run: | + echo "version=$(cargo metadata | jq -r '.packages[] | select(.name == "duper_lsp") | .version')" >> "$GITHUB_OUTPUT" + + build_duper_lsp: + if: startsWith(github.ref_name, 'duper_lsp@') + strategy: + fail-fast: false + matrix: + include: + - runner: ubuntu-24.04 + target: x86_64-unknown-linux-gnu + suffix: linux-x64 + os: linux + - runner: ubuntu-24.04 + target: aarch64-unknown-linux-gnu + suffix: linux-arm64 + os: linux + - runner: windows-latest + target: x86_64-pc-windows-msvc + suffix: win32-x64 + os: windows + - runner: windows-latest + target: aarch64-pc-windows-msvc + suffix: win32-arm64 + os: windows + - runner: macos-15 + target: x86_64-apple-darwin + suffix: darwin-x64 + os: macos + - runner: macos-15 + target: aarch64-apple-darwin + suffix: darwin-arm64 + os: macos + name: Build and distribute duper_lsp_${{ matrix.suffix }} + runs-on: ${{ matrix.runner }} + needs: + - prepare_duper_lsp + environment: codeberg + steps: + - name: Checkout repository + uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 + with: + persist-credentials: true + - name: Fetch MSRV and add target + run: | + rustup toolchain install ${RUST_VERSION} + rustup override set ${RUST_VERSION} + rustup target add ${{ matrix.target }} + - name: Install Zig + if: matrix.runner == 'ubuntu-24.04' + uses: mlugg/setup-zig@8d6198c65fb0feaa111df26e6b467fea8345e46f # v2.0.5 + with: + version: latest + - name: Install cargo-zigbuild (Linux) + if: matrix.runner == 'ubuntu-24.04' + uses: taiki-e/install-action@a24ba45235ed716ff76646268742990dc9458860 # v2.62.42 + with: + tool: cargo-zigbuild + - name: Install lld (macOS) + if: matrix.os == 'macos' + run: | + brew install lld + - name: Install lld (Windows) + if: matrix.os == 'windows' + run: | + choco install llvm + - name: Build with cargo-zigbuild (Linux) + if: matrix.runner == 'ubuntu-24.04' + run: | + cargo zigbuild --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml + - name: Build with cargo (macOS / Windows) + if: matrix.runner != 'ubuntu-24.04' + run: | + cargo build --locked --all-features --release --target ${{ matrix.target }} --manifest-path duper_lsp/Cargo.toml + - name: Push binary to Codeberg (Linux / macOS) + if: matrix.os != 'windows' + run: | + curl --fail \ + --header "Authorization: token ${{ secrets.CODEBERG_PACKAGE_WRITE_TOKEN }}" \ + --upload-file target/${{ matrix.target }}/release/duper_lsp \ + "https://codeberg.org/api/packages/EpicEric9/generic/duper_lsp/${{ needs.prepare_duper_lsp.outputs.version }}/duper_lsp_${{ matrix.suffix }}" + - name: Push binary to Codeberg (Windows) + if: matrix.os == 'windows' + shell: bash + run: | + curl --fail \ + --header "Authorization: token ${{ secrets.CODEBERG_PACKAGE_WRITE_TOKEN }}" \ + --upload-file target/${{ matrix.target }}/release/duper_lsp.exe \ + "https://codeberg.org/api/packages/EpicEric9/generic/duper_lsp/${{ needs.prepare_duper_lsp.outputs.version }}/duper_lsp_${{ matrix.suffix }}.exe" + publish-to-crates-io: name: Publish to crates.io runs-on: ubuntu-latest permissions: contents: read id-token: write + if: ${{ needs.build_duper_lsp.result == 'success' || needs.build_duper_lsp.result == 'skipped' }} + needs: + - build_duper_lsp steps: - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 with: diff --git a/duper_zed/.gitignore b/duper_zed/.gitignore new file mode 100644 index 0000000..308dbf7 --- /dev/null +++ b/duper_zed/.gitignore @@ -0,0 +1,3 @@ +target/ +grammars/ +*.wasm diff --git a/duper_zed/extension.toml b/duper_zed/extension.toml index 508b26c..1cdd53e 100644 --- a/duper_zed/extension.toml +++ b/duper_zed/extension.toml @@ -8,7 +8,7 @@ schema_version = 1 [grammars.duper] repository = "https://github.com/EpicEric/duper" -rev = "d16fee4ced27293cb80503544051c9b4442cc782" +rev = "def2c6b9a9f0ffac7e03cdcd685c417677bf7624" path = "tree-sitter-duper" [language_servers.duper_lsp] diff --git a/duper_zed/languages/duper/brackets.scm b/duper_zed/languages/duper/brackets.scm index 4257ebf..f780f57 100644 --- a/duper_zed/languages/duper/brackets.scm +++ b/duper_zed/languages/duper/brackets.scm @@ -2,10 +2,4 @@ ("[" @open "]" @close) ("{" @open "}" @close) ("'" @open "'" @close) -("r\"" @open "\"" @close) -("r#\"" @open "\"#" @close) -("r##\"" @open "\"##" @close) -("r###\"" @open "\"###" @close) -("r####\"" @open "\"####" @close) -("r#####\"" @open "\"#####" @close) ("\"" @open "\"" @close) diff --git a/duper_zed/languages/duper/config.toml b/duper_zed/languages/duper/config.toml index a61a155..85bcb55 100644 --- a/duper_zed/languages/duper/config.toml +++ b/duper_zed/languages/duper/config.toml @@ -4,3 +4,16 @@ path_suffixes = ["duper"] line_comments = ["// "] tab_size = 2 hard_tabs = false +brackets = [ + { start = "{", end = "}", close = true, newline = false }, + { start = "[", end = "]", close = true, newline = false }, + { start = "(", end = ")", close = true, newline = false }, + { start = "r\"", end = "\"", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "r#\"", end = "\"#", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "r##\"", end = "\"##", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "r###\"", end = "\"###", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "r####\"", end = "\"####", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "r#####\"", end = "\"#####", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "\"", end = "\"", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, + { start = "'", end = "'", close = true, newline = false, not_in = ["string", "bytes", "line_comment", "block_comment"] }, +] diff --git a/duper_zed/languages/duper/highlights.scm b/duper_zed/languages/duper/highlights.scm index a0836ef..a6908f0 100644 --- a/duper_zed/languages/duper/highlights.scm +++ b/duper_zed/languages/duper/highlights.scm @@ -1,5 +1,13 @@ (line_comment) @comment (block_comment) @comment +[ + "[" + "]" + "(" + ")" + "{" + "}" +] @punctuation.bracket (object_key) @property (boolean) @keyword (null) @keyword