diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 44d267884d23..d7d7d47e02ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.63 + uses: dtolnay/rust-toolchain@1.65 - uses: Swatinem/rust-cache@v2 @@ -66,7 +66,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.63 + uses: dtolnay/rust-toolchain@1.65 with: components: rustfmt, clippy @@ -91,7 +91,7 @@ jobs: uses: actions/checkout@v3 - name: Install stable toolchain - uses: dtolnay/rust-toolchain@1.63 + uses: dtolnay/rust-toolchain@1.65 - uses: Swatinem/rust-cache@v2 diff --git a/.github/workflows/cachix.yml b/.github/workflows/cachix.yml index bcdea3197dec..7d2f734aa20c 100644 --- a/.github/workflows/cachix.yml +++ b/.github/workflows/cachix.yml @@ -14,7 +14,7 @@ jobs: uses: actions/checkout@v3 - name: Install nix - uses: cachix/install-nix-action@v19 + uses: cachix/install-nix-action@v20 - name: Authenticate with Cachix uses: cachix/cachix-action@v12 diff --git a/Cargo.lock b/Cargo.lock index b70f34c412b1..090b5f027492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,15 +61,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" -[[package]] -name = "atoi" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28d99ec8bfea296261ca1af174f24225171fea9664ba9003cbebee704810528" -dependencies = [ - "num-traits", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -95,9 +86,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.0.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca0852af221f458706eb0725c03e4ed6c46af9ac98e6a689d5e634215d594dd" +checksum = "5ffdb39cb703212f3c11973452c2861b972f757b021158f3516ba10f2fa8b2c1" dependencies = [ "memchr", "once_cell", @@ -107,9 +98,9 @@ dependencies = [ [[package]] name = "btoi" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c0869a9faa81f8bbf8102371105d6d0a7b79167a04c340b04ab16892246a11" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" dependencies = [ "num-traits", ] @@ -132,27 +123,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" -[[package]] -name = "bytesize" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c58ec36aac5066d5ca17df51b3e70279f5670a72102f5752cb7e7c856adfc70" - [[package]] name = "cassowary" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df8670b8c7b9dae1793364eafadf7239c40d669904660c5960d74cfd80b46a53" -[[package]] -name = "castaway" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" -dependencies = [ - "rustversion", -] - [[package]] name = "cc" version = "1.0.79" @@ -215,17 +191,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "compact_str" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5138945395949e7dfba09646dc9e766b548ff48e23deb5246890e6b64ae9e1b9" -dependencies = [ - "castaway", - "itoa", - "ryu", -] - [[package]] name = "content_inspector" version = "0.2.4" @@ -261,16 +226,16 @@ dependencies = [ [[package]] name = "crossterm" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" +checksum = "a84cda67535339806297f1b331d6dd6320470d2a0fe65381e79ee9e156dd3d13" dependencies = [ "bitflags", "crossterm_winapi", "futures-core", "libc", "mio", - "parking_lot 0.12.1", + "parking_lot", "signal-hook", "signal-hook-mio", "winapi", @@ -329,19 +294,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dashmap" -version = "5.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" -dependencies = [ - "cfg-if", - "hashbrown 0.12.3", - "lock_api", - "once_cell", - "parking_lot_core 0.9.4", -] - [[package]] name = "dirs" version = "4.0.0" @@ -383,6 +335,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "dunce" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bd4b30a6560bbd9b4620f4de34c3f14f60848e58a9b7216801afcb4c7b31c3c" + [[package]] name = "either" version = "1.8.0" @@ -407,6 +365,27 @@ dependencies = [ "encoding_rs", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "error-code" version = "2.3.1" @@ -540,75 +519,116 @@ dependencies = [ ] [[package]] -name = "git-actor" -version = "0.17.0" +name = "gix" +version = "0.39.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dabfac58aecb4a38cdd2568de66eb1f0d968fd6726f5a80cb8bea7944ef10cc0" +dependencies = [ + "gix-actor", + "gix-attributes", + "gix-config", + "gix-credentials", + "gix-date", + "gix-diff", + "gix-discover", + "gix-features", + "gix-glob", + "gix-hash", + "gix-hashtable", + "gix-index", + "gix-lock", + "gix-mailmap", + "gix-object", + "gix-odb", + "gix-pack", + "gix-path", + "gix-prompt", + "gix-ref", + "gix-refspec", + "gix-revision", + "gix-sec", + "gix-tempfile", + "gix-traverse", + "gix-url", + "gix-validate", + "gix-worktree", + "log", + "once_cell", + "signal-hook", + "smallvec", + "thiserror", + "unicode-normalization", +] + +[[package]] +name = "gix-actor" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9e5fd7bc63ad527d64584f8d01f99b89c051f5fbb8144b58ae5f812775065cf" +checksum = "dc22b0cdc52237667c301dd7cdc6ead8f8f73c9f824e9942c8ebd6b764f6c0bf" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "btoi", - "git-date", + "gix-date", "itoa", "nom", - "quick-error", + "thiserror", ] [[package]] -name = "git-attributes" -version = "0.8.0" +name = "gix-attributes" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8013dfce47c1e29236d732308933e2c77af5355ec5105755d26faf7764d3f7b" +checksum = "2231a25934a240d0a4b6f4478401c73ee81d8be52de0293eedbc172334abf3e1" dependencies = [ - "bstr 1.0.1", - "compact_str", - "git-features", - "git-glob", - "git-path", - "git-quote", + "bstr 1.3.0", + "gix-features", + "gix-glob", + "gix-path", + "gix-quote", "thiserror", "unicode-bom", ] [[package]] -name = "git-bitmap" -version = "0.2.0" +name = "gix-bitmap" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44304093ac66a0ada1b243c15c3a503a165a1d0f50bec748f4e5a9b84a0d0722" +checksum = "024bca0c7187517bda5ea24ab148c9ca8208dd0c3e2bea88cdb2008f91791a6d" dependencies = [ - "quick-error", + "thiserror", ] [[package]] -name = "git-chunk" -version = "0.4.0" +name = "gix-chunk" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3090baa2f4a3fe488a9b3e31090b83259aaf930bf0634af34c18117274f8f1a8" +checksum = "b0d39583cab06464b8bf73b3f1707458270f0e7383cb24c3c9c1a16e6f792978" dependencies = [ "thiserror", ] [[package]] -name = "git-command" -version = "0.2.1" +name = "gix-command" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215145cc1686a45bc6f9872b153a0d3f3c40a1b94173a928325e1b53dfa5e2af" +checksum = "b2c6f75c1e0f924de39e750880a6e21307194bb1ab773efe3c7d2d787277f8ab" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", ] [[package]] -name = "git-config" -version = "0.15.0" +name = "gix-config" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9da662fd64ac69772158dcf04777da6266f0f36bc9a310b3eb2d805bb696315" +checksum = "52c62e26ce11f607712e4f49a0a192ed87675d30187fd61be070abbd607d12f1" dependencies = [ - "bstr 1.0.1", - "git-config-value", - "git-features", - "git-glob", - "git-path", - "git-ref", - "git-sec", + "bstr 1.3.0", + "gix-config-value", + "gix-features", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", "memchr", "nom", "once_cell", @@ -618,135 +638,137 @@ dependencies = [ ] [[package]] -name = "git-config-value" -version = "0.10.0" +name = "gix-config-value" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989a90c1c630513a153c685b4249b96fdf938afc75bf7ef2ae1ccbd3d799f5db" +checksum = "693d4a4ba0531e46fe558459557a5b29fb86c3e4b2666c1c0861d93c7c678331" dependencies = [ "bitflags", - "bstr 1.0.1", - "git-path", + "bstr 1.3.0", + "gix-path", "libc", "thiserror", ] [[package]] -name = "git-credentials" -version = "0.9.0" +name = "gix-credentials" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cd6bbe001afd6356b35ef13f2a6b0f0abc0133d1b2ecaec1033bdd769616d6" +checksum = "5be32b5fe339a31b8e53fa854081dc914c45020dcb64637f3c21baf69c96fc1b" dependencies = [ - "bstr 1.0.1", - "git-command", - "git-config-value", - "git-path", - "git-prompt", - "git-sec", - "git-url", + "bstr 1.3.0", + "gix-command", + "gix-config-value", + "gix-path", + "gix-prompt", + "gix-sec", + "gix-url", "thiserror", ] [[package]] -name = "git-date" -version = "0.4.0" +name = "gix-date" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "412c9b89026505bd24d5f8acafa578de6eea3b271ece307a73b8e646e671302a" +checksum = "b96271912ce39822501616f177dea7218784e6c63be90d5f36322ff3a722aae2" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "itoa", "thiserror", "time", ] [[package]] -name = "git-diff" -version = "0.26.0" +name = "gix-diff" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca87474422d26d606d04cec6bedfabcd92a0a74102cd7936785358ced6a4a25a" +checksum = "585b0834d4b6791a848637c4e109545fda9b0f29b591ba55edb33ceda6e7856b" dependencies = [ - "git-hash", - "git-object", + "gix-hash", + "gix-object", "imara-diff", "thiserror", ] [[package]] -name = "git-discover" -version = "0.12.0" +name = "gix-discover" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9e26e0bc434643228cd418185bd28ca5c7cf831bde1da434807391c27ac40e" +checksum = "91c204adba5ebd211c74735cbb65817d277e154486bac0dffa3701f163b80350" dependencies = [ - "bstr 1.0.1", - "git-hash", - "git-path", - "git-ref", - "git-sec", + "bstr 1.3.0", + "dunce", + "gix-hash", + "gix-path", + "gix-ref", + "gix-sec", "thiserror", ] [[package]] -name = "git-features" -version = "0.26.0" +name = "gix-features" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff74064fa007c5beefa89a64bb72834f32b3c497750a56c79c6802bbdb311f9" +checksum = "5e6a9dfa7b3c1a99315203e8b97f8f99f3bd95731590607abeaa5ca31bc41fe3" dependencies = [ "crc32fast", "flate2", - "git-hash", + "gix-hash", "libc", "once_cell", "prodash", - "quick-error", "sha1_smol", + "thiserror", "walkdir", ] [[package]] -name = "git-glob" -version = "0.5.1" +name = "gix-glob" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3908404c9b76ac7b3f636a104142378d3eaa78623cbc6eb7c7f0651979d48e8a" +checksum = "93e43efd776bc543f46f0fd0ca3d920c37af71a764a16f2aebd89765e9ff2993" dependencies = [ "bitflags", - "bstr 1.0.1", + "bstr 1.3.0", ] [[package]] -name = "git-hash" -version = "0.10.1" +name = "gix-hash" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1532d82bf830532f8d545c5b7b568e311e3593f16cf7ee9dd0ce03c74b12b99d" +checksum = "0c0c5a9f4d621d4f4ea046bb331df5c746ca735b8cae5b234cc2be70ee4dbef0" dependencies = [ "hex", "thiserror", ] [[package]] -name = "git-hashtable" -version = "0.1.0" +name = "gix-hashtable" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52b625ad8cc360a0b7f426266f21fb07bd49b8f4ccf1b3ca7bc89424db1dec4" +checksum = "9609c1b8f36f12968e6a6098f7cdb52004f7d42d570f47a2d6d7c16612f19acb" dependencies = [ - "git-hash", + "gix-hash", "hashbrown 0.13.2", + "parking_lot", ] [[package]] -name = "git-index" -version = "0.12.1" +name = "gix-index" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "485da97dd4f69c7d9a8dc238cd6f4a726387ffc34573489e8e0d2bee266e3454" +checksum = "c12caf7886c7ba06f2b28835cdc2be1dca86bd047d00299d2d49e707ce1c2616" dependencies = [ - "atoi", "bitflags", - "bstr 1.0.1", + "bstr 1.3.0", + "btoi", "filetime", - "git-bitmap", - "git-features", - "git-hash", - "git-lock", - "git-object", - "git-traverse", + "gix-bitmap", + "gix-features", + "gix-hash", + "gix-lock", + "gix-object", + "gix-traverse", "itoa", "memmap2", "smallvec", @@ -754,39 +776,39 @@ dependencies = [ ] [[package]] -name = "git-lock" -version = "3.0.0" +name = "gix-lock" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89e4f05b8a68c3a5dd83a6651c76be384e910fe283072184fdab9d77f87ccec2" +checksum = "66119ff8a4a395d0ea033fef718bc85f8b4f0855874f4ce1e005fc16cfe1f66e" dependencies = [ "fastrand", - "git-tempfile", - "quick-error", + "gix-tempfile", + "thiserror", ] [[package]] -name = "git-mailmap" -version = "0.9.0" +name = "gix-mailmap" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0316b4346f3e162ade368209efb8a609b587793c74aa3b8de0ec01a4f3580120" +checksum = "2b66aea5e52875cd4915f4957a6f4b75831a36981e2ec3f5fad9e370e444fe1a" dependencies = [ - "bstr 1.0.1", - "git-actor", - "quick-error", + "bstr 1.3.0", + "gix-actor", + "thiserror", ] [[package]] -name = "git-object" -version = "0.26.0" +name = "gix-object" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f8563e2d6f524d7053f3106714f99ecdc3adbba2cb7108c09d71a02579f2e19" +checksum = "8df068db9180ee935fbb70504848369e270bdcb576b05c0faa8b9fd3b86fc017" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "btoi", - "git-actor", - "git-features", - "git-hash", - "git-validate", + "gix-actor", + "gix-features", + "gix-hash", + "gix-validate", "hex", "itoa", "nom", @@ -795,248 +817,203 @@ dependencies = [ ] [[package]] -name = "git-odb" -version = "0.40.0" +name = "gix-odb" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616115a0e3daff6e08842758d24547b37a6eb6d0e2eedd95a740c3aaa2750333" +checksum = "e9a5f9e1afbd509761977a2ea02869cedaaba500b4e783deb2e4de5179a55a80" dependencies = [ "arc-swap", - "git-features", - "git-hash", - "git-object", - "git-pack", - "git-path", - "git-quote", - "parking_lot 0.12.1", + "gix-features", + "gix-hash", + "gix-object", + "gix-pack", + "gix-path", + "gix-quote", + "parking_lot", "tempfile", "thiserror", ] [[package]] -name = "git-pack" -version = "0.30.0" +name = "gix-pack" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cd16b88f4b66041f41ca510c28bd81c4ee7363c5a544b3d62b4170432965871" +checksum = "e51db84e1459a8022e518d40a8778028d793dbb28e4d35c9a5eaf92658fb0775" dependencies = [ - "bytesize", "clru", - "dashmap", - "git-chunk", - "git-diff", - "git-features", - "git-hash", - "git-hashtable", - "git-object", - "git-path", - "git-tempfile", - "git-traverse", + "gix-chunk", + "gix-diff", + "gix-features", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-traverse", "memmap2", - "parking_lot 0.12.1", + "parking_lot", "smallvec", "thiserror", ] [[package]] -name = "git-path" -version = "0.7.0" +name = "gix-path" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e40e68481a06da243d3f4dfd86a4be39c24eefb535017a862e845140dcdb878a" +checksum = "f6c104a66dec149cb8f7aaafc6ab797654cf82d67f050fd0cb7e7294e328354b" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "thiserror", ] [[package]] -name = "git-prompt" -version = "0.3.0" +name = "gix-prompt" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3612a486e507dd431ef0f7108eeaafc8fd1ed7bd0f205a88554f6f91fe5dccbf" +checksum = "a20cebf73229debaa82574c4fd20dcaf00fa8d4bfce823a862c4e990d7a0b5b4" dependencies = [ - "git-command", - "git-config-value", + "gix-command", + "gix-config-value", "nix", - "parking_lot 0.12.1", + "parking_lot", "thiserror", ] [[package]] -name = "git-quote" -version = "0.4.0" +name = "gix-quote" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd11f4e7f251ab297545faa4c5a4517f4985a43b9c16bf96fa49107f58e837f" +checksum = "a282f5a8d9ee0b09ec47390ac727350c48f2f5c76d803cd8da6b3e7ad56e0bcb" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "btoi", - "quick-error", + "thiserror", ] [[package]] -name = "git-ref" -version = "0.23.0" +name = "gix-ref" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6767925a6fc4af5c5a81e348d1d851c1b3ab2b512bd7f562ac11be37c14468" +checksum = "90a0ed29e581f04b904ecd0c32b11f33b8209b5a0af9c43f415249a4f2fba632" dependencies = [ - "git-actor", - "git-features", - "git-hash", - "git-lock", - "git-object", - "git-path", - "git-tempfile", - "git-validate", + "gix-actor", + "gix-features", + "gix-hash", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", "memmap2", "nom", "thiserror", ] [[package]] -name = "git-refspec" -version = "0.7.0" +name = "gix-refspec" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf310ed5f2829ac0af96e7d4aebd4ae4b89f0718a7ae3666d09b02b2c5a1dfd" +checksum = "aba332462bda2e8efeae4302b39a6ed01ad56ef772fd5b7ef197cf2798294d65" dependencies = [ - "bstr 1.0.1", - "git-hash", - "git-revision", - "git-validate", + "bstr 1.3.0", + "gix-hash", + "gix-revision", + "gix-validate", "smallvec", "thiserror", ] [[package]] -name = "git-repository" -version = "0.32.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993277960cb7e2d3991a11c1ec6951c1d142de052c26a18d2db64304e52d3741" -dependencies = [ - "git-actor", - "git-attributes", - "git-config", - "git-credentials", - "git-date", - "git-diff", - "git-discover", - "git-features", - "git-glob", - "git-hash", - "git-hashtable", - "git-index", - "git-lock", - "git-mailmap", - "git-object", - "git-odb", - "git-pack", - "git-path", - "git-prompt", - "git-ref", - "git-refspec", - "git-revision", - "git-sec", - "git-tempfile", - "git-traverse", - "git-url", - "git-validate", - "git-worktree", - "log", - "once_cell", - "prodash", - "signal-hook", - "smallvec", - "thiserror", - "unicode-normalization", -] - -[[package]] -name = "git-revision" -version = "0.10.0" +name = "gix-revision" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f9a6bd28c9d1676bb96f428cd09614ae18a0087d7cea1cebfd177e25f99b2af" +checksum = "ed98e4a0254953c64bc913bd23146a1de662067d5cf974cbdde396958b39e5b0" dependencies = [ - "bstr 1.0.1", - "git-date", - "git-hash", - "git-hashtable", - "git-object", + "bstr 1.3.0", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", "thiserror", ] [[package]] -name = "git-sec" -version = "0.6.0" +name = "gix-sec" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1802e8252fa223b0ad89a393aed461132174ced1e6842a41f56dc92a3fc14f" +checksum = "e8ffa5bf0772f9b01de501c035b6b084cf9b8bb07dec41e3afc6a17336a65f47" dependencies = [ "bitflags", "dirs", - "git-path", + "gix-path", "libc", "windows", ] [[package]] -name = "git-tempfile" -version = "3.0.0" +name = "gix-tempfile" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6bb4dee86c8cae5a078cfaac3b004ef99c31548ed86218f23a7ff9b4b74f3be" +checksum = "a8e0227bd284cd16105e8479602bb8af6bddcb800427e881c1feee4806310a31" dependencies = [ - "dashmap", "libc", "once_cell", + "parking_lot", "signal-hook", "signal-hook-registry", "tempfile", ] [[package]] -name = "git-traverse" -version = "0.22.0" +name = "gix-traverse" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd356da21ec00f69b9d4f105df4cb85543c746b18f4b7fc81529ce77713cdb29" +checksum = "dd9a4a07bb22168dc79c60e1a6a41919d198187ca83d8a5940ad8d7122a45df3" dependencies = [ - "git-hash", - "git-hashtable", - "git-object", + "gix-hash", + "gix-hashtable", + "gix-object", "thiserror", ] [[package]] -name = "git-url" -version = "0.13.0" +name = "gix-url" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85af407ed0dbb8d8da2a7241827d2fd5681186d9dab3570fc8dd8d6152ec48f" +checksum = "044072b7ce8601b62dcec841b92129f5cc677072823324121b395d766ac5f528" dependencies = [ - "bstr 1.0.1", - "git-features", - "git-path", + "bstr 1.3.0", + "gix-features", + "gix-path", "home", "thiserror", "url", ] [[package]] -name = "git-validate" -version = "0.7.1" +name = "gix-validate" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0431cf9352c596dc7c8ec9066ee551ce54e63c86c3c767e5baf763f6019ff3c2" +checksum = "b69ddb780ea1465255e66818d75b7098371c58dbc9560da4488a44b9f5c7e443" dependencies = [ - "bstr 1.0.1", + "bstr 1.3.0", "thiserror", ] [[package]] -name = "git-worktree" -version = "0.12.0" +name = "gix-worktree" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3bc63878f134e08ed52dba5d82422798c01a3f2e48c38ae9a2f7ff9194f362" +checksum = "b7cb9af6e56152953d8fe113c4f9d7cf60cf7a982362711e9200a255579b49cb" dependencies = [ - "bstr 1.0.1", - "git-attributes", - "git-features", - "git-glob", - "git-hash", - "git-index", - "git-object", - "git-path", + "bstr 1.3.0", + "gix-attributes", + "gix-features", + "gix-glob", + "gix-hash", + "gix-index", + "gix-object", + "gix-path", "io-close", "thiserror", ] @@ -1248,11 +1225,11 @@ dependencies = [ name = "helix-vcs" version = "0.6.0" dependencies = [ - "git-repository", + "gix", "helix-core", "imara-diff", "log", - "parking_lot 0.12.1", + "parking_lot", "tempfile", "tokio", ] @@ -1311,12 +1288,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "human_format" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86cce260d758a9aa3d7c4b99d55c815a540f8a37514ba6046ab6be402a157cb0" - [[package]] name = "iana-time-zone" version = "0.1.53" @@ -1414,6 +1385,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "io-lifetimes" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +dependencies = [ + "libc", + "windows-sys", +] + [[package]] name = "itoa" version = "1.0.4" @@ -1460,6 +1441,12 @@ dependencies = [ "cc", ] +[[package]] +name = "linux-raw-sys" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" + [[package]] name = "lock_api" version = "0.4.9" @@ -1605,20 +1592,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "parking_lot" -version = "0.11.2" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "parking_lot" @@ -1627,21 +1603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.4", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -1686,15 +1648,9 @@ dependencies = [ [[package]] name = "prodash" -version = "23.0.0" +version = "23.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8c414345b4a98cbcd0e8d8829c8f54b47a7ed4fb771c45b7c5c6c0ae23dc4c" -dependencies = [ - "bytesize", - "dashmap", - "human_format", - "parking_lot 0.11.2", -] +checksum = "d73c6b64cb5b99eb63ca97d378685712617ec0172ff5c04cd47a489d3e2c51f8" [[package]] name = "pulldown-cmark" @@ -1707,12 +1663,6 @@ dependencies = [ "unicase", ] -[[package]] -name = "quick-error" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" - [[package]] name = "quickcheck" version = "1.0.3" @@ -1792,15 +1742,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "ropey" version = "1.6.0" @@ -1812,10 +1753,18 @@ dependencies = [ ] [[package]] -name = "rustversion" -version = "1.0.9" +name = "rustix" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "d4fdebc4b395b7fbb9ab11e462e20ed9051e7b16e42d24042c776eca0ac81b03" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] [[package]] name = "ryu" @@ -1866,9 +1815,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ "itoa", "ryu", @@ -2025,16 +1974,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix", + "windows-sys", ] [[package]] @@ -2160,7 +2108,7 @@ dependencies = [ "memchr", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -2181,9 +2129,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -2192,9 +2140,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" +checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" dependencies = [ "serde", "serde_spanned", @@ -2213,9 +2161,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.1" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e" +checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" dependencies = [ "indexmap", "nom8", @@ -2431,17 +2379,17 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.40.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e30acc718a52fb130fec72b1cb5f55ffeeec9253e1b785e94db222178a6acaa1" +checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244" dependencies = [ - "windows_aarch64_gnullvm 0.40.0", - "windows_aarch64_msvc 0.40.0", - "windows_i686_gnu 0.40.0", - "windows_i686_msvc 0.40.0", - "windows_x86_64_gnu 0.40.0", - "windows_x86_64_gnullvm 0.40.0", - "windows_x86_64_msvc 0.40.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -2450,93 +2398,51 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm 0.42.0", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", - "windows_x86_64_gnullvm 0.42.0", - "windows_x86_64_msvc 0.42.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3caa4a1a16561b714323ca6b0817403738583033a6a92e04c5d10d4ba37ca10" - [[package]] name = "windows_aarch64_gnullvm" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" -[[package]] -name = "windows_aarch64_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328973c62dfcc50fb1aaa8e7100676e0b642fe56bac6bafff3327902db843ab4" - [[package]] name = "windows_aarch64_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" -[[package]] -name = "windows_i686_gnu" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa5b09fad70f0df85dea2ac2a525537e415e2bf63ee31cf9b8e263645ee9f3c1" - [[package]] name = "windows_i686_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" -[[package]] -name = "windows_i686_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a1ad4031c1a98491fa195d8d43d7489cb749f135f2e5c4eed58da094bd0d876" - [[package]] name = "windows_i686_msvc" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" -[[package]] -name = "windows_x86_64_gnu" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520ff37edd72da8064b49d2281182898e17f0688ae9f4070bca27e4b5c162ac7" - [[package]] name = "windows_x86_64_gnu" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046e5b82215102c44fd75f488f1b9158973d02aa34d06ed85c23d6f5520a2853" - [[package]] name = "windows_x86_64_gnullvm" version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" -[[package]] -name = "windows_x86_64_msvc" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0c9c6df55dd1bfa76e131cef44bdd8ec9c819ef3611f04dfe453fd5bfeda28" - [[package]] name = "windows_x86_64_msvc" version = "0.42.0" diff --git a/book/src/configuration.md b/book/src/configuration.md index 7514a3d0fcc3..0b9ebe966032 100644 --- a/book/src/configuration.md +++ b/book/src/configuration.md @@ -98,6 +98,7 @@ The following statusline elements can be configured: | `spinner` | A progress spinner indicating LSP activity | | `file-name` | The path/name of the opened file | | `file-base-name` | The basename of the opened file | +| `file-modification-indicator` | The indicator to show whether the file is modified (a `[+]` appears when there are unsaved changes) | | `file-encoding` | The encoding of the opened file if it differs from UTF-8 | | `file-line-ending` | The file line endings (CRLF or LF) | | `total-line-numbers` | The total line numbers of the opened file | diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index c31ddd3d2f89..48cb66f1f515 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -30,7 +30,7 @@ | eex | ✓ | | | | | ejs | ✓ | | | | | elixir | ✓ | ✓ | ✓ | `elixir-ls` | -| elm | ✓ | | | `elm-language-server` | +| elm | ✓ | ✓ | | `elm-language-server` | | elvish | ✓ | | | `elvish` | | env | ✓ | | | | | erb | ✓ | | | | @@ -85,6 +85,7 @@ | meson | ✓ | | ✓ | | | mint | | | | `mint` | | msbuild | ✓ | | ✓ | | +| nasm | ✓ | ✓ | | | | nickel | ✓ | | ✓ | `nls` | | nix | ✓ | | | `nil` | | nu | ✓ | | | | @@ -98,10 +99,12 @@ | pem | ✓ | | | | | perl | ✓ | ✓ | ✓ | | | php | ✓ | ✓ | ✓ | `intelephense` | +| po | ✓ | ✓ | | | | ponylang | ✓ | ✓ | ✓ | | | prisma | ✓ | | | `prisma-language-server` | | prolog | | | | `swipl` | | protobuf | ✓ | | ✓ | | +| prql | ✓ | | | | | purescript | ✓ | | | `purescript-language-server` | | python | ✓ | ✓ | ✓ | `pylsp` | | qml | ✓ | | ✓ | `qmlls` | @@ -111,6 +114,7 @@ | rescript | ✓ | ✓ | | `rescript-language-server` | | rmarkdown | ✓ | | ✓ | `R` | | ron | ✓ | | ✓ | | +| rst | ✓ | | | | | ruby | ✓ | ✓ | ✓ | `solargraph` | | rust | ✓ | ✓ | ✓ | `rust-analyzer` | | sage | ✓ | ✓ | | | @@ -124,6 +128,7 @@ | sshclientconfig | ✓ | | | | | starlark | ✓ | ✓ | | | | svelte | ✓ | | | `svelteserver` | +| sway | ✓ | ✓ | ✓ | `forc` | | swift | ✓ | | | `sourcekit-lsp` | | tablegen | ✓ | ✓ | ✓ | | | task | ✓ | | | | @@ -134,6 +139,7 @@ | twig | ✓ | | | | | typescript | ✓ | ✓ | ✓ | `typescript-language-server` | | ungrammar | ✓ | | | | +| uxntal | ✓ | | | | | v | ✓ | | | `v` | | vala | ✓ | | | `vala-language-server` | | verilog | ✓ | ✓ | | `svlangserver` | @@ -146,4 +152,5 @@ | xit | ✓ | | | | | xml | ✓ | | ✓ | | | yaml | ✓ | | ✓ | `yaml-language-server` | +| yuck | ✓ | | | | | zig | ✓ | ✓ | ✓ | `zls` | diff --git a/book/src/keymap.md b/book/src/keymap.md index 8864ab69617d..bc16aa1a706d 100644 --- a/book/src/keymap.md +++ b/book/src/keymap.md @@ -268,28 +268,30 @@ Accessed by typing `Space` in [normal mode](#normal-mode). This layer is a kludge of mappings, mostly pickers. -| Key | Description | Command | -| ----- | ----------- | ------- | -| `f` | Open file picker | `file_picker` | -| `F` | Open file picker at current working directory | `file_picker_in_current_directory` | -| `b` | Open buffer picker | `buffer_picker` | -| `j` | Open jumplist picker | `jumplist_picker` | -| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` | -| `s` | Open document symbol picker (**LSP**) | `symbol_picker` | -| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` | -| `d` | Open document diagnostics picker (**LSP**) | `diagnostics_picker` | -| `D` | Open workspace diagnostics picker (**LSP**) | `workspace_diagnostics_picker` | -| `r` | Rename symbol (**LSP**) | `rename_symbol` | -| `a` | Apply code action (**LSP**) | `code_action` | -| `'` | Open last fuzzy picker | `last_picker` | -| `w` | Enter [window mode](#window-mode) | N/A | -| `p` | Paste system clipboard after selections | `paste_clipboard_after` | -| `P` | Paste system clipboard before selections | `paste_clipboard_before` | -| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` | -| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` | -| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` | -| `/` | Global search in workspace folder | `global_search` | -| `?` | Open command palette | `command_palette` | +| Key | Description | Command | +| ----- | ----------- | ------- | +| `f` | Open file picker | `file_picker` | +| `F` | Open file picker at current working directory | `file_picker_in_current_directory` | +| `b` | Open buffer picker | `buffer_picker` | +| `j` | Open jumplist picker | `jumplist_picker` | +| `g` | Debug (experimental) | N/A | +| `k` | Show documentation for item under cursor in a [popup](#popup) (**LSP**) | `hover` | +| `s` | Open document symbol picker (**LSP**) | `symbol_picker` | +| `S` | Open workspace symbol picker (**LSP**) | `workspace_symbol_picker` | +| `d` | Open document diagnostics picker (**LSP**) | `diagnostics_picker` | +| `D` | Open workspace diagnostics picker (**LSP**) | `workspace_diagnostics_picker` | +| `r` | Rename symbol (**LSP**) | `rename_symbol` | +| `a` | Apply code action (**LSP**) | `code_action` | +| `h` | Select symbol references (**LSP**) | `select_references_to_symbol_under_cursor` | +| `'` | Open last fuzzy picker | `last_picker` | +| `w` | Enter [window mode](#window-mode) | N/A | +| `p` | Paste system clipboard after selections | `paste_clipboard_after` | +| `P` | Paste system clipboard before selections | `paste_clipboard_before` | +| `y` | Join and yank selections to clipboard | `yank_joined_to_clipboard` | +| `Y` | Yank main selection to clipboard | `yank_main_selection_to_clipboard` | +| `R` | Replace selections by clipboard contents | `replace_selections_with_clipboard` | +| `/` | Global search in workspace folder | `global_search` | +| `?` | Open command palette | `command_palette` | > TIP: Global search displays results in a fuzzy picker, use `Space + '` to bring it back up after opening a file. @@ -350,7 +352,7 @@ experience. | `Alt-d`, `Alt-Delete` | Delete next word | `delete_word_forward` | | `Ctrl-u` | Delete to start of line | `kill_to_line_start` | | `Ctrl-k` | Delete to end of line | `kill_to_line_end` | -| `Ctrl-h`, `Backspace` | Delete previous char | `delete_char_backward` | +| `Ctrl-h`, `Backspace`, `Shift-Backspace` | Delete previous char | `delete_char_backward` | | `Ctrl-d`, `Delete` | Delete next char | `delete_char_forward` | | `Ctrl-j`, `Enter` | Insert new line | `insert_newline` | @@ -431,7 +433,7 @@ Keys to use within prompt, Remapping currently not supported. | `Alt-d`, `Alt-Delete`, `Ctrl-Delete` | Delete next word | | `Ctrl-u` | Delete to start of line | | `Ctrl-k` | Delete to end of line | -| `Backspace`, `Ctrl-h` | Delete previous char | +| `Backspace`, `Ctrl-h`, `Shift-Backspace` | Delete previous char | | `Delete`, `Ctrl-d` | Delete next char | | `Ctrl-s` | Insert a word under doc cursor, may be changed to Ctrl-r Ctrl-w later | | `Ctrl-p`, `Up` | Select previous history | diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 491cd4249b14..d8c15c72f0e2 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -8,7 +8,10 @@ Some suggestions to get started: - Help with packaging on various distributions needed! - To use print debugging to the [Helix log file][log-file], you must: * Print using `log::info!`, `warn!`, or `error!`. (`log::info!("helix!")`) - * Pass the appropriate verbosity level option for the desired log level. (`hx -v ` for info, more `v`s for higher severity inclusive) + * Pass the appropriate verbosity level option for the desired log level. (`hx -v ` for info, more `v`s for higher verbosity) + * Want to display the logs in a separate file instead of using the `:log-open` command in your compiled Helix editor? Start your debug version with `cargo run -- --log foo.log` and in a new terminal use `tail -f foo.log` +- Instead of running a release version of Helix, while developing you may want to run in debug mode with `cargo run` which is way faster to compile +- Looking for even faster compile times? Give a try to [mold](https://github.com/rui314/mold) - If your preferred language is missing, integrating a tree-sitter grammar for it and defining syntax highlight queries for it is straight forward and doesn't require much knowledge of the internals. diff --git a/flake.lock b/flake.lock index 4cf1018c4999..fa292273af6e 100644 --- a/flake.lock +++ b/flake.lock @@ -16,22 +16,6 @@ "type": "github" } }, - "devshell": { - "flake": false, - "locked": { - "lastModified": 1667210711, - "narHash": "sha256-IoErjXZAkzYWHEpQqwu/DeRNJGFdR7X2OGbkhMqMrpw=", - "owner": "numtide", - "repo": "devshell", - "rev": "96a9dd12b8a447840cc246e17a47b81a4268bba7", - "type": "github" - }, - "original": { - "owner": "numtide", - "repo": "devshell", - "type": "github" - } - }, "dream2nix": { "inputs": { "alejandra": [ @@ -42,10 +26,12 @@ ], "crane": "crane", "devshell": [ + "nci" + ], + "flake-parts": [ "nci", - "devshell" + "parts" ], - "flake-parts": "flake-parts", "flake-utils-pre-commit": [ "nci" ], @@ -70,14 +56,17 @@ ], "pre-commit-hooks": [ "nci" + ], + "pruned-racket-catalog": [ + "nci" ] }, "locked": { - "lastModified": 1671323629, - "narHash": "sha256-9KHTPjIDjfnzZ4NjpE3gGIVHVHopy6weRDYO/7Y3hF8=", + "lastModified": 1677289985, + "narHash": "sha256-lUp06cTTlWubeBGMZqPl9jODM99LpWMcwxRiscFAUJg=", "owner": "nix-community", "repo": "dream2nix", - "rev": "2d7d68505c8619410df2c6b6463985f97cbcba6e", + "rev": "28b973a8d4c30cc1cbb3377ea2023a76bc3fb889", "type": "github" }, "original": { @@ -86,24 +75,6 @@ "type": "github" } }, - "flake-parts": { - "inputs": { - "nixpkgs-lib": "nixpkgs-lib" - }, - "locked": { - "lastModified": 1668450977, - "narHash": "sha256-cfLhMhnvXn6x1vPm+Jow3RiFAUSCw/l1utktCw5rVA4=", - "owner": "hercules-ci", - "repo": "flake-parts", - "rev": "d591857e9d7dd9ddbfba0ea02b43b927c3c0f1fa", - "type": "github" - }, - "original": { - "owner": "hercules-ci", - "repo": "flake-parts", - "type": "github" - } - }, "flake-utils": { "locked": { "lastModified": 1659877975, @@ -119,23 +90,40 @@ "type": "github" } }, + "mk-naked-shell": { + "flake": false, + "locked": { + "lastModified": 1676572903, + "narHash": "sha256-oQoDHHUTxNVSURfkFcYLuAK+btjs30T4rbEUtCUyKy8=", + "owner": "yusdacra", + "repo": "mk-naked-shell", + "rev": "aeca9f8aa592f5e8f71f407d081cb26fd30c5a57", + "type": "github" + }, + "original": { + "owner": "yusdacra", + "repo": "mk-naked-shell", + "type": "github" + } + }, "nci": { "inputs": { - "devshell": "devshell", "dream2nix": "dream2nix", + "mk-naked-shell": "mk-naked-shell", "nixpkgs": [ "nixpkgs" ], + "parts": "parts", "rust-overlay": [ "rust-overlay" ] }, "locked": { - "lastModified": 1671430291, - "narHash": "sha256-UIc7H8F3N8rK72J/Vj5YJdV72tvDvYjH+UPsOFvlcsE=", + "lastModified": 1677297103, + "narHash": "sha256-ArlJIbp9NGV9yvhZdV0SOUFfRlI/kHeKoCk30NbSiLc=", "owner": "yusdacra", "repo": "nix-cargo-integration", - "rev": "b1b0d38b8c3b0d0e6a38638d5bbe10b0bc67522c", + "rev": "a79272a2cb0942392bb3a5bf9a3ec6bc568795b2", "type": "github" }, "original": { @@ -146,11 +134,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1671359686, - "narHash": "sha256-3MpC6yZo+Xn9cPordGz2/ii6IJpP2n8LE8e/ebUXLrs=", + "lastModified": 1677063315, + "narHash": "sha256-qiB4ajTeAOVnVSAwCNEEkoybrAlA+cpeiBxLobHndE8=", "owner": "nixos", "repo": "nixpkgs", - "rev": "04f574a1c0fde90b51bf68198e2297ca4e7cccf4", + "rev": "988cc958c57ce4350ec248d2d53087777f9e1949", "type": "github" }, "original": { @@ -163,11 +151,11 @@ "nixpkgs-lib": { "locked": { "dir": "lib", - "lastModified": 1665349835, - "narHash": "sha256-UK4urM3iN80UXQ7EaOappDzcisYIuEURFRoGQ/yPkug=", + "lastModified": 1675183161, + "narHash": "sha256-Zq8sNgAxDckpn7tJo7V1afRSk2eoVbu3OjI1QklGLNg=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "34c5293a71ffdb2fe054eb5288adc1882c1eb0b1", + "rev": "e1e1b192c1a5aab2960bf0a0bd53a2e8124fa18e", "type": "github" }, "original": { @@ -178,10 +166,50 @@ "type": "github" } }, + "parts": { + "inputs": { + "nixpkgs-lib": [ + "nci", + "nixpkgs" + ] + }, + "locked": { + "lastModified": 1675933616, + "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "parts_2": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1675933616, + "narHash": "sha256-/rczJkJHtx16IFxMmAWu5nNYcSXNg1YYXTHoGjLrLUA=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "47478a4a003e745402acf63be7f9a092d51b83d7", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, "root": { "inputs": { "nci": "nci", "nixpkgs": "nixpkgs", + "parts": "parts_2", "rust-overlay": "rust-overlay" } }, @@ -193,11 +221,11 @@ ] }, "locked": { - "lastModified": 1671416426, - "narHash": "sha256-kpSH1Jrxfk2qd0pRPJn1eQdIOseGv5JuE+YaOrqU9s4=", + "lastModified": 1677292251, + "narHash": "sha256-D+6q5Z2MQn3UFJtqsM5/AvVHi3NXKZTIMZt1JGq/spA=", "owner": "oxalica", "repo": "rust-overlay", - "rev": "fbaaff24f375ac25ec64268b0a0d63f91e474b7d", + "rev": "34cdbf6ad480ce13a6a526f57d8b9e609f3d65dc", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index 734ac78e2eec..2ac764888daa 100644 --- a/flake.nix +++ b/flake.nix @@ -12,16 +12,10 @@ inputs.nixpkgs.follows = "nixpkgs"; inputs.rust-overlay.follows = "rust-overlay"; }; + parts.url = "github:hercules-ci/flake-parts"; }; - outputs = { - self, - nixpkgs, - nci, - ... - }: let - lib = nixpkgs.lib; - ncl = nci.lib.nci-lib; + outputs = inp: let mkRootPath = rel: builtins.path { path = "${toString ./.}/${rel}"; @@ -32,6 +26,12 @@ ".envrc" ".ignore" ".github" + ".gitignore" + "logo.svg" + "logo_dark.svg" + "logo_light.svg" + "rust-toolchain.toml" + "rustfmt.toml" "runtime" "screenshot.png" "book" @@ -46,6 +46,7 @@ "flake.lock" ]; ignorePaths = path: type: let + inherit (inp.nixpkgs) lib; # split the nix store path into its components components = lib.splitString "/" path; # drop off the `/nix/hash-source` section from the path @@ -61,123 +62,107 @@ # filter out unnecessary paths filter = ignorePaths; }; - outputs = nci.lib.makeOutputs { - root = ./.; - config = common: { - outputs = { - # rename helix-term to helix since it's our main package - rename = {"helix-term" = "helix";}; - # Set default app to hx (binary is from helix-term release build) - # Set default package to helix-term release build - defaults = { - app = "hx"; - package = "helix"; - }; - }; - cCompiler.package = with common.pkgs; - if stdenv.isLinux - then gcc - else clang; - shell = { - packages = with common.pkgs; - [lld_13 cargo-flamegraph rust-analyzer] - ++ (lib.optional (stdenv.isx86_64 && stdenv.isLinux) cargo-tarpaulin) - ++ (lib.optional stdenv.isLinux lldb) - ++ (lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreFoundation); - env = [ - { - name = "HELIX_RUNTIME"; - eval = "$PWD/runtime"; - } - { - name = "RUST_BACKTRACE"; - value = "1"; - } + in + inp.parts.lib.mkFlake {inputs = inp;} { + imports = [inp.nci.flakeModule]; + systems = [ + "x86_64-linux" + "x86_64-darwin" + "aarch64-linux" + "aarch64-darwin" + "i686-linux" + ]; + perSystem = { + config, + pkgs, + lib, + ... + }: let + makeOverridableHelix = old: config: let + grammars = pkgs.callPackage ./grammars.nix config; + runtimeDir = pkgs.runCommand "helix-runtime" {} '' + mkdir -p $out + ln -s ${mkRootPath "runtime"}/* $out + rm -r $out/grammars + ln -s ${grammars} $out/grammars + ''; + helix-wrapped = + pkgs.runCommand + old.name { - name = "RUSTFLAGS"; - eval = - if common.pkgs.stdenv.isLinux - then "$RUSTFLAGS\" -C link-arg=-fuse-ld=lld -C target-cpu=native -Clink-arg=-Wl,--no-rosegment\"" - else "$RUSTFLAGS"; + inherit (old) pname version; + meta = old.meta or {}; + passthru = + (old.passthru or {}) + // { + unwrapped = old; + }; + nativeBuildInputs = [pkgs.makeWrapper]; + makeWrapperArgs = config.makeWrapperArgs or []; } - ]; - }; - }; - pkgConfig = common: { - helix-term = let - # Wrap helix with runtime - wrapper = _: old: let - inherit (common) pkgs; - makeOverridableHelix = old: config: let - grammars = pkgs.callPackage ./grammars.nix config; - runtimeDir = pkgs.runCommand "helix-runtime" {} '' - mkdir -p $out - ln -s ${mkRootPath "runtime"}/* $out - rm -r $out/grammars - ln -s ${grammars} $out/grammars - ''; - helix-wrapped = - common.internal.pkgsSet.utils.wrapDerivation old - { - nativeBuildInputs = [pkgs.makeWrapper]; - makeWrapperArgs = config.makeWrapperArgs or []; - } - '' - rm -rf $out/bin - mkdir -p $out/bin - ln -sf ${old}/bin/* $out/bin/ - wrapProgram "$out/bin/hx" ''${makeWrapperArgs[@]} --set HELIX_RUNTIME "${runtimeDir}" - ''; - in - helix-wrapped + '' + cp -rs --no-preserve=mode,ownership ${old} $out + wrapProgram "$out/bin/hx" ''${makeWrapperArgs[@]} --set HELIX_RUNTIME "${runtimeDir}" + ''; + in + helix-wrapped + // { + override = makeOverridableHelix old; + passthru = + helix-wrapped.passthru // { - override = makeOverridableHelix old; - passthru = helix-wrapped.passthru // {wrapper = wrapper {};}; + wrapper = old: makeOverridableHelix old config; }; - in - makeOverridableHelix old {}; - in { - inherit wrapper; - overrides.fix-build.overrideAttrs = prev: { - src = filteredSource; - - # disable fetching and building of tree-sitter grammars in the helix-term build.rs - HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1"; - - buildInputs = ncl.addBuildInputs prev [common.config.cCompiler.package.cc.lib]; - - # link languages and theme toml files since helix-term expects them (for tests) - preConfigure = '' - ${prev.preConfigure or ""} - ${ - lib.concatMapStringsSep - "\n" - (path: "ln -sf ${mkRootPath path} ..") - ["languages.toml" "theme.toml" "base16_theme.toml"] - } - ''; - checkPhase = ":"; - - meta.mainProgram = "hx"; + }; + stdenv = + if pkgs.stdenv.isLinux + then pkgs.stdenv + else pkgs.clangStdenv; + rustFlagsEnv = + if stdenv.isLinux + then ''$RUSTFLAGS -C link-arg=-fuse-ld=lld -C target-cpu=native -Clink-arg=-Wl,--no-rosegment'' + else "$RUSTFLAGS"; + in { + # by default NCI adds rust-analyzer component, but helix toolchain doesn't have rust-analyzer + nci.toolchains.shell.components = ["rust-src" "rustfmt" "clippy"]; + nci.projects."helix-project".relPath = ""; + nci.crates."helix-term" = { + overrides = { + add-meta.override = _: {meta.mainProgram = "hx";}; + add-inputs.overrideAttrs = prev: { + buildInputs = (prev.buildInputs or []) ++ [stdenv.cc.cc.lib]; + }; + disable-grammar-builds = { + # disable fetching and building of tree-sitter grammars in the helix-term build.rs + HELIX_DISABLE_AUTO_GRAMMAR_BUILD = "1"; + }; + disable-tests = {checkPhase = ":";}; + set-stdenv.override = _: {inherit stdenv;}; + set-filtered-src.override = _: {src = filteredSource;}; }; }; + + packages.helix-unwrapped = config.nci.outputs."helix-term".packages.release; + packages.helix-unwrapped-dev = config.nci.outputs."helix-term".packages.dev; + packages.helix = makeOverridableHelix config.packages.helix-unwrapped {}; + packages.helix-dev = makeOverridableHelix config.packages.helix-unwrapped-dev {}; + packages.default = config.packages.helix; + + devShells.default = config.nci.outputs."helix-project".devShell.overrideAttrs (old: { + nativeBuildInputs = + (old.nativeBuildInputs or []) + ++ (with pkgs; [lld_13 cargo-flamegraph rust-analyzer]) + ++ (lib.optional (stdenv.isx86_64 && stdenv.isLinux) pkgs.cargo-tarpaulin) + ++ (lib.optional stdenv.isLinux pkgs.lldb) + ++ (lib.optional stdenv.isDarwin pkgs.darwin.apple_sdk.frameworks.CoreFoundation); + shellHook = '' + export HELIX_RUNTIME="$PWD/runtime" + export RUST_BACKTRACE="1" + export RUSTFLAGS="${rustFlagsEnv}" + ''; + }); }; }; - in - outputs - // { - packages = - lib.mapAttrs - ( - system: packages: - packages - // { - helix-unwrapped = packages.helix.passthru.unwrapped; - helix-unwrapped-dev = packages.helix-dev.passthru.unwrapped; - } - ) - outputs.packages; - }; nixConfig = { extra-substituters = ["https://helix.cachix.org"]; diff --git a/helix-core/src/selection.rs b/helix-core/src/selection.rs index 7817618fb488..0ac2c680283a 100644 --- a/helix-core/src/selection.rs +++ b/helix-core/src/selection.rs @@ -21,14 +21,14 @@ use std::borrow::Cow; /// can be in any order, or even share the same position. /// /// The anchor and head positions use gap indexing, meaning -/// that their indices represent the the gaps *between* `char`s +/// that their indices represent the gaps *between* `char`s /// rather than the `char`s themselves. For example, 1 /// represents the position between the first and second `char`. /// -/// Below are some example `Range` configurations to better -/// illustrate. The anchor and head indices are show as -/// "(anchor, head)", followed by example text with "[" and "]" -/// inserted to represent the anchor and head positions: +/// Below are some examples of `Range` configurations. +/// The anchor and head indices are shown as "(anchor, head)" +/// tuples, followed by example text with "[" and "]" symbols +/// representing the anchor and head positions: /// /// - (0, 3): `[Som]e text`. /// - (3, 0): `]Som[e text`. diff --git a/helix-dap/src/client.rs b/helix-dap/src/client.rs index 10d931809ca3..f6d8a0696713 100644 --- a/helix-dap/src/client.rs +++ b/helix-dap/src/client.rs @@ -1,4 +1,5 @@ use crate::{ + requests::DisconnectArguments, transport::{Payload, Request, Response, Transport}, types::*, Error, Result, ThreadId, @@ -31,6 +32,7 @@ pub struct Client { _process: Option, server_tx: UnboundedSender, request_counter: AtomicU64, + connection_type: Option, pub caps: Option, // thread_id -> frames pub stack_frames: HashMap>, @@ -41,6 +43,12 @@ pub struct Client { pub quirks: DebuggerQuirks, } +#[derive(Clone, Copy, Debug)] +pub enum ConnectionType { + Launch, + Attach, +} + impl Client { // Spawn a process and communicate with it by either TCP or stdio pub async fn process( @@ -78,7 +86,7 @@ impl Client { server_tx, request_counter: AtomicU64::new(0), caps: None, - // + connection_type: None, stack_frames: HashMap::new(), thread_states: HashMap::new(), thread_id: None, @@ -207,6 +215,10 @@ impl Client { self.id } + pub fn connection_type(&self) -> Option { + self.connection_type + } + fn next_request_id(&self) -> u64 { self.request_counter.fetch_add(1, Ordering::Relaxed) } @@ -334,15 +346,21 @@ impl Client { Ok(()) } - pub fn disconnect(&self) -> impl Future> { - self.call::(()) + pub fn disconnect( + &mut self, + args: Option, + ) -> impl Future> { + self.connection_type = None; + self.call::(args) } - pub fn launch(&self, args: serde_json::Value) -> impl Future> { + pub fn launch(&mut self, args: serde_json::Value) -> impl Future> { + self.connection_type = Some(ConnectionType::Launch); self.call::(args) } - pub fn attach(&self, args: serde_json::Value) -> impl Future> { + pub fn attach(&mut self, args: serde_json::Value) -> impl Future> { + self.connection_type = Some(ConnectionType::Attach); self.call::(args) } diff --git a/helix-dap/src/lib.rs b/helix-dap/src/lib.rs index 24d7472b7faf..21162cb86e72 100644 --- a/helix-dap/src/lib.rs +++ b/helix-dap/src/lib.rs @@ -2,7 +2,7 @@ mod client; mod transport; mod types; -pub use client::Client; +pub use client::{Client, ConnectionType}; pub use events::Event; pub use transport::{Payload, Response, Transport}; pub use types::*; diff --git a/helix-dap/src/types.rs b/helix-dap/src/types.rs index 0a9ebe5e9540..c598790b225c 100644 --- a/helix-dap/src/types.rs +++ b/helix-dap/src/types.rs @@ -391,11 +391,22 @@ pub mod requests { const COMMAND: &'static str = "attach"; } + #[derive(Debug, Default, PartialEq, Eq, Clone, Deserialize, Serialize)] + #[serde(rename_all = "camelCase")] + pub struct DisconnectArguments { + #[serde(skip_serializing_if = "Option::is_none")] + pub restart: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub terminate_debuggee: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub suspend_debuggee: Option, + } + #[derive(Debug)] pub enum Disconnect {} impl Request for Disconnect { - type Arguments = (); + type Arguments = Option; type Result = (); const COMMAND: &'static str = "disconnect"; } diff --git a/helix-lsp/Cargo.toml b/helix-lsp/Cargo.toml index 06811902479e..133ead298754 100644 --- a/helix-lsp/Cargo.toml +++ b/helix-lsp/Cargo.toml @@ -24,5 +24,5 @@ serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "1.0" tokio = { version = "1.25", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot", "sync"] } -tokio-stream = "0.1.11" +tokio-stream = "0.1.12" which = "4.4" diff --git a/helix-term/Cargo.toml b/helix-term/Cargo.toml index 603f37d39ab8..b1d63a04a6ae 100644 --- a/helix-term/Cargo.toml +++ b/helix-term/Cargo.toml @@ -10,11 +10,7 @@ repository = "https://github.com/helix-editor/helix" homepage = "https://helix-editor.com" include = ["src/**/*", "README.md"] default-run = "hx" -rust-version = "1.57" - -[package.metadata.nix] -build = true -app = true +rust-version = "1.65" [features] default = ["git"] @@ -41,7 +37,7 @@ which = "4.4" tokio = { version = "1", features = ["rt", "rt-multi-thread", "io-util", "io-std", "time", "process", "macros", "fs", "parking_lot"] } tui = { path = "../helix-tui", package = "helix-tui", default-features = false, features = ["crossterm"] } -crossterm = { version = "0.25", features = ["event-stream"] } +crossterm = { version = "0.26", features = ["event-stream"] } signal-hook = "0.3" tokio-stream = "0.1" futures-util = { version = "0.3", features = ["std", "async-await"], default-features = false } @@ -79,4 +75,4 @@ helix-loader = { version = "0.6", path = "../helix-loader" } [dev-dependencies] smallvec = "1.10" indoc = "2.0.0" -tempfile = "3.3.0" +tempfile = "3.4.0" diff --git a/helix-term/src/application.rs b/helix-term/src/application.rs index c8e8ecb1ae61..df6d9da6cd32 100644 --- a/helix-term/src/application.rs +++ b/helix-term/src/application.rs @@ -40,7 +40,8 @@ use anyhow::{Context, Error}; use crossterm::{ event::{ DisableBracketedPaste, DisableFocusChange, DisableMouseCapture, EnableBracketedPaste, - EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent, + EnableFocusChange, EnableMouseCapture, Event as CrosstermEvent, KeyboardEnhancementFlags, + PopKeyboardEnhancementFlags, PushKeyboardEnhancementFlags, }, execute, terminal, tty::IsTty, @@ -111,6 +112,9 @@ fn restore_term() -> Result<(), Error> { let mut stdout = stdout(); // reset cursor shape write!(stdout, "\x1B[0 q")?; + if matches!(terminal::supports_keyboard_enhancement(), Ok(true)) { + execute!(stdout, PopKeyboardEnhancementFlags)?; + } // Ignore errors on disabling, this might trigger on windows if we call // disable without calling enable previously let _ = execute!(stdout, DisableMouseCapture); @@ -341,12 +345,12 @@ impl Application { tokio::select! { biased; - Some(event) = input_stream.next() => { - self.handle_terminal_events(event).await; - } Some(signal) = self.signals.next() => { self.handle_signals(signal).await; } + Some(event) = input_stream.next() => { + self.handle_terminal_events(event).await; + } Some(callback) = self.jobs.futures.next() => { self.jobs.handle_callback(&mut self.editor, &mut self.compositor, callback); self.render().await; @@ -634,6 +638,11 @@ impl Application { self.compositor .handle_event(&Event::Resize(width, height), &mut cx) } + // Ignore keyboard release events. + CrosstermEvent::Key(crossterm::event::KeyEvent { + kind: crossterm::event::KeyEventKind::Release, + .. + }) => false, event => self.compositor.handle_event(&event.into(), &mut cx), }; @@ -1062,6 +1071,19 @@ impl Application { if self.config.load().editor.mouse { execute!(stdout, EnableMouseCapture)?; } + if matches!(terminal::supports_keyboard_enhancement(), Ok(true)) { + log::debug!("The enhanced keyboard protocol is supported on this terminal"); + execute!( + stdout, + PushKeyboardEnhancementFlags( + KeyboardEnhancementFlags::DISAMBIGUATE_ESCAPE_CODES + | KeyboardEnhancementFlags::REPORT_ALTERNATE_KEYS + ) + )?; + } else { + log::debug!("The enhanced keyboard protocol is not supported on this terminal"); + } + Ok(()) } diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index fb55ca2a8e72..cd7626ebd050 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -2941,7 +2941,6 @@ fn goto_first_diag(cx: &mut Context) { None => return, }; doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); } fn goto_last_diag(cx: &mut Context) { @@ -2951,7 +2950,6 @@ fn goto_last_diag(cx: &mut Context) { None => return, }; doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); } fn goto_next_diag(cx: &mut Context) { @@ -2973,7 +2971,6 @@ fn goto_next_diag(cx: &mut Context) { None => return, }; doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); } fn goto_prev_diag(cx: &mut Context) { @@ -2998,7 +2995,6 @@ fn goto_prev_diag(cx: &mut Context) { None => return, }; doc.set_selection(view.id, selection); - align_view(doc, view, Align::Center); } fn goto_first_change(cx: &mut Context) { @@ -3061,10 +3057,7 @@ fn goto_next_change_impl(cx: &mut Context, direction: Direction) { .prev_hunk(cursor_line) .map(|idx| idx.saturating_sub(count)), }; - // TODO refactor with let..else once MSRV reaches 1.65 - let hunk_idx = if let Some(hunk_idx) = hunk_idx { - hunk_idx - } else { + let Some(hunk_idx) = hunk_idx else { return range; }; let hunk = hunks.nth_hunk(hunk_idx); diff --git a/helix-term/src/commands/dap.rs b/helix-term/src/commands/dap.rs index b3166e395d90..023ed37794df 100644 --- a/helix-term/src/commands/dap.rs +++ b/helix-term/src/commands/dap.rs @@ -475,19 +475,36 @@ pub fn dap_variables(cx: &mut Context) { if debugger.thread_id.is_none() { cx.editor - .set_status("Cannot access variables while target is running"); + .set_status("Cannot access variables while target is running."); return; } let (frame, thread_id) = match (debugger.active_frame, debugger.thread_id) { (Some(frame), Some(thread_id)) => (frame, thread_id), _ => { cx.editor - .set_status("Cannot find current stack frame to access variables"); + .set_status("Cannot find current stack frame to access variables."); return; } }; - let frame_id = debugger.stack_frames[&thread_id][frame].id; + let thread_frame = match debugger.stack_frames.get(&thread_id) { + Some(thread_frame) => thread_frame, + None => { + cx.editor + .set_error("Failed to get stack frame for thread: {thread_id}"); + return; + } + }; + let stack_frame = match thread_frame.get(frame) { + Some(stack_frame) => stack_frame, + None => { + cx.editor + .set_error("Failed to get stack frame for thread {thread_id} and frame {frame}."); + return; + } + }; + + let frame_id = stack_frame.id; let scopes = match block_on(debugger.scopes(frame_id)) { Ok(s) => s, Err(e) => { @@ -539,7 +556,7 @@ pub fn dap_variables(cx: &mut Context) { pub fn dap_terminate(cx: &mut Context) { let debugger = debugger!(cx.editor); - let request = debugger.disconnect(); + let request = debugger.disconnect(None); dap_callback(cx.jobs, request, |editor, _compositor, _response: ()| { // editor.set_error(format!("Failed to disconnect: {}", e)); editor.debugger = None; diff --git a/helix-term/src/commands/typed.rs b/helix-term/src/commands/typed.rs index b0fd18a76b79..a70dd1a68cbf 100644 --- a/helix-term/src/commands/typed.rs +++ b/helix-term/src/commands/typed.rs @@ -5,7 +5,7 @@ use crate::job::Job; use super::*; -use helix_core::encoding; +use helix_core::{encoding, shellwords::Shellwords}; use helix_view::document::DEFAULT_LANGUAGE_NAME; use helix_view::editor::{Action, CloseError, ConfigEvent}; use serde_json::Value; @@ -18,7 +18,49 @@ pub struct TypableCommand { pub doc: &'static str, // params, flags, helper, completer pub fun: fn(&mut compositor::Context, &[Cow], PromptEvent) -> anyhow::Result<()>, - pub completer: Option, + /// What completion methods, if any, does this command have? + pub signature: CommandSignature, +} + +impl TypableCommand { + fn completer_for_argument_number(&self, n: usize) -> &Completer { + match self.signature.positional_args.get(n) { + Some(completer) => completer, + _ => &self.signature.var_args, + } + } +} + +#[derive(Clone)] +pub struct CommandSignature { + // Arguments with specific completion methods based on their position. + positional_args: &'static [Completer], + + // All remaining arguments will use this completion method, if set. + var_args: Completer, +} + +impl CommandSignature { + const fn none() -> Self { + Self { + positional_args: &[], + var_args: completers::none, + } + } + + const fn positional(completers: &'static [Completer]) -> Self { + Self { + positional_args: completers, + var_args: completers::none, + } + } + + const fn all(completer: Completer) -> Self { + Self { + positional_args: &[], + var_args: completer, + } + } } fn quit(cx: &mut compositor::Context, args: &[Cow], event: PromptEvent) -> anyhow::Result<()> { @@ -2008,112 +2050,114 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ aliases: &["q"], doc: "Close the current view.", fun: quit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "quit!", aliases: &["q!"], doc: "Force close the current view, ignoring unsaved changes.", fun: force_quit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "open", aliases: &["o"], doc: "Open a file from disk into the current view.", fun: open, - completer: Some(completers::filename), + signature: CommandSignature::all(completers::filename), }, TypableCommand { name: "buffer-close", aliases: &["bc", "bclose"], doc: "Close the current buffer.", fun: buffer_close, - completer: Some(completers::buffer), + signature: CommandSignature::all(completers::buffer), }, TypableCommand { name: "buffer-close!", aliases: &["bc!", "bclose!"], doc: "Close the current buffer forcefully, ignoring unsaved changes.", fun: force_buffer_close, - completer: Some(completers::buffer), + signature: CommandSignature::all(completers::buffer) }, TypableCommand { name: "buffer-close-others", aliases: &["bco", "bcloseother"], doc: "Close all buffers but the currently focused one.", fun: buffer_close_others, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "buffer-close-others!", aliases: &["bco!", "bcloseother!"], doc: "Force close all buffers but the currently focused one.", fun: force_buffer_close_others, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "buffer-close-all", aliases: &["bca", "bcloseall"], doc: "Close all buffers without quitting.", fun: buffer_close_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "buffer-close-all!", aliases: &["bca!", "bcloseall!"], doc: "Force close all buffers ignoring unsaved changes without quitting.", fun: force_buffer_close_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "buffer-next", aliases: &["bn", "bnext"], doc: "Goto next buffer.", fun: buffer_next, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "buffer-previous", aliases: &["bp", "bprev"], doc: "Goto previous buffer.", fun: buffer_previous, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "write", aliases: &["w"], doc: "Write changes to disk. Accepts an optional path (:write some/path.txt)", fun: write, - completer: Some(completers::filename), + signature: CommandSignature::positional(&[completers::filename]), }, TypableCommand { name: "write!", aliases: &["w!"], doc: "Force write changes to disk creating necessary subdirectories. Accepts an optional path (:write some/path.txt)", fun: force_write, - completer: Some(completers::filename), + signature: CommandSignature::positional(&[completers::filename]), }, TypableCommand { name: "new", aliases: &["n"], doc: "Create a new scratch buffer.", fun: new_file, - completer: Some(completers::filename), + // TODO: This seems to complete with a filename, but doesn't use that filename to + // set the path of the newly created buffer. + signature: CommandSignature::positional(&[completers::filename]), }, TypableCommand { name: "format", aliases: &["fmt"], doc: "Format the file using the LSP formatter.", fun: format, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "indent-style", aliases: &[], doc: "Set the indentation style for editing. ('t' for tabs or 1-8 for number of spaces.)", fun: set_indent_style, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "line-ending", @@ -2123,413 +2167,414 @@ pub const TYPABLE_COMMAND_LIST: &[TypableCommand] = &[ #[cfg(feature = "unicode-lines")] doc: "Set the document's default line ending. Options: crlf, lf, cr, ff, nel.", fun: set_line_ending, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "earlier", aliases: &["ear"], doc: "Jump back to an earlier point in edit history. Accepts a number of steps or a time span.", fun: earlier, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "later", aliases: &["lat"], doc: "Jump to a later point in edit history. Accepts a number of steps or a time span.", fun: later, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "write-quit", aliases: &["wq", "x"], doc: "Write changes to disk and close the current view. Accepts an optional path (:wq some/path.txt)", fun: write_quit, - completer: Some(completers::filename), + signature: CommandSignature::positional(&[completers::filename]), }, TypableCommand { name: "write-quit!", aliases: &["wq!", "x!"], doc: "Write changes to disk and close the current view forcefully. Accepts an optional path (:wq! some/path.txt)", fun: force_write_quit, - completer: Some(completers::filename), + signature: CommandSignature::positional(&[completers::filename]), }, TypableCommand { name: "write-all", aliases: &["wa"], doc: "Write changes from all buffers to disk.", fun: write_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "write-quit-all", aliases: &["wqa", "xa"], doc: "Write changes from all buffers to disk and close all views.", fun: write_all_quit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "write-quit-all!", aliases: &["wqa!", "xa!"], doc: "Write changes from all buffers to disk and close all views forcefully (ignoring unsaved changes).", fun: force_write_all_quit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "quit-all", aliases: &["qa"], doc: "Close all views.", fun: quit_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "quit-all!", aliases: &["qa!"], doc: "Force close all views ignoring unsaved changes.", fun: force_quit_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "cquit", aliases: &["cq"], doc: "Quit with exit code (default 1). Accepts an optional integer exit code (:cq 2).", fun: cquit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "cquit!", aliases: &["cq!"], doc: "Force quit with exit code (default 1) ignoring unsaved changes. Accepts an optional integer exit code (:cq! 2).", fun: force_cquit, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "theme", aliases: &[], doc: "Change the editor theme (show current theme if no name specified).", fun: theme, - completer: Some(completers::theme), + signature: CommandSignature::positional(&[completers::theme]), }, TypableCommand { name: "clipboard-yank", aliases: &[], doc: "Yank main selection into system clipboard.", fun: yank_main_selection_to_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "clipboard-yank-join", aliases: &[], doc: "Yank joined selections into system clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc. fun: yank_joined_to_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "primary-clipboard-yank", aliases: &[], doc: "Yank main selection into system primary clipboard.", fun: yank_main_selection_to_primary_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "primary-clipboard-yank-join", aliases: &[], doc: "Yank joined selections into system primary clipboard. A separator can be provided as first argument. Default value is newline.", // FIXME: current UI can't display long doc. fun: yank_joined_to_primary_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "clipboard-paste-after", aliases: &[], doc: "Paste system clipboard after selections.", fun: paste_clipboard_after, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "clipboard-paste-before", aliases: &[], doc: "Paste system clipboard before selections.", fun: paste_clipboard_before, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "clipboard-paste-replace", aliases: &[], doc: "Replace selections with content of system clipboard.", fun: replace_selections_with_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "primary-clipboard-paste-after", aliases: &[], doc: "Paste primary clipboard after selections.", fun: paste_primary_clipboard_after, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "primary-clipboard-paste-before", aliases: &[], doc: "Paste primary clipboard before selections.", fun: paste_primary_clipboard_before, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "primary-clipboard-paste-replace", aliases: &[], doc: "Replace selections with content of system primary clipboard.", fun: replace_selections_with_primary_clipboard, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "show-clipboard-provider", aliases: &[], doc: "Show clipboard provider name in status bar.", fun: show_clipboard_provider, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "change-current-directory", aliases: &["cd"], doc: "Change the current working directory.", fun: change_current_directory, - completer: Some(completers::directory), + signature: CommandSignature::positional(&[completers::directory]), }, TypableCommand { name: "show-directory", aliases: &["pwd"], doc: "Show the current working directory.", fun: show_current_directory, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "encoding", aliases: &[], doc: "Set encoding. Based on `https://encoding.spec.whatwg.org`.", fun: set_encoding, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "character-info", aliases: &["char"], doc: "Get info about the character under the primary cursor.", fun: get_character_info, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "reload", aliases: &[], doc: "Discard changes and reload from the source file.", fun: reload, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "reload-all", aliases: &[], doc: "Discard changes and reload all documents from the source files.", fun: reload_all, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "update", aliases: &[], doc: "Write changes only if the file has been modified.", fun: update, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "lsp-workspace-command", aliases: &[], doc: "Open workspace command picker", fun: lsp_workspace_command, - completer: Some(completers::lsp_workspace_command), + signature: CommandSignature::positional(&[completers::lsp_workspace_command]), }, TypableCommand { name: "lsp-restart", aliases: &[], doc: "Restarts the Language Server that is in use by the current doc", fun: lsp_restart, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "tree-sitter-scopes", aliases: &[], doc: "Display tree sitter scopes, primarily for theming and development.", fun: tree_sitter_scopes, - completer: None, - }, + signature: CommandSignature::none(), + }, TypableCommand { name: "debug-start", aliases: &["dbg"], doc: "Start a debug session from a given template with given parameters.", fun: debug_start, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "debug-remote", aliases: &["dbg-tcp"], doc: "Connect to a debug adapter by TCP address and start a debugging session from a given template with given parameters.", fun: debug_remote, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "debug-eval", aliases: &[], doc: "Evaluate expression in current debug context.", fun: debug_eval, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "vsplit", aliases: &["vs"], doc: "Open the file in a vertical split.", fun: vsplit, - completer: Some(completers::filename), + signature: CommandSignature::all(completers::filename) }, TypableCommand { name: "vsplit-new", aliases: &["vnew"], doc: "Open a scratch buffer in a vertical split.", fun: vsplit_new, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "hsplit", aliases: &["hs", "sp"], doc: "Open the file in a horizontal split.", fun: hsplit, - completer: Some(completers::filename), + signature: CommandSignature::all(completers::filename) }, TypableCommand { name: "hsplit-new", aliases: &["hnew"], doc: "Open a scratch buffer in a horizontal split.", fun: hsplit_new, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "tutor", aliases: &[], doc: "Open the tutorial.", fun: tutor, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "goto", aliases: &["g"], doc: "Goto line number.", fun: goto_line_number, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "set-language", aliases: &["lang"], doc: "Set the language of current buffer (show current language if no value specified).", fun: language, - completer: Some(completers::language), + signature: CommandSignature::positional(&[completers::language]), }, TypableCommand { name: "set-option", aliases: &["set"], doc: "Set a config option at runtime.\nFor example to disable smart case search, use `:set search.smart-case false`.", fun: set_option, - completer: Some(completers::setting), + // TODO: Add support for completion of the options value(s), when appropriate. + signature: CommandSignature::positional(&[completers::setting]), }, TypableCommand { name: "toggle-option", aliases: &["toggle"], doc: "Toggle a boolean config option at runtime.\nFor example to toggle smart case search, use `:toggle search.smart-case`.", fun: toggle_option, - completer: Some(completers::setting), + signature: CommandSignature::positional(&[completers::setting]), }, TypableCommand { name: "get-option", aliases: &["get"], doc: "Get the current value of a config option.", fun: get_option, - completer: Some(completers::setting), + signature: CommandSignature::positional(&[completers::setting]), }, TypableCommand { name: "sort", aliases: &[], doc: "Sort ranges in selection.", fun: sort, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "rsort", aliases: &[], doc: "Sort ranges in selection in reverse order.", fun: sort_reverse, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "reflow", aliases: &[], doc: "Hard-wrap the current selection of lines to a given width.", fun: reflow, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "tree-sitter-subtree", aliases: &["ts-subtree"], doc: "Display tree sitter subtree under cursor, primarily for debugging queries.", fun: tree_sitter_subtree, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "config-reload", aliases: &[], doc: "Refresh user config.", fun: refresh_config, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "config-open", aliases: &[], doc: "Open the user config.toml file.", fun: open_config, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "log-open", aliases: &[], doc: "Open the helix log file.", fun: open_log, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "insert-output", aliases: &[], doc: "Run shell command, inserting output before each selection.", fun: insert_output, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "append-output", aliases: &[], doc: "Run shell command, appending output after each selection.", fun: append_output, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "pipe", aliases: &[], doc: "Pipe each selection to the shell command.", fun: pipe, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "pipe-to", aliases: &[], doc: "Pipe each selection to the shell command, ignoring output.", fun: pipe_to, - completer: None, + signature: CommandSignature::none(), }, TypableCommand { name: "run-shell-command", aliases: &["sh"], doc: "Run a shell command", fun: run_shell_command, - completer: Some(completers::filename), + signature: CommandSignature::all(completers::filename) }, ]; @@ -2546,8 +2591,6 @@ pub static TYPABLE_COMMAND_MAP: Lazy usize { + if shellwords.ends_with_whitespace() { + shellwords.words().len().saturating_sub(1) + } else { + shellwords.words().len().saturating_sub(2) + } +} + +#[test] +fn test_argument_number_of() { + let cases = vec![ + ("set-option", 0), + ("set-option ", 0), + ("set-option a", 0), + ("set-option asdf", 0), + ("set-option asdf ", 1), + ("set-option asdf xyz", 1), + ("set-option asdf xyz abc", 2), + ("set-option asdf xyz abc ", 3), + ]; + + for case in cases { + assert_eq!(case.1, argument_number_of(&Shellwords::from(case.0))); + } +} diff --git a/helix-term/src/keymap/default.rs b/helix-term/src/keymap/default.rs index 01184f80edcd..7425c8155523 100644 --- a/helix-term/src/keymap/default.rs +++ b/helix-term/src/keymap/default.rs @@ -363,7 +363,7 @@ pub fn default() -> HashMap { "A-d" | "A-del" => delete_word_forward, "C-u" => kill_to_line_start, "C-k" => kill_to_line_end, - "C-h" | "backspace" => delete_char_backward, + "C-h" | "backspace" | "S-backspace" => delete_char_backward, "C-d" | "del" => delete_char_forward, "C-j" | "ret" => insert_newline, "tab" => insert_tab, diff --git a/helix-term/src/ui/document.rs b/helix-term/src/ui/document.rs index ed4b1de90e91..28a52f74d3f5 100644 --- a/helix-term/src/ui/document.rs +++ b/helix-term/src/ui/document.rs @@ -202,10 +202,7 @@ pub fn render_text<'t>( // formattter.line_pos returns to line index of the next grapheme // so it must be called before formatter.next let doc_line = formatter.line_pos(); - // TODO refactor with let .. else once MSRV reaches 1.65 - let (grapheme, mut pos) = if let Some(it) = formatter.next() { - it - } else { + let Some((grapheme, mut pos)) = formatter.next() else { let mut last_pos = formatter.visual_pos(); if last_pos.row >= row_off { last_pos.col -= 1; @@ -226,7 +223,6 @@ pub fn render_text<'t>( // skip any graphemes on visual lines before the block start if pos.row < row_off { if char_pos >= style_span.1 { - // TODO refactor using let..else once MSRV reaches 1.65 style_span = if let Some(style_span) = styles.next() { style_span } else { @@ -266,12 +262,7 @@ pub fn render_text<'t>( // aquire the correct grapheme style if char_pos >= style_span.1 { - // TODO refactor using let..else once MSRV reaches 1.65 - style_span = if let Some(style_span) = styles.next() { - style_span - } else { - (Style::default(), usize::MAX) - } + style_span = styles.next().unwrap_or((Style::default(), usize::MAX)); } char_pos += grapheme.doc_chars(); @@ -322,7 +313,7 @@ pub struct TextRenderer<'a> { pub nbsp: String, pub space: String, pub tab: String, - pub tab_width: u16, + pub indent_width: u16, pub starting_indent: usize, pub draw_indent_guides: bool, pub col_offset: usize, @@ -370,16 +361,19 @@ impl<'a> TextRenderer<'a> { let text_style = theme.get("ui.text"); + let indent_width = doc.indent_style.indent_width(tab_width) as u16; + TextRenderer { surface, indent_guide_char: editor_config.indent_guides.character.into(), newline, nbsp, space, - tab_width: tab_width as u16, tab, whitespace_style: theme.get("ui.virtual.whitespace"), - starting_indent: (col_offset / tab_width) + indent_width, + starting_indent: col_offset / indent_width as usize + + (col_offset % indent_width as usize != 0) as usize + editor_config.indent_guides.skip_levels as usize, indent_guide_style: text_style.patch( theme @@ -461,14 +455,14 @@ impl<'a> TextRenderer<'a> { // Don't draw indent guides outside of view let end_indent = min( indent_level, - // Add tab_width - 1 to round up, since the first visible + // Add indent_width - 1 to round up, since the first visible // indent might be a bit after offset.col - self.col_offset + self.viewport.width as usize + (self.tab_width - 1) as usize, - ) / self.tab_width as usize; + self.col_offset + self.viewport.width as usize + (self.indent_width as usize - 1), + ) / self.indent_width as usize; for i in self.starting_indent..end_indent { - let x = - (self.viewport.x as usize + (i * self.tab_width as usize) - self.col_offset) as u16; + let x = (self.viewport.x as usize + (i * self.indent_width as usize) - self.col_offset) + as u16; let y = self.viewport.y + row; debug_assert!(self.surface.in_bounds(x, y)); self.surface diff --git a/helix-term/src/ui/markdown.rs b/helix-term/src/ui/markdown.rs index 923dd73a16ab..87136992c43b 100644 --- a/helix-term/src/ui/markdown.rs +++ b/helix-term/src/ui/markdown.rs @@ -342,13 +342,10 @@ impl Component for Markdown { fn required_size(&mut self, viewport: (u16, u16)) -> Option<(u16, u16)> { let padding = 2; - if padding >= viewport.1 || padding >= viewport.0 { - return None; - } let contents = self.parse(None); // TODO: account for tab width - let max_text_width = (viewport.0 - padding).min(120); + let max_text_width = (viewport.0.saturating_sub(padding)).min(120); let (width, height) = crate::ui::text::required_size(&contents, max_text_width); Some((width + padding, height + padding)) diff --git a/helix-term/src/ui/prompt.rs b/helix-term/src/ui/prompt.rs index f438231fa9c0..35ae8c2a8e0b 100644 --- a/helix-term/src/ui/prompt.rs +++ b/helix-term/src/ui/prompt.rs @@ -516,7 +516,7 @@ impl Component for Prompt { alt!('d') | alt!(Delete) | ctrl!(Delete) => self.delete_word_forwards(cx.editor), ctrl!('k') => self.kill_to_end_of_line(cx.editor), ctrl!('u') => self.kill_to_start_of_line(cx.editor), - ctrl!('h') | key!(Backspace) => { + ctrl!('h') | key!(Backspace) | shift!(Backspace) => { self.delete_char_backwards(cx.editor); (self.callback_fn)(cx, &self.line, PromptEvent::Update); } diff --git a/helix-term/src/ui/text.rs b/helix-term/src/ui/text.rs index c318052b2dd0..a379536f8b62 100644 --- a/helix-term/src/ui/text.rs +++ b/helix-term/src/ui/text.rs @@ -58,7 +58,7 @@ pub fn required_size(text: &tui::text::Text, max_text_width: u16) -> (u16, u16) let content_width = content.width() as u16; if content_width > max_text_width { text_width = max_text_width; - height += content_width / max_text_width; + height += content_width.checked_div(max_text_width).unwrap_or(0); } else if content_width > text_width { text_width = content_width; } diff --git a/helix-tui/Cargo.toml b/helix-tui/Cargo.toml index a4a1c389f34d..ccd016f50b9c 100644 --- a/helix-tui/Cargo.toml +++ b/helix-tui/Cargo.toml @@ -19,7 +19,7 @@ default = ["crossterm"] bitflags = "1.3" cassowary = "0.3" unicode-segmentation = "1.10" -crossterm = { version = "0.25", optional = true } +crossterm = { version = "0.26", optional = true } termini = "0.1" serde = { version = "1", "optional" = true, features = ["derive"]} helix-view = { version = "0.6", path = "../helix-view", features = ["term"] } diff --git a/helix-tui/src/backend/crossterm.rs b/helix-tui/src/backend/crossterm.rs index c00e1f406e7c..5305640cb15a 100644 --- a/helix-tui/src/backend/crossterm.rs +++ b/helix-tui/src/backend/crossterm.rs @@ -1,6 +1,6 @@ use crate::{backend::Backend, buffer::Cell}; use crossterm::{ - cursor::{CursorShape, Hide, MoveTo, SetCursorShape, Show}, + cursor::{Hide, MoveTo, SetCursorStyle, Show}, execute, queue, style::{ Attribute as CAttribute, Color as CColor, Print, SetAttribute, SetBackgroundColor, @@ -156,12 +156,12 @@ where fn show_cursor(&mut self, kind: CursorKind) -> io::Result<()> { let shape = match kind { - CursorKind::Block => CursorShape::Block, - CursorKind::Bar => CursorShape::Line, - CursorKind::Underline => CursorShape::UnderScore, + CursorKind::Block => SetCursorStyle::SteadyBlock, + CursorKind::Bar => SetCursorStyle::SteadyBar, + CursorKind::Underline => SetCursorStyle::SteadyUnderScore, CursorKind::Hidden => unreachable!(), }; - map_error(execute!(self.buffer, Show, SetCursorShape(shape))) + map_error(execute!(self.buffer, Show, shape)) } fn get_cursor(&mut self) -> io::Result<(u16, u16)> { diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index 19b660a60f54..789ee79519a0 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -16,13 +16,13 @@ helix-core = { version = "0.6", path = "../helix-core" } tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "parking_lot", "macros"] } parking_lot = "0.12" -git-repository = { version = "0.32", default-features = false , optional = true } +gix = { version = "0.39.0", default-features = false , optional = true } imara-diff = "0.1.5" log = "0.4" [features] -git = ["git-repository"] +git = ["gix"] [dev-dependencies] -tempfile = "3.3" \ No newline at end of file +tempfile = "3.4" \ No newline at end of file diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index 432159b6cdb8..2a540c8d12ff 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -1,9 +1,8 @@ use std::path::Path; -use git::objs::tree::EntryMode; -use git::sec::trust::DefaultForLevel; -use git::{Commit, ObjectId, Repository, ThreadSafeRepository}; -use git_repository as git; +use gix::objs::tree::EntryMode; +use gix::sec::trust::DefaultForLevel; +use gix::{Commit, ObjectId, Repository, ThreadSafeRepository}; use crate::DiffProvider; @@ -15,13 +14,13 @@ pub struct Git; impl Git { fn open_repo(path: &Path, ceiling_dir: Option<&Path>) -> Option { // custom open options - let mut git_open_opts_map = git::sec::trust::Mapping::::default(); + let mut git_open_opts_map = gix::sec::trust::Mapping::::default(); // On windows various configuration options are bundled as part of the installations // This path depends on the install location of git and therefore requires some overhead to lookup // This is basically only used on windows and has some overhead hence it's disabled on other platforms. // `gitoxide` doesn't use this as default - let config = git::permissions::Config { + let config = gix::permissions::Config { system: true, git: true, user: true, @@ -30,16 +29,16 @@ impl Git { git_binary: cfg!(windows), }; // change options for config permissions without touching anything else - git_open_opts_map.reduced = git_open_opts_map.reduced.permissions(git::Permissions { + git_open_opts_map.reduced = git_open_opts_map.reduced.permissions(gix::Permissions { config, - ..git::Permissions::default_for_level(git::sec::Trust::Reduced) + ..gix::Permissions::default_for_level(gix::sec::Trust::Reduced) }); - git_open_opts_map.full = git_open_opts_map.full.permissions(git::Permissions { + git_open_opts_map.full = git_open_opts_map.full.permissions(gix::Permissions { config, - ..git::Permissions::default_for_level(git::sec::Trust::Full) + ..gix::Permissions::default_for_level(gix::sec::Trust::Full) }); - let mut open_options = git::discover::upwards::Options::default(); + let mut open_options = gix::discover::upwards::Options::default(); if let Some(ceiling_dir) = ceiling_dir { open_options.ceiling_dirs = vec![ceiling_dir.to_owned()]; } diff --git a/helix-view/Cargo.toml b/helix-view/Cargo.toml index 17e07e9a2dd6..54b679ade5db 100644 --- a/helix-view/Cargo.toml +++ b/helix-view/Cargo.toml @@ -20,7 +20,7 @@ helix-core = { version = "0.6", path = "../helix-core" } helix-loader = { version = "0.6", path = "../helix-loader" } helix-lsp = { version = "0.6", path = "../helix-lsp" } helix-dap = { version = "0.6", path = "../helix-dap" } -crossterm = { version = "0.25", optional = true } +crossterm = { version = "0.26", optional = true } helix-vcs = { version = "0.6", path = "../helix-vcs" } # Conversion traits diff --git a/helix-view/src/graphics.rs b/helix-view/src/graphics.rs index a0b645fae5b8..e813fb5604b8 100644 --- a/helix-view/src/graphics.rs +++ b/helix-view/src/graphics.rs @@ -237,8 +237,8 @@ impl Rect { Rect { x: x1, y: y1, - width: x2 - x1, - height: y2 - y1, + width: x2.saturating_sub(x1), + height: y2.saturating_sub(y1), } } diff --git a/helix-view/src/handlers/dap.rs b/helix-view/src/handlers/dap.rs index 2e86871b5fae..107c29be578c 100644 --- a/helix-view/src/handlers/dap.rs +++ b/helix-view/src/handlers/dap.rs @@ -1,7 +1,8 @@ use crate::editor::{Action, Breakpoint}; use crate::{align_view, Align, Editor}; +use dap::requests::DisconnectArguments; use helix_core::Selection; -use helix_dap::{self as dap, Client, Payload, Request, ThreadId}; +use helix_dap::{self as dap, Client, ConnectionType, Payload, Request, ThreadId}; use helix_lsp::block_on; use log::warn; use std::fmt::Write; @@ -274,6 +275,66 @@ impl Editor { self.set_status("Debugged application started"); }; // TODO: do we need to handle error? } + Event::Terminated(terminated) => { + let restart_args = if let Some(terminated) = terminated { + terminated.restart + } else { + None + }; + + let disconnect_args = Some(DisconnectArguments { + restart: Some(restart_args.is_some()), + terminate_debuggee: None, + suspend_debuggee: None, + }); + + if let Err(err) = debugger.disconnect(disconnect_args).await { + self.set_error(format!( + "Cannot disconnect debugger upon terminated event receival {:?}", + err + )); + return false; + } + + match restart_args { + Some(restart_args) => { + log::info!("Attempting to restart debug session."); + let connection_type = match debugger.connection_type() { + Some(connection_type) => connection_type, + None => { + self.set_error("No starting request found, to be used in restarting the debugging session."); + return false; + } + }; + + let relaunch_resp = if let ConnectionType::Launch = connection_type { + debugger.launch(restart_args).await + } else { + debugger.attach(restart_args).await + }; + + if let Err(err) = relaunch_resp { + self.set_error(format!( + "Failed to restart debugging session: {:?}", + err + )); + } + } + None => { + self.set_status( + "Terminated debugging session and disconnected debugger.", + ); + } + } + } + Event::Exited(resp) => { + let exit_code = resp.exit_code; + if exit_code != 0 { + self.set_error(format!( + "Debuggee failed to exit successfully (exit code: {exit_code})." + )); + } + } ev => { log::warn!("Unhandled event {:?}", ev); return false; // return early to skip render diff --git a/helix-view/src/view.rs b/helix-view/src/view.rs index f793cbe364f5..7bfbb2418379 100644 --- a/helix-view/src/view.rs +++ b/helix-view/src/view.rs @@ -242,7 +242,7 @@ impl View { at_top = true; true } - Some((visual_pos, _)) if visual_pos.row >= vertical_viewport_end - scrolloff => { + Some((visual_pos, _)) if visual_pos.row + scrolloff + 1 >= vertical_viewport_end => { if CENTERING && visual_pos.row >= vertical_viewport_end { // cursor out of view return None; @@ -257,7 +257,7 @@ impl View { let v_off = if at_top { scrolloff as isize } else { - viewport.height as isize - scrolloff as isize + viewport.height as isize - scrolloff as isize - 1 }; (offset.anchor, offset.vertical_offset) = char_idx_at_visual_offset(doc_text, cursor, -v_off, 0, &text_fmt, &annotations); diff --git a/languages.toml b/languages.toml index b521cd12812e..c34135244c46 100644 --- a/languages.toml +++ b/languages.toml @@ -52,6 +52,20 @@ args = { attachCommands = [ "platform select remote-gdb-server", "platform conne name = "rust" source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0431a2c60828731f27491ee9fdefe25e250ce9c9" } +[[language]] +name = "sway" +scope = "source.sway" +injection-regex = "sway" +file-types = ["sw"] +language-server = { command = "forc", args = ["lsp"] } +roots = ["Forc.toml", "Forc.lock"] +indent = { tab-width = 4, unit = " " } +comment-token = "//" + +[[grammar]] +name = "sway" +source = { git = "https://github.com/FuelLabs/tree-sitter-sway", rev = "e491a005ee1d310f4c138bf215afd44cfebf959c" } + [[language]] name = "toml" scope = "source.toml" @@ -1026,7 +1040,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "markdown" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "a7de4be29783a6e25f3240c90afea52f2417faa3", subpath = "tree-sitter-markdown" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown" } [[language]] name = "markdown.inline" @@ -1038,7 +1052,7 @@ grammar = "markdown_inline" [[grammar]] name = "markdown_inline" -source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "a7de4be29783a6e25f3240c90afea52f2417faa3", subpath = "tree-sitter-markdown-inline" } +source = { git = "https://github.com/MDeiml/tree-sitter-markdown", rev = "7e7aa9a25ca9729db9fe22912f8f47bdb403a979", subpath = "tree-sitter-markdown-inline" } [[language]] name = "dart" @@ -1120,7 +1134,7 @@ indent = { tab-width = 2, unit = " " } [[grammar]] name = "git-rebase" -source = { git = "https://github.com/the-mikedavis/tree-sitter-git-rebase", rev = "332dc528f27044bc4427024dbb33e6941fc131f2" } +source = { git = "https://github.com/the-mikedavis/tree-sitter-git-rebase", rev = "d8a4207ebbc47bd78bacdf48f883db58283f9fd8" } [[language]] name = "regex" @@ -1176,7 +1190,7 @@ source = { git = "https://github.com/shunsambongi/tree-sitter-gitignore", rev = name = "graphql" scope = "source.graphql" injection-regex = "graphql" -file-types = ["gql", "graphql"] +file-types = ["gql", "graphql", "graphqls"] roots = [] indent = { tab-width = 2, unit = " " } @@ -1434,7 +1448,7 @@ injection-regex = "sql" [[grammar]] name = "sql" -source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "286e10c5bc5d1703ee8f9afb351165a9a6182be1" } +source = { git = "https://github.com/DerekStride/tree-sitter-sql", rev = "3a3f92b29c880488a08bc2baaf1aca6432ec3380" } [[language]] name = "gdscript" @@ -1449,7 +1463,7 @@ indent = { tab-width = 4, unit = "\t" } [[grammar]] name = "gdscript" -source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a56a6fcec3fb63ec3324bf9373aae7298861eb30" } +source = { git = "https://github.com/PrestonKnopp/tree-sitter-gdscript", rev = "a4b57cc3bcbfc24550e858159647e9238e7ad1ac" } [[language]] name = "godot-resource" @@ -2167,3 +2181,77 @@ comment-token = "#" [[grammar]] name = "hosts" source = { git = "https://github.com/ath3/tree-sitter-hosts", rev = "301b9379ce7dfc8bdbe2c2699a6887dcb73953f9" } + +[[language]] +name = "uxntal" +scope = "source.tal" +injection-regex = "tal" +file-types = ["tal"] +roots = [] +auto-format = false +comment-token = "(" + +[[grammar]] +name = "uxntal" +source = { git = "https://github.com/Jummit/tree-sitter-uxntal", rev = "9297e95ef74380b0ad84c4fd98f91e9f6e4319e6" } + +[[language]] +name = "yuck" +scope = "source.yuck" +injection-regex = "yuck" +file-types = ["yuck"] +roots = [] +comment-token = ";" +indent = { tab-width = 2, unit = " " } + +[[grammar]] +name = "yuck" +source = { git = "https://github.com/Philipp-M/tree-sitter-yuck", rev = "9e97da5773f82123a8c8cccf8f7e795d140ed7d1" } + +[[language]] +name = "prql" +scope = "source.prql" +injection-regex = "prql" +file-types = ["prql"] +roots = [] +comment-token = "#" +indent = { tab-width = 4, unit = " " } + +[[grammar]] +name = "prql" +source = { git = "https://github.com/PRQL/tree-sitter-prql", rev = "3f27cac466f030ee7d985d91eba5470e01dd21ea" } + +[[language]] +name = "po" +scope = "source.po" +file-types = ["po", "pot"] +roots = [] +comment-token = "#" + +[[grammar]] +name = "po" +source = { git = "https://github.com/erasin/tree-sitter-po", rev = "417cee9abb2053ed26b19e7de972398f2da9b29e" } + +[[language]] +name = "nasm" +scope = "source.nasm" +file-types = ["asm", "s", "S", "nasm"] +injection-regex = "n?asm" +roots = [] +comment-token = ";" +indent = { tab-width = 8, unit = " " } + +[[grammar]] +name = "nasm" +source = { git = "https://github.com/naclsn/tree-sitter-nasm", rev = "a0db15db6fcfb1bf2cc8702500e55e558825c48b" } + +[[language]] +name = "rst" +scope = "source.rst" +comment-token = ".." +file-types = ["rst"] +roots = [] + +[[grammar]] +name = "rst" +source = { git = "https://github.com/stsewd/tree-sitter-rst", rev = "25e6328872ac3a764ba8b926aea12719741103f1" } diff --git a/runtime/queries/comment/highlights.scm b/runtime/queries/comment/highlights.scm index 88685d59a1aa..3b25531a8d96 100644 --- a/runtime/queries/comment/highlights.scm +++ b/runtime/queries/comment/highlights.scm @@ -5,17 +5,33 @@ ":" @punctuation.delimiter +; Hint level tags +((tag (name) @hint) + (#match? @hint "^(HINT|MARK)$")) + +("text" @hint + (#match? @hint "^(HINT|MARK)$")) + +; Info level tags +((tag (name) @info) + (#match? @info "^(INFO|NOTE|TODO)$")) + +("text" @info + (#match? @info "^(INFO|NOTE|TODO)$")) + +; Warning level tags ((tag (name) @warning) - (#match? @warning "^(TODO|HACK|WARNING)$")) + (#match? @warning "^(HACK|WARN|WARNING)$")) ("text" @warning - (#match? @warning "^(TODO|HACK|WARNING)$")) + (#match? @warning "^(HACK|WARN|WARNING)$")) +; Error level tags ((tag (name) @error) - (match? @error "^(FIXME|XXX|BUG)$")) + (match? @error "^(BUG|FIXME|ISSUE|XXX)$")) ("text" @error - (match? @error "^(FIXME|XXX|BUG)$")) + (match? @error "^(BUG|FIXME|ISSUE|XXX)$")) (tag (name) @ui.text diff --git a/runtime/queries/elm/textobjects.scm b/runtime/queries/elm/textobjects.scm new file mode 100644 index 000000000000..d212e9c3b3cb --- /dev/null +++ b/runtime/queries/elm/textobjects.scm @@ -0,0 +1,63 @@ +(line_comment) @comment.inside +(line_comment)+ @comment.around +(block_comment) @comment.inside +(block_comment)+ @comment.around + +((type_annotation)? + (value_declaration + (function_declaration_left (lower_case_identifier)) + (eq) + (_) @function.inside + ) +) @function.around + +(parenthesized_expr + (anonymous_function_expr + ( + (arrow) + (_) @function.inside + ) + ) +) @function.around + +(value_declaration + (function_declaration_left + (lower_pattern + (lower_case_identifier) @parameter.inside @parameter.around + ) + ) +) + +(value_declaration + (function_declaration_left + (pattern) @parameter.inside @parameter.around + ) +) + +(value_declaration + (function_declaration_left + (tuple_pattern + (pattern) @parameter.inside + ) @parameter.around + ) +) + +(value_declaration + (function_declaration_left + (record_pattern + (lower_pattern + (lower_case_identifier) @parameter.inside + ) + ) @parameter.around + ) +) + +(parenthesized_expr + (anonymous_function_expr + ( + (backslash) + (pattern) @parameter.inside + (arrow) + ) + ) +) diff --git a/runtime/queries/gdscript/highlights.scm b/runtime/queries/gdscript/highlights.scm index f36f4e35c15f..88f2a1875832 100644 --- a/runtime/queries/gdscript/highlights.scm +++ b/runtime/queries/gdscript/highlights.scm @@ -1,7 +1,8 @@ ; Identifier naming conventions -((identifier) @constant - (#match? @constant "^[A-Z][A-Z_]*$")) +( + (identifier) @constant + (#match? @constant "^[A-Z][A-Z\\d_]+$")) ; class (class_name_statement (name) @type) @@ -11,32 +12,35 @@ ; Function calls (attribute_call (identifier) @function) - (base_call (identifier) @function) - (call (identifier) @function) ; Function definitions (function_definition (name) @function) - (constructor_definition "_init" @function) + ;; Literals -(integer) @constant.numeric.integer -(float) @constant.numeric.float (comment) @comment (string) @string -(escape_sequence) @constant.character.escape -(identifier) @variable + (type) @type +(expression_statement (array (identifier) @type)) +(binary_operator (identifier) @type) -;; Literals +(variable_statement (identifier) @variable) +(get_node) @label + +(const_statement (name) @constant) +(integer) @constant.numeric.integer +(float) @constant.numeric.float +(escape_sequence) @constant.character.escape [ (true) (false) - (null) -] @constant.builtin +] @constant.builtin.boolean +(null) @constant.builtin [ "+" @@ -62,37 +66,67 @@ "~" "<<" ">>" - "and" - "or" - "not" ] @operator +(annotation (identifier) @keyword.storage.modifier) + [ - (static_keyword) - (remote_keyword) - (tool_statement) - "var" - "func" - "setget" - "in" - "is" - "as" "if" "else" "elif" +] @keyword.control.conditional + +[ "while" "for" +] @keyword.control.repeat + +[ "return" + "pass" "break" "continue" - "pass" +] @keyword.control.return + +[ + "func" +] @keyword.control.function + +[ + "export" +] @keyword.control.import + +[ + "in" + "is" + "as" "match" + "and" + "or" + "not" +] @keyword.operator + +[ + "var" "class" "class_name" "enum" +] @keyword.storage.type + + +[ + (remote_keyword) + (static_keyword) + "const" "signal" + "@" +] @keyword.storage.modifier + +[ + "setget" "onready" - "export" "extends" - "const" + "set" + "get" ] @keyword + diff --git a/runtime/queries/gdscript/indents.scm b/runtime/queries/gdscript/indents.scm index 1ab41a44d289..c969eb7cf5a8 100644 --- a/runtime/queries/gdscript/indents.scm +++ b/runtime/queries/gdscript/indents.scm @@ -12,6 +12,7 @@ (dictionary (_)) (array (_)) + (setget) ] @indent [ @@ -25,7 +26,6 @@ (class_definition) ] @extend - [ (return_statement) (break_statement) diff --git a/runtime/queries/git-rebase/highlights.scm b/runtime/queries/git-rebase/highlights.scm index 4f007037d4b7..5a03dadf87ab 100644 --- a/runtime/queries/git-rebase/highlights.scm +++ b/runtime/queries/git-rebase/highlights.scm @@ -1,11 +1,36 @@ -(operation operator: ["p" "pick" "r" "reword" "e" "edit" "s" "squash" "m" "merge" "d" "drop" "b" "break" "x" "exec"] @keyword) -(operation operator: ["l" "label" "t" "reset"] @function) -(operation operator: ["f" "fixup"] @function.special) +; a rough translation: +; * constant.builtin - git hash +; * constant - a git label +; * keyword - command that acts on commits commits +; * function - command that acts only on labels +; * comment - discarded commentary on a command, has no effect on the rebase +; * string - text used in the rebase operation +; * operator - a 'switch' (used in fixup and merge), either -c or -C at time of writing + +(((command) @keyword + (label) @constant.builtin + (message)? @comment) + (#match? @keyword "^(p|pick|r|reword|e|edit|s|squash|d|drop)$")) + +(((command) @function + (label) @constant + (message)? @comment) + (#match? @function "^(l|label|t|reset|u|update-ref)$")) + +((command) @keyword + (#match? @keyword "^(x|exec|b|break)$")) + +(((command) @attribute + (label) @constant.builtin + (message)? @comment) + (#match? @attribute "^(f|fixup)$")) + +(((command) @keyword + (label) @constant.builtin + (label) @constant + (message) @string) + (#match? @keyword "^(m|merge)$")) (option) @operator -(label) @string.special.symbol -(commit) @constant -"#" @punctuation.delimiter -(comment) @comment -(ERROR) @error +(comment) @comment diff --git a/runtime/queries/git-rebase/injections.scm b/runtime/queries/git-rebase/injections.scm index 070129b63d88..90f1f94163a5 100644 --- a/runtime/queries/git-rebase/injections.scm +++ b/runtime/queries/git-rebase/injections.scm @@ -1,4 +1,5 @@ -((operation - operator: ["x" "exec"] - (command) @injection.content) - (#set! injection.language "bash")) +(((command) @attribute + (message)? @injection.content) + (#match? @attribute "^(x|exec)$") + (#set! injection.language "bash") +) diff --git a/runtime/queries/godot-resource/injections.scm b/runtime/queries/godot-resource/injections.scm index 321c90add371..7929d63cd812 100644 --- a/runtime/queries/godot-resource/injections.scm +++ b/runtime/queries/godot-resource/injections.scm @@ -1,2 +1,18 @@ ((comment) @injection.content (#set! injection.language "comment")) + +; ((section) @injection.content +; (#set! injection.language "comment")) + +((section + (attribute + (identifier) @_type + (string) @_is_shader) + (property + (path) @_is_code + (string) @injection.content)) + (#match? @_type "type") + (#match? @_is_shader "Shader") + (#eq? @_is_code "code") + (#set! injection.language "glsl") +) diff --git a/runtime/queries/markdown.inline/injections.scm b/runtime/queries/markdown.inline/injections.scm index 2dd149d9062a..c2e7012caa04 100644 --- a/runtime/queries/markdown.inline/injections.scm +++ b/runtime/queries/markdown.inline/injections.scm @@ -1,2 +1,4 @@ ((html_tag) @injection.content (#set! injection.language "html") (#set! injection.include-unnamed-children)) + +((latex_block) @injection.content (#set! injection.language "latex") (#set! injection.include-unnamed-children)) diff --git a/runtime/queries/markdown/highlights.scm b/runtime/queries/markdown/highlights.scm index 25f22ba73861..80c9f9583f6a 100644 --- a/runtime/queries/markdown/highlights.scm +++ b/runtime/queries/markdown/highlights.scm @@ -39,7 +39,7 @@ (list_marker_parenthesis) ] @markup.list.numbered -(thematic_break) @punctuation.delimiter +(thematic_break) @punctuation.special [ (block_continuation) @@ -51,3 +51,9 @@ ] @string.escape (block_quote) @markup.quote + +(pipe_table_row + "|" @punctuation.special) +(pipe_table_header + "|" @punctuation.special) +(pipe_table_delimiter_row) @punctuation.special diff --git a/runtime/queries/nasm/highlights.scm b/runtime/queries/nasm/highlights.scm new file mode 100644 index 000000000000..5e3cfebe6f5b --- /dev/null +++ b/runtime/queries/nasm/highlights.scm @@ -0,0 +1,126 @@ +(comment) @comment + +(label) @label + +(preproc_expression) @keyword.directive + +[ + (line_here_token) + (section_here_token) +] @variable.builtin + +(unary_expression + operator: _ @operator) +(binary_expression + operator: _ @operator) +(conditional_expression + "?" @operator + ":" @operator) + +[ + ":" + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket + +(instruction_prefix) @keyword +(actual_instruction + instruction: (word) @function) + +(call_syntax_expression + base: (word) @function) + +(size_hint) @type +(struc_declaration + name: (word) @type) +(struc_instance + name: (word) @type) + +(effective_address + hint: _ @type) +(effective_address + segment: _ @constant.builtin) + +(register) @constant.builtin + +(number_literal) @constant.numeric.integer +(string_literal) @string +(float_literal) @constant.numeric.float +(packed_bcd_literal) @constant.numeric.integer + +((word) @constant + (#match? @constant "^[A-Z_][?A-Z_0-9]+$")) +((word) @constant.builtin + (#match? @constant.builtin "^__\\?[A-Z_a-z0-9]+\\?__$")) +(word) @variable + +(preproc_arg) @keyword.directive + +[ + (preproc_def) + (preproc_function_def) + (preproc_undef) + (preproc_alias) + (preproc_multiline_macro) + (preproc_multiline_unmacro) + (preproc_if) + (preproc_rotate) + (preproc_rep_loop) + (preproc_include) + (preproc_pathsearch) + (preproc_depend) + (preproc_use) + (preproc_push) + (preproc_pop) + (preproc_repl) + (preproc_arg) + (preproc_stacksize) + (preproc_local) + (preproc_reporting) + (preproc_pragma) + (preproc_line) + (preproc_clear) +] @keyword.directive +[ + (pseudo_instruction_dx) + (pseudo_instruction_resx) + (pseudo_instruction_incbin_command) + (pseudo_instruction_equ_command) + (pseudo_instruction_times_prefix) + (pseudo_instruction_alignx_macro) +] @function.special +[ + (assembl_directive_target) + (assembl_directive_defaults) + (assembl_directive_sections) + (assembl_directive_absolute) + (assembl_directive_symbols) + (assembl_directive_common) + (assembl_directive_symbolfixes) + (assembl_directive_cpu) + (assembl_directive_floathandling) + (assembl_directive_org) + (assembl_directive_sectalign) + + (assembl_directive_primitive_target) + (assembl_directive_primitive_defaults) + (assembl_directive_primitive_sections) + (assembl_directive_primitive_absolute) + (assembl_directive_primitive_symbols) + (assembl_directive_primitive_common) + (assembl_directive_primitive_symbolfixes) + (assembl_directive_primitive_cpu) + (assembl_directive_primitive_floathandling) + (assembl_directive_primitive_org) + (assembl_directive_primitive_sectalign) + (assembl_directive_primitive_warning) + (assembl_directive_primitive_map) +] @keyword diff --git a/runtime/queries/nasm/injections.scm b/runtime/queries/nasm/injections.scm new file mode 100644 index 000000000000..2f0e58eb6431 --- /dev/null +++ b/runtime/queries/nasm/injections.scm @@ -0,0 +1,2 @@ +((comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/nasm/textobjects.scm b/runtime/queries/nasm/textobjects.scm new file mode 100644 index 000000000000..ddfbad78cb30 --- /dev/null +++ b/runtime/queries/nasm/textobjects.scm @@ -0,0 +1,15 @@ +(preproc_multiline_macro + body: (body) @function.inside) @function.around +(struc_declaration + body: (struc_declaration_body) @class.inside) @class.around +(struc_instance + body: (struc_instance_body) @class.inside) @class.around + +(preproc_function_def_parameters + (word) @parameter.inside) +(call_syntax_arguments + (_) @parameter.inside) +(operand) @parameter.inside + +(comment) @comment.inside +(comment)+ @comment.around diff --git a/runtime/queries/po/highlights.scm b/runtime/queries/po/highlights.scm new file mode 100644 index 000000000000..b090f129df46 --- /dev/null +++ b/runtime/queries/po/highlights.scm @@ -0,0 +1,15 @@ +[ + (msgctxt) + (msgid) + (msgid_plural) + (msgstr) +]@keyword + +(comment) @comment +(comment (comment_reference (text) @string.special.path)) +(comment (comment_flag (text) @label)) + +(number) @constant.numeric +(string) @string + +(ERROR) @error diff --git a/runtime/queries/po/textobjects.scm b/runtime/queries/po/textobjects.scm new file mode 100644 index 000000000000..70abcb14918b --- /dev/null +++ b/runtime/queries/po/textobjects.scm @@ -0,0 +1,6 @@ +(msgid) @parameter.inside + +(comment) @comment.inside +(comment)+ @comment.around + + diff --git a/runtime/queries/prql/highlights.scm b/runtime/queries/prql/highlights.scm new file mode 100644 index 000000000000..5cfedee4853c --- /dev/null +++ b/runtime/queries/prql/highlights.scm @@ -0,0 +1,136 @@ +[ + (keyword_from) + (keyword_filter) + (keyword_derive) + (keyword_group) + (keyword_aggregate) + (keyword_sort) + (keyword_take) + (keyword_window) + (keyword_join) + (keyword_select) + (keyword_switch) + (keyword_append) + (keyword_remove) + (keyword_intersect) + (keyword_rolling) + (keyword_rows) + (keyword_expanding) + (keyword_let) + (keyword_prql) + (keyword_from_text) +] @keyword + +(literal) @string + +(assignment + alias: (field) @variable.other.member) + +alias: (identifier) @variable.other.member + +(f_string) @string.special +(s_string) @string.special + +(comment) @comment + +(keyword_func) @keyword.function + +(function_call + (identifier) @function) + +[ + "+" + "-" + "*" + "/" + "=" + "==" + "<" + "<=" + "!=" + ">=" + ">" + "->" + (bang) +] @operator + +[ + "(" + ")" + "[" + "]" +] @punctuation.bracket + +[ + "," + "." + (pipe) +] @punctuation.delimiter + +(literal + (integer) @constant.numeric.integer) + +(integer) @constant.numeric.integer + +(literal + (decimal_number) @constant.numeric.float) + +(decimal_number) @constant.numeric.float + +[ + (keyword_min) + (keyword_max) + (keyword_count) + (keyword_count_distinct) + (keyword_average) + (keyword_avg) + (keyword_sum) + (keyword_stddev) + (keyword_count) +] @function + +[ + (keyword_side) + (keyword_version) + (keyword_target) + (keyword_null) + (keyword_format) +] @attribute + +(target) @function.builtin + + [ + (date) + (time) + (timestamp) +] @string.special + +[ + (keyword_left) + (keyword_inner) + (keyword_right) + (keyword_full) + (keyword_csv) + (keyword_json) +] @function.method + +[ + (keyword_true) + (keyword_false) +] @constant.builtin.boolean + +[ + (keyword_and) + (keyword_or) +] @keyword.operator + +(function_definition + (keyword_func) + name: (identifier) @function) + +(parameter + (identifier) @variable.parameter) + +(variable + (keyword_let) + name: (identifier) @constant) diff --git a/runtime/queries/prql/injections.scm b/runtime/queries/prql/injections.scm new file mode 100644 index 000000000000..02a8919f8951 --- /dev/null +++ b/runtime/queries/prql/injections.scm @@ -0,0 +1,8 @@ +((s_string) @injection.content + (#set! injection.language "sql")) + +(from_text + (keyword_from_text) + (keyword_json) + (literal) @injection.content + (#set! injection.language "json")) diff --git a/runtime/queries/rst/highlights.scm b/runtime/queries/rst/highlights.scm new file mode 100644 index 000000000000..73c0def431e9 --- /dev/null +++ b/runtime/queries/rst/highlights.scm @@ -0,0 +1,38 @@ +(comment) @comment + +[ + (title) +] @markup.heading.1 + +[ + "adornment" +] @markup.heading.marker + +[ + (target) + (reference) +] @markup.link.url + +[ + "bullet" +] @markup.list.unnumbered + +(strong) @markup.bold +(emphasis) @markup.italic +(literal) @markup.raw.inline + +(list_item + (term) @markup.bold + (classifier)? @markup.italic) + +(directive + [".." (type) "::"] @function +) + +(field + [":" (field_name) ":"] @variable.other.member +) + +(interpreted_text) @markup.raw.inline + +(interpreted_text (role)) @keyword diff --git a/runtime/queries/sql/highlights.scm b/runtime/queries/sql/highlights.scm index a2d2f7feb911..f15a92e7eb46 100644 --- a/runtime/queries/sql/highlights.scm +++ b/runtime/queries/sql/highlights.scm @@ -1,20 +1,17 @@ -(keyword_btree) @function.builtin -(keyword_hash) @function.builtin -(keyword_gist) @function.builtin -(keyword_spgist) @function.builtin -(keyword_gin) @function.builtin -(keyword_brin) @function.builtin - -(cast - name: (identifier) @function.builtin) - -(count - name: (identifier) @function.builtin) -(keyword_group_concat) @function.builtin +[ + (keyword_btree) + (keyword_hash) + (keyword_gist) + (keyword_spgist) + (keyword_gin) + (keyword_brin) -(invocation - name: (identifier) @function.builtin) + (cast) + (count) + (group_concat) + (invocation) +] @function.builtin (table_reference name: (identifier) @namespace) @@ -57,7 +54,7 @@ ] @constant.builtin ((literal) @constant.numeric - (#match? @constant.numeric "^(-?\d*\.?\d*)$")) + (#match? @constant.numeric "^-?\\d*\\.?\\d*$")) (literal) @string @@ -92,6 +89,8 @@ (keyword_primary) (keyword_create) (keyword_alter) + (keyword_change) + (keyword_modify) (keyword_drop) (keyword_add) (keyword_table) @@ -119,8 +118,12 @@ (keyword_if) (keyword_exists) (keyword_auto_increment) + (keyword_collate) + (keyword_character) + (keyword_engine) (keyword_default) (keyword_cascade) + (keyword_restrict) (keyword_with) (keyword_no) (keyword_data) @@ -144,6 +147,7 @@ (keyword_over) (keyword_nulls) (keyword_first) + (keyword_after) (keyword_last) (keyword_window) (keyword_range) @@ -170,6 +174,37 @@ (keyword_like) (keyword_similar) (keyword_preserve) + (keyword_unsigned) + (keyword_zerofill) + + (keyword_external) + (keyword_stored) + (keyword_cached) + (keyword_uncached) + (keyword_replication) + (keyword_tblproperties) + (keyword_compute) + (keyword_stats) + (keyword_location) + (keyword_partitioned) + (keyword_comment) + (keyword_sort) + (keyword_format) + (keyword_delimited) + (keyword_fields) + (keyword_terminated) + (keyword_escaped) + (keyword_lines) + + (keyword_parquet) + (keyword_rcfile) + (keyword_csv) + (keyword_textfile) + (keyword_avro) + (keyword_sequencefile) + (keyword_orc) + (keyword_avro) + (keyword_jsonfile) ] @keyword [ @@ -193,9 +228,11 @@ (keyword_smallserial) (keyword_serial) (keyword_bigserial) - (keyword_smallint) - (keyword_int) + (tinyint) + (smallint) + (mediumint) + (int) (bigint) (decimal) (numeric) @@ -222,6 +259,8 @@ (keyword_timestamp) (keyword_timestamptz) + (keyword_interval) + (keyword_geometry) (keyword_geography) (keyword_box2d) diff --git a/runtime/queries/sway/highlights.scm b/runtime/queries/sway/highlights.scm new file mode 100644 index 000000000000..98f4d4493f02 --- /dev/null +++ b/runtime/queries/sway/highlights.scm @@ -0,0 +1,336 @@ +; ------- +; Tree-Sitter doesn't allow overrides in regards to captures, +; though it is possible to affect the child node of a captured +; node. Thus, the approach here is to flip the order so that +; overrides are unnecessary. +; ------- + +; ------- +; Types +; ------- + +; --- +; Primitives +; --- + +(escape_sequence) @constant.character.escape +(primitive_type) @type.builtin +(boolean_literal) @constant.builtin.boolean +(integer_literal) @constant.numeric.integer +(float_literal) @constant.numeric.float +(char_literal) @constant.character +[ + (string_literal) + (raw_string_literal) +] @string +[ + (line_comment) + (block_comment) +] @comment + +; --- +; Extraneous +; --- + +(self) @variable.builtin +(enum_variant (identifier) @type.enum.variant) + +(field_initializer + (field_identifier) @variable.other.member) +(shorthand_field_initializer + (identifier) @variable.other.member) +(shorthand_field_identifier) @variable.other.member + +(loop_label + "'" @label + (identifier) @label) + +; --- +; Punctuation +; --- + +[ + "::" + "." + ";" + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" + "#" +] @punctuation.bracket +(type_arguments + [ + "<" + ">" + ] @punctuation.bracket) +(type_parameters + [ + "<" + ">" + ] @punctuation.bracket) +(closure_parameters + "|" @punctuation.bracket) + +; --- +; Variables +; --- + +(let_declaration + pattern: [ + ((identifier) @variable) + ((tuple_pattern + (identifier) @variable)) + ]) + +; It needs to be anonymous to not conflict with `call_expression` further below. +(_ + value: (field_expression + value: (identifier)? @variable + field: (field_identifier) @variable.other.member)) + +(parameter + pattern: (identifier) @variable.parameter) +(closure_parameters + (identifier) @variable.parameter) + +; ------- +; Keywords +; ------- + +(for_expression + "for" @keyword.control.repeat) +((identifier) @keyword.control + (#match? @keyword.control "^yield$")) + +"in" @keyword.control + +[ + "match" + "if" + "else" +] @keyword.control.conditional + +[ + "while" +] @keyword.control.repeat + +[ + "break" + "continue" + "return" +] @keyword.control.return + +[ + "contract" + "script" + "predicate" +] @keyword.other + +"use" @keyword.control.import +(dep_item "dep" @keyword.control.import !body) +(use_as_clause "as" @keyword.control.import) + +(type_cast_expression "as" @keyword.operator) + +[ + "as" + "pub" + "dep" + + "abi" + "impl" + "where" + "trait" + "for" +] @keyword + +[ + "struct" + "enum" + "storage" + "configurable" +] @keyword.storage.type + +"let" @keyword.storage +"fn" @keyword.function +"abi" @keyword.function + +(mutable_specifier) @keyword.storage.modifier.mut + +(reference_type "&" @keyword.storage.modifier.ref) +(self_parameter "&" @keyword.storage.modifier.ref) + +[ + "const" + "ref" + "deref" + "move" +] @keyword.storage.modifier + +; TODO: variable.mut to highlight mutable identifiers via locals.scm + +; ------- +; Guess Other Types +; ------- + +((identifier) @constant + (#match? @constant "^[A-Z][A-Z\\d_]*$")) + +; --- +; PascalCase identifiers in call_expressions (e.g. `Ok()`) +; are assumed to be enum constructors. +; --- + +(call_expression + function: [ + ((identifier) @type.enum.variant + (#match? @type.enum.variant "^[A-Z]")) + (scoped_identifier + name: ((identifier) @type.enum.variant + (#match? @type.enum.variant "^[A-Z]"))) + ]) + +; --- +; Assume that types in match arms are enums and not +; tuple structs. Same for `if let` expressions. +; --- + +(match_pattern + (scoped_identifier + name: (identifier) @constructor)) +(tuple_struct_pattern + type: [ + ((identifier) @constructor) + (scoped_identifier + name: (identifier) @constructor) + ]) +(struct_pattern + type: [ + ((type_identifier) @constructor) + (scoped_type_identifier + name: (type_identifier) @constructor) + ]) + +; --- +; Other PascalCase identifiers are assumed to be structs. +; --- + +((identifier) @type + (#match? @type "^[A-Z]")) + +; ------- +; Functions +; ------- + +(call_expression + function: [ + ((identifier) @function) + (scoped_identifier + name: (identifier) @function) + (field_expression + field: (field_identifier) @function) + ]) +(generic_function + function: [ + ((identifier) @function) + (scoped_identifier + name: (identifier) @function) + (field_expression + field: (field_identifier) @function.method) + ]) + +(function_item + name: (identifier) @function) + +(function_signature_item + name: (identifier) @function) + +; ------- +; Operators +; ------- + +[ + "*" + "'" + "->" + "=>" + "<=" + "=" + "==" + "!" + "!=" + "%" + "%=" + "&" + "&=" + "&&" + "|" + "|=" + "||" + "^" + "^=" + "*" + "*=" + "-" + "-=" + "+" + "+=" + "/" + "/=" + ">" + "<" + ">=" + ">>" + "<<" + ">>=" + "<<=" + "@" + ".." + "..=" + "'" +] @operator + +; ------- +; Paths +; ------- + +(use_declaration + argument: (identifier) @namespace) +(use_wildcard + (identifier) @namespace) +(dep_item + name: (identifier) @namespace) +(scoped_use_list + path: (identifier)? @namespace) +(use_list + (identifier) @namespace) +(use_as_clause + path: (identifier)? @namespace + alias: (identifier) @namespace) + +; --- +; Remaining Paths +; --- + +(scoped_identifier + path: (identifier)? @namespace + name: (identifier) @namespace) +(scoped_type_identifier + path: (identifier) @namespace) + +; ------- +; Remaining Identifiers +; ------- + +"?" @special + +(type_identifier) @type +(identifier) @variable +(field_identifier) @variable.other.member diff --git a/runtime/queries/sway/indents.scm b/runtime/queries/sway/indents.scm new file mode 100644 index 000000000000..e6902b62cb34 --- /dev/null +++ b/runtime/queries/sway/indents.scm @@ -0,0 +1,71 @@ +[ + (use_list) + (block) + (match_block) + (arguments) + (parameters) + (declaration_list) + (field_declaration_list) + (field_initializer_list) + (struct_pattern) + (tuple_pattern) + (unit_expression) + (enum_variant_list) + (call_expression) + (binary_expression) + (field_expression) + (tuple_expression) + (array_expression) + (where_clause) + + (token_tree) +] @indent + +[ + "}" + "]" + ")" +] @outdent + +; Indent the right side of assignments. +; The #not-same-line? predicate is required to prevent an extra indent for e.g. +; an else-clause where the previous if-clause starts on the same line as the assignment. +(assignment_expression + . + (_) @expr-start + right: (_) @indent + (#not-same-line? @indent @expr-start) + (#set! "scope" "all") +) +(compound_assignment_expr + . + (_) @expr-start + right: (_) @indent + (#not-same-line? @indent @expr-start) + (#set! "scope" "all") +) +(let_declaration + . + (_) @expr-start + value: (_) @indent + alternative: (_)? @indent + (#not-same-line? @indent @expr-start) + (#set! "scope" "all") +) +(if_expression + . + (_) @expr-start + condition: (_) @indent + (#not-same-line? @indent @expr-start) + (#set! "scope" "all") +) + +; Some field expressions where the left part is a multiline expression are not +; indented by cargo fmt. +; Because this multiline expression might be nested in an arbitrary number of +; field expressions, this can only be matched using a Regex. +(field_expression + value: (_) @val + "." @outdent + (#match? @val "(\\A[^\\n\\r]+\\([\\t ]*(\\n|\\r).*)|(\\A[^\\n\\r]*\\{[\\t ]*(\\n|\\r))") +) diff --git a/runtime/queries/sway/injections.scm b/runtime/queries/sway/injections.scm new file mode 100644 index 000000000000..e4509a5fd317 --- /dev/null +++ b/runtime/queries/sway/injections.scm @@ -0,0 +1,2 @@ +([(line_comment) (block_comment)] @injection.content + (#set! injection.language "comment")) diff --git a/runtime/queries/sway/locals.scm b/runtime/queries/sway/locals.scm new file mode 100644 index 000000000000..262d609e910c --- /dev/null +++ b/runtime/queries/sway/locals.scm @@ -0,0 +1,17 @@ +; Scopes + +[ + (function_item) + (closure_expression) + (block) +] @local.scope + +; Definitions + +(parameter + (identifier) @local.definition) + +(closure_parameters (identifier) @local.definition) + +; References +(identifier) @local.reference diff --git a/runtime/queries/sway/textobjects.scm b/runtime/queries/sway/textobjects.scm new file mode 100644 index 000000000000..15740bc8554b --- /dev/null +++ b/runtime/queries/sway/textobjects.scm @@ -0,0 +1,52 @@ +(function_item + body: (_) @function.inside) @function.around(closure_expression body: (_) @function.inside) @function.around + +(struct_item + body: (_) @class.inside) @class.around + +(enum_item + body: (_) @class.inside) @class.around + +(trait_item + body: (_) @class.inside) @class.around + +(impl_item + body: (_) @class.inside) @class.around + +(parameters + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(type_parameters + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(type_arguments + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(closure_parameters + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +(arguments + ((_) @parameter.inside . ","? @parameter.around) @parameter.around) + +[ + (line_comment) + (block_comment) +] @comment.inside + +(line_comment)+ @comment.around + +(block_comment) @comment.around + +(; #[test] + (attribute_item + (attribute + (identifier) @_test_attribute)) + ; allow other attributes like #[should_panic] and comments + [ + (attribute_item) + (line_comment) + ]* + ; the test function + (function_item + body: (_) @test.inside) @test.around + (#eq? @_test_attribute "test")) diff --git a/runtime/queries/uxntal/highlights.scm b/runtime/queries/uxntal/highlights.scm new file mode 100644 index 000000000000..a6ff18528eef --- /dev/null +++ b/runtime/queries/uxntal/highlights.scm @@ -0,0 +1,15 @@ +; highlights.scm + +(identifier) @keyword +(number) @constant.numeric +(comment) @comment +(raw_character) @constant.character +(literal_hex) @constant.numeric.integer +(macro_definition) @function +(label_definition) @label +(sub_label_definition) @label +(relative_pad) @constant +(label) @label +(sub_label) @label +(ERROR) @error +["[" "]" "{" "}"] @punctuation.bracket diff --git a/runtime/queries/yuck/highlights.scm b/runtime/queries/yuck/highlights.scm new file mode 100644 index 000000000000..483348a8c563 --- /dev/null +++ b/runtime/queries/yuck/highlights.scm @@ -0,0 +1,66 @@ +(ERROR) @error + +(line_comment) @comment + +; keywords and symbols + +(keyword) @keyword +(symbol) @tag + +; literals + +(bool_literal) @constant.builtin.boolean +(num_literal) @constant.numeric + +; strings +(string_interpolation + (string_interpolation_start) @punctuation.special + (string_interpolation_end) @punctuation.special) + +(escape_sequence) @constant.character.escape + +(string + [ + (unescaped_single_quote_string_fragment) + (unescaped_double_quote_string_fragment) + (unescaped_backtick_string_fragment) + "\"" + "'" + "`" + ]) @string + +; operators and general punctuation + +(unary_expression + operator: _ @operator) + +(binary_expression + operator: _ @operator) + +(ternary_expression + operator: _ @operator) + +[ + ":" + "." + "," +] @punctuation.delimiter + +[ + "(" + ")" + "[" + "]" + "{" + "}" +] @punctuation.bracket +[ + ":" + "." + "," +] @punctuation.delimiter + +; Rest (general identifiers that are not yet catched) + +(index) @variable +(ident) @variable diff --git a/runtime/queries/yuck/injections.scm b/runtime/queries/yuck/injections.scm new file mode 100644 index 000000000000..d3fdb0ca7178 --- /dev/null +++ b/runtime/queries/yuck/injections.scm @@ -0,0 +1,2 @@ +((line_comment) @injection.content + (#set! injection.language "comment")) diff --git a/runtime/themes/adwaita-dark.toml b/runtime/themes/adwaita-dark.toml new file mode 100644 index 000000000000..f339e33c1f13 --- /dev/null +++ b/runtime/themes/adwaita-dark.toml @@ -0,0 +1,169 @@ +# Author: Mofiqul Islam + +"attribute" = "orange_4" + +"type" = "teal_2" +"type.builtin" = "teal_2" + +"constructor" = "blue_2" + +"constant" = "violet_2" +"constant.builtin" = { fg = "violet_2", modifiers = ["bold"] } +"constant.character" = "teal_3" +"constant.numeric" = { fg = "teal_3", modifiers = ["bold"] } +"constant.character.escape" = "violet_2" + +"string" = "teal_2" +"string.regexp" = "purple_2" +"string.special" = "blue_2" + +"comment" = "dark_2" + +"variable" = "light_4" +"variable.parameter" = "orange_2" +"variable.builtin" = "orange_2" +"variable.other" = "teal_2" +"variable.other.member" = "teal_2" + +"label" = "purple_2" + +"punctuation" = "light_4" +"punctuation.delimiter" = "light_4" +"punctuation.bracket" = "light_4" +"punctuation.special" = "red_3" + +"keyword" = { fg = "orange_2", modifiers = ["bold"] } +"keyword.control" = { fg = "orange_2", modifiers = ["bold"] } +"keyword.operator" = "purple_2" +"keyword.directive" = { fg = "orange_2", modifiers = ["bold"] } +"keyword.function" = "orange_2" +"keyword.storage" = { fg = "orange_2", modifiers = ["bold"] } + +"operator" = "purple_2" + +"function" = "blue_2" +"function.builtin" = "blue_2" +"function.macro" = { fg = "blue_2", modifiers = ["bold"] } +"function.special" = { fg = "blue_2", modifiers = ["bold"] } + +"tag" = "teal_2" + +"namespace" = "orange_2" + +"markup" = "light_4" +"markup.heading" = { fg = "teal_2", modifiers = ["bold"] } +"markup.list" = { fg = "orange_2", modifiers = ["bold"] } +"markup.bold" = { fg = "light_4", modifiers = ["bold"] } +"markup.italic" = { fg = "light_4", modifiers = ["italic"] } +"markup.link" = { fg = "blue_3", modifiers = ["underlined"] } +"markup.quote" = { fg = "light_3", modifiers = ["italic"] } +"diff.plus" = "teal_3" +"diff.minus" = "red_1" +"diff.delta" = "orange_3" +"diff.delta.moved" = "orange_2" + +"ui.background" = { fg = "light_4", bg = "libadwaita_dark" } +"ui.background.separator" = { fg = "split_and_borders", bg = "libadwaita_dark" } +"ui.cursor" = { fg = "libadwaita_dark", bg = "light_5" } +"ui.cursor.insert" = { fg = "libadwaita_dark", bg = "light_5" } +"ui.cursor.select" = { fg = "libadwaita_dark", bg = "light_5" } +"ui.cursor.match" = { fg = "libadwaita_dark", bg = "blue_2" } +"ui.cursor.primary" = { fg = "libadwaita_dark", bg = "light_7" } +"ui.linenr" = "dark_2" +"ui.linenr.selected" = { fg = "light_7", bg = "libadwaita_dark_alt", modifiers = [ + "bold", +] } +"ui.statusline" = { fg = "light_4", bg = "libadwaita_dark_alt" } +"ui.statusline.inactive" = { fg = "light_4", bg = "libadwaita_dark_alt" } +"ui.statusline.insert" = { fg = "light_4", bg = "teal_4" } +"ui.statusline.select" = { fg = "light_4", bg = "blue_4" } +"ui.popup" = { bg = "libadwaita_popup" } +"ui.window" = "split_and_borders" +"ui.help" = { bg = "libadwaita_dark_alt" } +"ui.text" = "light_4" +"ui.virtual" = "dark_1" +"ui.menu" = { fg = "light_4", bg = "libadwaita_popup" } +"ui.menu.selected" = { fg = "light_4", bg = "blue_5" } +"ui.menu.scroll" = { fg = "light_7", bg = "dark_3" } +"ui.selection" = { bg = "blue_7" } +"ui.selection.primary" = { bg = "blue_7" } +"ui.cursorline.primary" = { bg = "libadwaita_dark_alt" } + +"warning" = "yellow_2" +"error" = "red_4" +"info" = "purple_2" +"hint" = "blue_2" + +"diagnostic.hint" = { fg = "blue_2", modifiers = ["dim"] } +"diagnostic.info" = { fg = "purple_2", modifiers = ["dim"] } +"diagnostic.error" = { fg = "red_4", modifiers = ["underlined"] } +"diagnostic.warning" = { fg = "yellow_2", modifiers = ["underlined"] } + +[palette] +blue_1 = "#99C1F1" +blue_2 = "#62A0EA" +blue_3 = "#3584E4" +blue_4 = "#1C71D8" +blue_5 = "#1A5FB4" +blue_6 = "#1B497E" +blue_7 = "#193D66" +brown_1 = "#CDAB8F" +brown_2 = "#B5835A" +brown_3 = "#986A44" +brown_4 = "#865E3C" +brown_5 = "#63452C" +chameleon_3 = "#4E9A06" +dark_1 = "#77767B" +dark_2 = "#5E5C64" +dark_3 = "#504E55" +dark_4 = "#3D3846" +dark_5 = "#241F31" +dark_6 = "#000000" +dark_7 = "#1c1c1c" +green_1 = "#8FF0A4" +green_2 = "#57E389" +green_3 = "#33D17A" +green_4 = "#2EC27E" +green_5 = "#26A269" +green_6 = "#1F7F56" +green_7 = "#1C6849" +libadwaita_dark = "#1D1D1D" +libadwaita_dark_alt = "#303030" +libadwaita_popup = "#282828" +light_1 = "#FFFFFF" +light_2 = "#FCFCFC" +light_3 = "#F6F5F4" +light_4 = "#DEDDDA" +light_5 = "#C0BFBC" +light_6 = "#B0AFAC" +light_7 = "#9A9996" +orange_1 = "#FFBE6F" +orange_2 = "#FFA348" +orange_3 = "#FF7800" +orange_4 = "#E66100" +orange_5 = "#C64600" +purple_1 = "#DC8ADD" +purple_2 = "#C061CB" +purple_3 = "#9141AC" +purple_4 = "#813D9C" +purple_5 = "#613583" +red_1 = "#F66151" +red_2 = "#ED333B" +red_3 = "#E01B24" +red_4 = "#C01C28" +red_5 = "#A51D2D" +teal_1 = "#93DDC2" +teal_2 = "#5BC8AF" +teal_3 = "#33B2A4" +teal_4 = "#26A1A2" +teal_5 = "#218787" +violet_2 = "#7D8AC7" +violet_3 = "#6362C8" +violet_4 = "#4E57BA" +yellow_1 = "#F9F06B" +yellow_2 = "#F8E45C" +yellow_3 = "#F6D32D" +yellow_4 = "#F5C211" +yellow_5 = "#E5A50A" +yellow_6 = "#D38B09" +split_and_borders = "#4F4F4F" diff --git a/runtime/themes/catppuccin_mocha.toml b/runtime/themes/catppuccin_mocha.toml index 2504fec87f63..59fa430f8eb0 100644 --- a/runtime/themes/catppuccin_mocha.toml +++ b/runtime/themes/catppuccin_mocha.toml @@ -103,10 +103,10 @@ "ui.menu" = { fg = "overlay2", bg = "surface0" } "ui.menu.selected" = { fg = "text", bg = "surface1", modifiers = ["bold"] } -"diagnostic.error" = { fg = "red", underline = { color = "red", style = "curl" } } -"diagnostic.warning" = { fg = "yellow", underline = { color = "yellow", style = "curl" } } -"diagnostic.info" = { fg = "sky", underline = { color = "sky", style = "curl" } } -"diagnostic.hint" = { fg = "teal", underline = { color = "teal", style = "curl" } } +"diagnostic.error" = { underline = { color = "red", style = "curl" } } +"diagnostic.warning" = { underline = { color = "yellow", style = "curl" } } +"diagnostic.info" = { underline = { color = "sky", style = "curl" } } +"diagnostic.hint" = { underline = { color = "teal", style = "curl" } } error = "red" warning = "yellow" diff --git a/runtime/themes/everblush.toml b/runtime/themes/everblush.toml new file mode 100644 index 000000000000..edcdaf41bd90 --- /dev/null +++ b/runtime/themes/everblush.toml @@ -0,0 +1,114 @@ +# Author: Isotoxal + +"attribute" = { fg = "blue" } +"comment" = { fg = "comment", modifiers = ["italic"] } +"constant" = { fg = "cyan" } +"constant.builtin.boolean" = { fg = "cyan" } +"constant.character" = { fg = "blue" } +"constant.numeric.float" = { fg = "black-light" } +"constant.builtin" = { fg = "blue" } +"constant.numeric" = { fg = "yellow" } +"constructor" = { fg = "blue" } +"function" = { fg = "red" } +"function.builtin" = { fg = "cyan-light" } +"function.macro" = { fg = "green" } +"function.method" = { fg = "blue-light" } +"keyword" = { fg = "blue" } +"keyword.function" = { fg = "blue" } +"keyword.operator" = { fg = "blue-light" } +"keyword.control.conditional" = { fg = "red" } +"keyword.control.import" = { fg = "red-light" } +"keyword.control.return" = { fg = "blue" } +"keyword.control.repeat" = { fg = "yellow-light" } +"keyword.control.exception" = { fg = "black-light" } +"label" = { fg = "blue" } +"namespace" = { fg = "red-light" } +"operator" = { fg = "white" } +#"parameter.reference" = { fg = "red-light" } +#"property" = { fg = "red" } +"punctuation.bracket" = { fg = "white" } +"punctuation.delimiter" = { fg = "white" } +"punctuation.special" = { fg = "white" } +"string" = { fg = "green" } +"string.escape" = { fg = "blue" } +"string.regex" = { fg = "green" } +"string.special" = { fg = "blue" } +"string.special.symbol" = { fg = "red" } +"tag" = { fg = "blue" } +"type" = { fg = "yellow" } +"type.builtin" = { fg = "yellow" } +"variable" = { fg = "white" } +"variable.builtin" = { fg = "blue" } +"variable.parameter" = { fg = "red" } +"variable.other.member" = { fg = "red" } + +"diff.plus" = { fg = "blue" } +"diff.delta" = { fg = "magenta" } +"diff.minus" = { fg = "red" } + +"ui.background" = { fg = "foreground", bg = "background" } +"ui.cursor" = { modifiers = ["reversed"] } +"ui.cursorline.primary" = { bg = "cursorline" } +"ui.help" = { fg = "foreground", bg = "contrast" } +"ui.linenr" = { fg = "comment" } +"ui.linenr.selected" = { fg = "foreground" } +"ui.menu" = { fg = "foreground", bg = "contrast" } +"ui.menu.selected" = { bg = "black" } +"ui.popup" = { fg = "foreground", bg = "contrast" } +"ui.selection" = { bg = "black" } +"ui.selection.primary" = { bg = "black" } +"ui.statusline" = { fg = "foreground", bg = "background" } +"ui.statusline.inactive" = { fg = "foreground", bg = "background" } +"ui.statusline.normal" = { fg = "white", bg = "background" } +"ui.statusline.insert" = { fg = "blue", bg = "background" } +"ui.statusline.select" = { fg = "cyan", bg = "magenta" } +"ui.text" = { fg = "foreground" } +"ui.text.focus" = { fg = "blue" } +"ui.virtual.ruler" = { bg = "cursorline" } +"ui.virtual.whitespace" = { fg = "comment" } +"ui.virtual.wrap" = { fg = "comment" } +"ui.virtual.indent-guide" = { fg = "comment" } +"ui.window" = { fg = "black" } + +"error" = { fg = "red" } +"hint" = { fg = "green" } +"warning" = { fg = "yellow" } +"info" = { fg = "blue" } +"diagnostic.error" = { underline = { style = "curl", color = "red" } } +"diagnostic.warning" = { underline = { style = "curl", color = "yellow" } } +"diagnostic.info" = { underline = { style = "curl", color = "blue" } } +"diagnostic.hint" = { underline = { style = "curl", color = "green" } } +"special" = { fg = "red-light" } + +"markup.heading" = { fg = "blue", modifiers = ["bold"] } +"markup.list" = { fg = "cyan" } +"markup.bold" = { fg = "magenta", modifiers = ["bold"] } +"markup.italic" = { fg = "yellow", modifiers = ["italic"] } +"markup.strikethrough" = { modifiers = ["crossed_out"] } +"markup.link.url" = { fg = "green" } +"markup.link.text" = { fg = "black-light" } +"markup.quote" = { fg = "yellow", modifiers = ["italic"] } +"markup.raw" = { fg = "cyan" } + +[palette] +black = "#232a2d" +red = "#e57474" +green = "#8ccf7e" +yellow = "#e5c76b" +blue = "#67b0e8" +magenta = "#c47fd5" +cyan = "#6cbfbf" +white = "#b3b9b8" +black-light = "#2d3437" +red-light = "#ef7e7e" +green-light = "#96d988" +yellow-light = "#f4d67a" +blue-light = "#71baf2" +magenta-light = "#ce89df" +cyan-light = "#67cbe7" +white-light = "#bdc3c2" +comment = "#404749" +contrast = "#161d1f" +background = "#141b1e" +foreground = "#dadada" +cursorline = "#2c3333" diff --git a/runtime/themes/kanagawa.toml b/runtime/themes/kanagawa.toml index 16e27362f918..a7d33f3ee5b8 100644 --- a/runtime/themes/kanagawa.toml +++ b/runtime/themes/kanagawa.toml @@ -14,9 +14,8 @@ "ui.linenr" = { fg = "sumiInk4" } "ui.linenr.selected" = { fg = "roninYellow" } +"ui.virtual" = "sumiInk4" "ui.virtual.ruler" = { bg = "sumiInk2" } -"ui.virtual.whitespace" = "waveBlue1" -"ui.virtual.indent-guide" = "sumiInk4" "ui.statusline" = { fg = "oldWhite", bg = "sumiInk0" } "ui.statusline.inactive" = { fg = "fujiGray", bg = "sumiInk0" } @@ -24,8 +23,9 @@ "ui.statusline.insert" = { fg = "sumiInk0", bg = "autumnGreen", modifiers = ["bold"] } "ui.statusline.select" = { fg = "sumiInk0", bg = "oniViolet", modifiers = ["bold"] } -"ui.bufferline" = { fg = "oldWhite", bg = "sumiInk0" } -"ui.bufferline.inactive" = { fg = "fujiGray", bg = "sumiInk0" } +"ui.bufferline" = { fg = "fujiGray", bg = "sumiInk0" } +"ui.bufferline.active" = { fg = "oldWhite", bg = "sumiInk0" } +"ui.bufferline.background" = { bg = "sumiInk0" } "ui.popup" = { fg = "fujiWhite", bg = "sumiInk0" } "ui.window" = { fg = "sumiInk0" } @@ -33,14 +33,16 @@ "ui.text" = "fujiWhite" "ui.text.focus" = { fg = "fujiWhite", bg = "waveBlue1", modifiers = ["bold"] } -"ui.cursor" = { fg = "waveBlue1", bg = "fujiWhite"} -"ui.cursor.primary" = { fg = "waveBlue1", bg = "seaFoam" } -"ui.cursor.match" = { fg = "seaFoam", modifiers = ["bold"] } +"ui.cursor" = { fg = "waveBlue1", bg = "waveAqua2"} +"ui.cursor.primary" = { fg = "waveBlue1", bg = "fujiWhite" } +"ui.cursor.match" = { fg = "waveRed", modifiers = ["bold"] } "ui.highlight" = { fg = "fujiWhite", bg = "waveBlue2" } -"ui.menu" = { fg = "fujiWhite", bg = "sumiInk0" } -"ui.menu.selected" = { fg = "fujiWhite", bg = "waveBlue1", modifiers = ["bold"] } +"ui.menu" = { fg = "fujiWhite", bg = "waveBlue1" } +"ui.menu.selected" = { fg = "fujiWhite", bg = "waveBlue2", modifiers = ["bold"] } +"ui.menu.scroll" = { fg = "oldWhite", bg = "waveBlue1" } "ui.cursorline.primary" = { bg = "sumiInk3"} +"ui.cursorcolumn.primary" = { bg = "sumiInk3" } "diagnostic.error" = { underline = { color = "samuraiRed", style = "curl" } } "diagnostic.warning" = { underline = { color = "roninYellow", style = "curl" } } @@ -58,12 +60,16 @@ hint = "dragonBlue" "diff.delta" = "autumnYellow" ## Syntax highlighting +"attribute" = "waveRed" "type" = "waveAqua2" +"constructor" = "springBlue" "constant" = "surimiOrange" "constant.numeric" = "sakuraPink" "constant.character.escape" = "springBlue" "string" = "springGreen" "string.regexp" = "boatYellow2" +"string.special.url" = "springBlue" +"string.special.symbol" = "oniViolet" "comment" = "fujiGray" "variable" = "fujiWhite" "variable.builtin" = "waveRed" @@ -71,37 +77,36 @@ hint = "dragonBlue" "variable.other.member" = "carpYellow" "label" = "springBlue" "punctuation" = "springViolet2" -"punctuation.delimiter" = "springViolet2" -"punctuation.bracket" = "springViolet2" "keyword" = "oniViolet" +"keyword.control.return" = "peachRed" +"keyword.control.exception" = "peachRed" "keyword.directive" = "peachRed" "operator" = "boatYellow2" "function" = "crystalBlue" -"function.builtin" = "peachRed" +"function.builtin" = "springBlue" "function.macro" = "waveRed" -"tag" = "springBlue" +"tag" = "waveAqua2" "namespace" = "surimiOrange" -"attribute" = "peachRed" -"constructor" = "springBlue" -"module" = "waveAqua2" "special" = "peachRed" ## Markup modifiers -"markup.heading.marker" = "fujiGray" +"markup.heading.marker" = "springViolet2" "markup.heading.1" = { fg = "surimiOrange", modifiers = ["bold"] } "markup.heading.2" = { fg = "carpYellow", modifiers = ["bold"] } "markup.heading.3" = { fg = "waveAqua2", modifiers = ["bold"] } -"markup.heading.4" = { fg = "springGreen", modifiers = ["bold"] } -"markup.heading.5" = { fg = "waveRed", modifiers = ["bold"] } -"markup.heading.6" = { fg = "autumnRed", modifiers = ["bold"] } -"markup.list" = "oniViolet" +"markup.heading.4" = { fg = "lightBlue", modifiers = ["bold"] } +"markup.heading.5" = { fg = "oniViolet", modifiers = ["bold"] } +"markup.heading.6" = { fg = "springViolet1", modifiers = ["bold"] } +"markup.list.numbered" = "sakuraPink" +"markup.list.unnumbered" = "waveRed" "markup.bold" = { modifiers = ["bold"] } "markup.italic" = { modifiers = ["italic"] } "markup.strikethrough" = { modifiers = ["crossed_out"] } -"markup.link.url" = { fg = "springBlue", modifiers = ["underlined"] } "markup.link.text" = "crystalBlue" -"markup.quote" = "seaFoam" -"markup.raw" = "seaFoam" +"markup.link.url" = { fg = "springBlue", underline.style = "line" } +"markup.link.label" = "surimiOrange" +"markup.quote" = "springViolet1" +"markup.raw" = "springGreen" [palette] seaFoam = "#C7CCD1" # custom lighter foreground diff --git a/runtime/themes/papercolor-dark.toml b/runtime/themes/papercolor-dark.toml index 088658e9ebb3..eaaa36dcf52c 100644 --- a/runtime/themes/papercolor-dark.toml +++ b/runtime/themes/papercolor-dark.toml @@ -7,6 +7,7 @@ "ui.text.focus" = { fg = "selection_background", modifiers = ["bold"]} "ui.selection" = {bg="selection_background", fg="selection_foreground"} "ui.cursorline" = {bg="cursorline_background"} +"ui.highlight" = {bg="cursorline_background"} "ui.statusline" = {bg="paper_bar_bg", fg="regular0"} "ui.statusline.select" = {bg="background", fg="bright7"} "ui.statusline.normal" = {bg="background", fg="bright3"} diff --git a/runtime/themes/papercolor-light.toml b/runtime/themes/papercolor-light.toml index c44c670914a0..63671e1b3ff7 100644 --- a/runtime/themes/papercolor-light.toml +++ b/runtime/themes/papercolor-light.toml @@ -6,6 +6,7 @@ "ui.text" = "foreground" "ui.text.focus" = { fg = "selection_background", modifiers = ["bold"]} "ui.selection" = {bg="selection_background", fg="selection_foreground"} +"ui.highlight" = {bg="cursorline_background"} "ui.cursorline" = {bg="cursorline_background"} "ui.statusline" = {bg="paper_bar_bg", fg="regular0"} "ui.statusline.select" = {bg="background", fg="bright7"} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index ace4f5f96e55..2abc5665236b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.63.0" +channel = "1.65.0" components = ["rustfmt", "rust-src"]