overlookmotel
ac05134a6d
refactor(allocator): String type ( #8568 )
...
Wrap `bumpalo::collections::String` in a new type instead of exporting it directly. This opens the door to:
1. Replacing it with our own `String` type which wraps our `Vec` type, rather than having 2 different implementations of `Vec` (`String` is just a wrapper around `Vec`, but a *different* `Vec` implementation).
2. Adding additional methods to `String` (`String::from_utf8` added in this PR).
2025-01-18 01:23:54 +00:00
Yuji Sugiura
64d38b86b6
refactor(prettier): Verify printing class related nodes ( #8559 )
...
Part of #5068
2025-01-17 13:46:07 +08:00
Yuji Sugiura
a93e27aca0
refactor(prettier): Verify current implementation with refactoring ( #8412 )
...
Part of #5068
I think I will be able to grasp the current implementation status after
a few more iterations... 🏃🏻
2025-01-10 17:31:33 +08:00
renovate
772b71c838
chore(deps): update dependency rust to v1.84.0 ( #8391 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.83.0` -> `1.84.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.84.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1840-2025-01-09 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.83.0...1.84.0 )
\==========================
<a id="
Language"></a>
## Language
- [Allow `#[deny]` inside `#[forbid]` as a no-op](https://redirect.github.com/rust-lang/rust/pull/121560/ )
- [Show a warning when `-Ctarget-feature` is used to toggle features that can lead to unsoundness due to ABI mismatches](https://redirect.github.com/rust-lang/rust/pull/129884 )
- [Use the next-generation trait solver in coherence](https://redirect.github.com/rust-lang/rust/pull/130654 )
- [Allow coercions to drop the principal of trait objects](https://redirect.github.com/rust-lang/rust/pull/131857 )
- [Support `/` as the path separator for `include!()` in all cases on Windows](https://redirect.github.com/rust-lang/rust/pull/125205 )
- [Taking a raw ref (`raw (const|mut)`) of a deref of a pointer (`*ptr`) is now safe](https://redirect.github.com/rust-lang/rust/pull/129248 )
- [Stabilize s390x inline assembly](https://redirect.github.com/rust-lang/rust/pull/131258 )
- [Stabilize Arm64EC inline assembly](https://redirect.github.com/rust-lang/rust/pull/131781 )
- [Lint against creating pointers to immediately dropped temporaries](https://redirect.github.com/rust-lang/rust/pull/128985 )
- [Execute drop glue when unwinding in an `extern "C"` function](https://redirect.github.com/rust-lang/rust/pull/129582 )
<a id="1.84.0-Compiler"></a>
## Compiler
- [Add `--print host-tuple` flag to print the host target tuple and affirm the "target tuple" terminology over "target triple"](https://redirect.github.com/rust-lang/rust/pull/125579 )
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://redirect.github.com/rust-lang/rust/pull/129935 )
- [Set up indirect access to external data for `loongarch64-unknown-linux-{musl,ohos}`](https://redirect.github.com/rust-lang/rust/pull/131583 )
- [Enable XRay instrumentation for LoongArch Linux targets](https://redirect.github.com/rust-lang/rust/pull/131818 )
- [Extend the `unexpected_cfgs` lint to also warn in external macros](https://redirect.github.com/rust-lang/rust/pull/132577 )
- [Stabilize WebAssembly `multivalue`, `reference-types`, and `tail-call` target features](https://redirect.github.com/rust-lang/rust/pull/131080 )
- [Added Tier 2 support for the `wasm32v1-none` target](https://redirect.github.com/rust-lang/rust/pull/131487 )
<a id="1.84.0-Libraries"></a>
## Libraries
- [Implement `From<&mut {slice}>` for `Box/Rc/Arc<{slice}>`](https://redirect.github.com/rust-lang/rust/pull/129329 )
- [Move `<float>::copysign`, `<float>::abs`, `<float>::signum` to `core`](https://redirect.github.com/rust-lang/rust/pull/131304 )
- [Add `LowerExp` and `UpperExp` implementations to `NonZero`](https://redirect.github.com/rust-lang/rust/pull/131377 )
- [Implement `FromStr` for `CString` and `TryFrom<CString>` for `String`](https://redirect.github.com/rust-lang/rust/pull/130608 )
- [`std::os::darwin` has been made public](https://redirect.github.com/rust-lang/rust/pull/123723 )
<a id="1.84.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`Ipv6Addr::is_unique_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unique_local )
- [`Ipv6Addr::is_unicast_link_local`](https://doc.rust-lang.org/stable/core/net/struct.Ipv6Addr.html#method.is_unicast_link_local )
- [`core::ptr::with_exposed_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance.html )
- [`core::ptr::with_exposed_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.with_exposed_provenance_mut.html )
- [`<ptr>::addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.addr )
- [`<ptr>::expose_provenance`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.expose_provenance )
- [`<ptr>::with_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.with_addr )
- [`<ptr>::map_addr`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.map_addr )
- [`<int>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.isqrt )
- [`<int>::checked_isqrt`](https://doc.rust-lang.org/stable/core/primitive.i32.html#method.checked_isqrt )
- [`<uint>::isqrt`](https://doc.rust-lang.org/stable/core/primitive.u32.html#method.isqrt )
- [`NonZero::isqrt`](https://doc.rust-lang.org/stable/core/num/struct.NonZero.html#impl-NonZero%3Cu128%3E/method.isqrt )
- [`core::ptr::without_provenance`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance.html )
- [`core::ptr::without_provenance_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.without_provenance_mut.html )
- [`core::ptr::dangling`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling.html )
- [`core::ptr::dangling_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.dangling_mut.html )
These APIs are now stable in const contexts
- [`AtomicBool::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicBool.html#method.from_ptr )
- [`AtomicPtr::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicPtr.html#method.from_ptr )
- [`AtomicU8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU8.html#method.from_ptr )
- [`AtomicU16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU16.html#method.from_ptr )
- [`AtomicU32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU32.html#method.from_ptr )
- [`AtomicU64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicU64.html#method.from_ptr )
- [`AtomicUsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicUsize.html#method.from_ptr )
- [`AtomicI8::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI8.html#method.from_ptr )
- [`AtomicI16::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI16.html#method.from_ptr )
- [`AtomicI32::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI32.html#method.from_ptr )
- [`AtomicI64::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicI64.html#method.from_ptr )
- [`AtomicIsize::from_ptr`](https://doc.rust-lang.org/stable/core/sync/atomic/struct.AtomicIsize.html#method.from_ptr )
- [`<ptr>::is_null`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.is_null-1 )
- [`<ptr>::as_ref`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_ref-1 )
- [`<ptr>::as_mut`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.as_mut )
- [`Pin::new`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new )
- [`Pin::new_unchecked`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.new_unchecked )
- [`Pin::get_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_ref )
- [`Pin::into_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.into_ref )
- [`Pin::get_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_mut )
- [`Pin::get_unchecked_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.get_unchecked_mut )
- [`Pin::static_ref`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_ref )
- [`Pin::static_mut`](https://doc.rust-lang.org/stable/core/pin/struct.Pin.html#method.static_mut )
<a id="1.84.0-Cargo"></a>
## Cargo
- [Stabilize MSRV-aware resolver config](https://redirect.github.com/rust-lang/cargo/pull/14639/ )
- [Stabilize resolver v3](https://redirect.github.com/rust-lang/cargo/pull/14754/ )
<a id="1.84-Rustdoc"></a>
## Rustdoc
- [rustdoc-search: improve type-driven search](https://redirect.github.com/rust-lang/rust/pull/127589 )
<a id="1.84.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Enable by default the `LSX` target feature for LoongArch Linux targets](https://redirect.github.com/rust-lang/rust/pull/132140 )
- [The unstable `-Zprofile` flag (“gcov-style” coverage instrumentation) has been removed.](https://redirect.github.com/rust-lang/rust/pull/131829 ) This does not affect the stable flags for coverage instrumentation (`-Cinstrument-coverage`) and profile-guided optimization (`-Cprofile-generate`, `-Cprofile-use`), which are unrelated and remain available.
- Support for the target named `wasm32-wasi` has been removed as the target is now named `wasm32-wasip1`. This completes the [transition](https://redirect.github.com/rust-lang/compiler-team/issues/607 ) [plan](https://redirect.github.com/rust-lang/compiler-team/issues/695 ) for this target following [the introduction of `wasm32-wasip1`](https://redirect.github.com/rust-lang/rust/pull/120468 ) in Rust 1.78. Compiler warnings on [use of `wasm32-wasi`](https://redirect.github.com/rust-lang/rust/pull/126662 ) introduced in Rust 1.81 are now gone as well as the target is removed.
- [The syntax `&pin (mut|const) T` is now parsed as a type which in theory could affect macro expansion results in some edge cases](https://redirect.github.com/rust-lang/rust/pull/130635#issuecomment-2375462821 )
- [Legacy syntax for calling `std::arch` functions is no longer permitted to declare items or bodies (such as closures, inline consts, or async blocks).](https://redirect.github.com/rust-lang/rust/pull/130443#issuecomment-2445678945 )
- The `wasm32-unknown-emscripten` target's binary release of the standard library is now [built with the latest emsdk 3.1.68](https://redirect.github.com/rust-lang/rust/pull/131533 ), which fixes an ABI-incompatibility with Emscripten >= 3.1.42. If you are locally using a version of emsdk with an incompatible ABI (e.g. before 3.1.42 or a future one), you should build your code with `-Zbuild-std` to ensure that `std` uses the correct ABI.
- [Declaring functions with a calling convention not supported on the current target now triggers a hard error](https://redirect.github.com/rust-lang/rust/pull/129935 )
- [The next-generation trait solver is now enabled for coherence, fixing multiple soundness issues](https://redirect.github.com/rust-lang/rust/pull/130654 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - "before 11am on monday" in timezone Asia/Shanghai.
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS45Mi4wIiwidXBkYXRlZEluVmVyIjoiMzkuOTIuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-01-09 18:11:17 +00:00
Yuji Sugiura
c1c0d71162
refactor(prettier): Make hardline! to return Doc ( #8379 )
...
For cleaner Doc construction.
2025-01-09 14:48:52 +08:00
Yuji Sugiura
8e3eed7562
refactor(prettier): Update tasks/prettier to correctly handle snapshots ( #8337 )
...
I refactored the code in `tasks/prettier_conformance` primarily to make
the output more readable when using `--filter`.
But I also discovered that our previous implementation did not correctly
handle Prettier's behavior of adding a blank line at the EOF.
In addition, I resolved a problem where test specs that used patterns
like `runFormatTest(_, parsers)` were unable to locate the correct
snapshot output.
As a result, compatibility has also improved slightly. 😉
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-08 17:10:30 +08:00
Yuji Sugiura
30cee0e47e
feat(prettier): Print tagged template literal ( #8307 )
...
Part of #5068
First steps for template literals... 🗻
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-07 14:25:14 +08:00
Yuji Sugiura
0ae2ba4316
refactor(prettier): Refactor printing statements ( #8269 )
...
Part of #5068
Just for verifying.
Almost all changes are cosmetic, do not affect compatibility.
---
(Happy new year! 🎍 )
2025-01-06 15:59:41 +08:00
Yuji Sugiura
922670e4b7
feat(prettier): Print directive ( #8066 )
...
Part of #5068
- [x] Directive
2024-12-23 14:46:47 +08:00
Yuji Sugiura
a4e8ce8fe5
feat(prettier): Complete print_literal ( #7952 )
...
Part of #5068
- [x] RegExpLiteral
- [x] BigIntLiteral
- [x] NumericLiteral
- [x] StringLiteral
- [x] replaceEndOfLine
- [x] makeString keep usless escape
- [x] NullLiteral
- [x] BooleanLiteral
2024-12-17 12:02:22 +08:00
overlookmotel
3858221f45
refactor(global): sort imports ( #7883 )
...
Pure refactor. Re-order imports for clarity:
1. `std`
2. External crates
3. `oxc_*` crates
4. Current crate `use crate::...`
5. Super `use super::...`
6. Local modules
This order is from "furthest away" to "closest". This makes it clearer to see what is coming from where.
`cargo +nightly fmt` (#7877 ) did a lot of the work, but unfortunately `rustfmt` does not have an option to (a) put workspace crates in a separate block from external crates and (b) move `mod` statements to after `use` statements.
2024-12-14 15:07:21 +00:00
Boshen
7fb9d47460
style(rust): cargo +nightly fmt ( #7877 )
2024-12-14 06:03:31 +00:00
Yuji Sugiura
40334ba66e
refactor(prettier): Align exported function names to Prettier ( #7827 )
...
Some refactoring works to update
https://github.com/oxc-project/oxc/issues/5068#issuecomment-2507272735
table.
- Implement `array::is_consisely_printed_array()` and use it
- This improved compat-rate a bit ✌🏻
- Align exported function names to align prettier's
- Split `format/mod.rs` into `js`, `jsx` and `typescript`
- Move `format/*.rs` to `format/print/*.rs`
2024-12-13 17:06:15 +08:00
Song Gao
ebc80f6749
refactor(ast)!: change 'raw' from &str to Option<Atom> ( #7547 )
...
Fix #7254
Changed all "raw" properties of literal types (if they have this property) to `Option<Atom>`.
---------
Co-authored-by: overlookmotel <theoverlookmotel@gmail.com>
2024-12-05 00:34:45 +00:00
Yuji Sugiura
0ce7ce7ff4
refactor(prettier): Revive doc macro ( #7639 )
...
As @Boshen advised, reintroduced the macro.
https://github.com/oxc-project/oxc/pull/7639/files#diff-18e08d6e3a6853a2ae1a973ab1615ee04ed585638eef92c8c1e49f7814f6193f
It feels addictive...! 🤩
2024-12-04 16:58:00 +08:00
Yuji Sugiura
521df425de
refactor(prettier): Unified method of Doc generation ( #7600 )
...
Before:
- `Doc::Xxx()` + `XXX.with_xxx()`
- `macro!()`
- `p.xxx()`
After:
- `p.xxx()` with `p_vec!` macro
2024-12-03 17:27:55 +08:00
renovate
d0842e070a
chore(deps): update dependency rust to v1.83.0 ( #7537 )
...
This PR contains the following updates:
| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust ) | minor | `1.82.0` -> `1.83.0` |
---
### Release Notes
<details>
<summary>rust-lang/rust (rust)</summary>
### [`v1.83.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1830-2024-11-28 )
[Compare Source](https://redirect.github.com/rust-lang/rust/compare/1.82.0...1.83.0 )
\==========================
<a id="1.83.0-Language"></a>
## Language
- [Stabilize `&mut`, `*mut`, `&Cell`, and `*const Cell` in const.](https://redirect.github.com/rust-lang/rust/pull/129195 )
- [Allow creating references to statics in `const` initializers.](https://redirect.github.com/rust-lang/rust/pull/129759 )
- [Implement raw lifetimes and labels (`'r#ident`).](https://redirect.github.com/rust-lang/rust/pull/126452 )
- [Define behavior when atomic and non-atomic reads race.](https://redirect.github.com/rust-lang/rust/pull/128778 )
- [Non-exhaustive structs may now be empty.](https://redirect.github.com/rust-lang/rust/pull/128934 )
- [Disallow implicit coercions from places of type `!`](https://redirect.github.com/rust-lang/rust/pull/129392 )
- [`const extern` functions can now be defined for other calling conventions.](https://redirect.github.com/rust-lang/rust/pull/129753 )
- [Stabilize `expr_2021` macro fragment specifier in all editions.](https://redirect.github.com/rust-lang/rust/pull/129972 )
- [The `non_local_definitions` lint now fires on less code and warns by default.](https://redirect.github.com/rust-lang/rust/pull/127117 )
<a id="1.83.0-Compiler"></a>
## Compiler
- [Deprecate unsound `-Csoft-float` flag.](https://redirect.github.com/rust-lang/rust/pull/129897 )
- Add many new tier 3 targets:
- [`aarch64_unknown_nto_qnx700`](https://redirect.github.com/rust-lang/rust/pull/127897 )
- [`arm64e-apple-tvos`](https://redirect.github.com/rust-lang/rust/pull/130614 )
- [`armv7-rtems-eabihf`](https://redirect.github.com/rust-lang/rust/pull/127021 )
- [`loongarch64-unknown-linux-ohos`](https://redirect.github.com/rust-lang/rust/pull/130750 )
- [`riscv32-wrs-vxworks` and `riscv64-wrs-vxworks`](https://redirect.github.com/rust-lang/rust/pull/130549 )
- [`riscv32{e|em|emc}-unknown-none-elf`](https://redirect.github.com/rust-lang/rust/pull/130555 )
- [`x86_64-unknown-hurd-gnu`](https://redirect.github.com/rust-lang/rust/pull/128345 )
- [`x86_64-unknown-trusty`](https://redirect.github.com/rust-lang/rust/pull/130453 )
Refer to Rust's \[platform support page]\[platform-support-doc]
for more information on Rust's tiered platform support.
<a id="1.83.0-Libraries"></a>
## Libraries
- [Implement `PartialEq` for `ExitCode`.](https://redirect.github.com/rust-lang/rust/pull/127633 )
- [Document that `catch_unwind` can deal with foreign exceptions without UB, although the exact behavior is unspecified.](https://redirect.github.com/rust-lang/rust/pull/128321 )
- [Implement `Default` for `HashMap`/`HashSet` iterators that don't already have it.](https://redirect.github.com/rust-lang/rust/pull/128711 )
- [Bump Unicode to version 16.0.0.](https://redirect.github.com/rust-lang/rust/pull/130183 )
- [Change documentation of `ptr::add`/`sub` to not claim equivalence with `offset`.](https://redirect.github.com/rust-lang/rust/pull/130229 ).
<a id="1.83.0-Stabilized-APIs"></a>
## Stabilized APIs
- [`BufRead::skip_until`](https://doc.rust-lang.org/stable/std/io/trait.BufRead.html#method.skip_until )
- [`ControlFlow::break_value`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.break_value )
- [`ControlFlow::continue_value`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.continue_value )
- [`ControlFlow::map_break`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.map_break )
- [`ControlFlow::map_continue`](https://doc.rust-lang.org/stable/core/ops/enum.ControlFlow.html#method.map_continue )
- [`DebugList::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugList.html#method.finish_non_exhaustive )
- [`DebugMap::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugMap.html#method.finish_non_exhaustive )
- [`DebugSet::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugSet.html#method.finish_non_exhaustive )
- [`DebugTuple::finish_non_exhaustive`](https://doc.rust-lang.org/stable/core/fmt/struct.DebugTuple.html#method.finish_non_exhaustive )
- [`ErrorKind::ArgumentListTooLong`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ArgumentListTooLong )
- [`ErrorKind::Deadlock`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.Deadlock )
- [`ErrorKind::DirectoryNotEmpty`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.DirectoryNotEmpty )
- [`ErrorKind::ExecutableFileBusy`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ExecutableFileBusy )
- [`ErrorKind::FileTooLarge`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.FileTooLarge )
- [`ErrorKind::HostUnreachable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.HostUnreachable )
- [`ErrorKind::IsADirectory`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.IsADirectory )
- [`ErrorKind::NetworkDown`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NetworkDown )
- [`ErrorKind::NetworkUnreachable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NetworkUnreachable )
- [`ErrorKind::NotADirectory`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NotADirectory )
- [`ErrorKind::NotSeekable`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.NotSeekable )
- [`ErrorKind::ReadOnlyFilesystem`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ReadOnlyFilesystem )
- [`ErrorKind::ResourceBusy`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.ResourceBusy )
- [`ErrorKind::StaleNetworkFileHandle`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.StaleNetworkFileHandle )
- [`ErrorKind::StorageFull`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.StorageFull )
- [`ErrorKind::TooManyLinks`](https://doc.rust-lang.org/stable/std/io/enum.ErrorKind.html#variant.TooManyLinks )
- [`Option::get_or_insert_default`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.get_or_insert_default )
- [`Waker::data`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.data )
- [`Waker::new`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.new )
- [`Waker::vtable`](https://doc.rust-lang.org/stable/core/task/struct.Waker.html#method.vtable )
- [`char::MIN`](https://doc.rust-lang.org/stable/core/primitive.char.html#associatedconstant.MIN )
- [`hash_map::Entry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/hash_map/enum.Entry.html#method.insert_entry )
- [`hash_map::VacantEntry::insert_entry`](https://doc.rust-lang.org/stable/std/collections/hash_map/struct.VacantEntry.html#method.insert_entry )
These APIs are now stable in const contexts:
- [`Cell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.Cell.html#method.into_inner )
- [`Duration::as_secs_f32`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.as_secs_f32 )
- [`Duration::as_secs_f64`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.as_secs_f64 )
- [`Duration::div_duration_f32`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.div_duration_f32 )
- [`Duration::div_duration_f64`](https://doc.rust-lang.org/stable/core/time/struct.Duration.html#method.div_duration_f64 )
- [`MaybeUninit::as_mut_ptr`](https://doc.rust-lang.org/stable/core/mem/union.MaybeUninit.html#method.as_mut_ptr )
- [`NonNull::as_mut`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.as_mut )
- [`NonNull::copy_from`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_from )
- [`NonNull::copy_from_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_from_nonoverlapping )
- [`NonNull::copy_to`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_to )
- [`NonNull::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.copy_to_nonoverlapping )
- [`NonNull::slice_from_raw_parts`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.slice_from_raw_parts )
- [`NonNull::write`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write )
- [`NonNull::write_bytes`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write_bytes )
- [`NonNull::write_unaligned`](https://doc.rust-lang.org/stable/core/ptr/struct.NonNull.html#method.write_unaligned )
- [`OnceCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.OnceCell.html#method.into_inner )
- [`Option::as_mut`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.as_mut )
- [`Option::expect`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.expect )
- [`Option::replace`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.replace )
- [`Option::take`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.take )
- [`Option::unwrap`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.unwrap )
- [`Option::unwrap_unchecked`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.unwrap_unchecked )
- [`Option::<&_>::copied`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.copied )
- [`Option::<&mut _>::copied`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.copied-1 )
- [`Option::<Option<_>>::flatten`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.flatten )
- [`Option::<Result<_, _>>::transpose`](https://doc.rust-lang.org/stable/core/option/enum.Option.html#method.transpose )
- [`RefCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.RefCell.html#method.into_inner )
- [`Result::as_mut`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.as_mut )
- [`Result::<&_, _>::copied`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.copied )
- [`Result::<&mut _, _>::copied`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.copied-1 )
- [`Result::<Option<_>, _>::transpose`](https://doc.rust-lang.org/stable/core/result/enum.Result.html#method.transpose )
- [`UnsafeCell::get_mut`](https://doc.rust-lang.org/stable/core/cell/struct.UnsafeCell.html#method.get_mut )
- [`UnsafeCell::into_inner`](https://doc.rust-lang.org/stable/core/cell/struct.UnsafeCell.html#method.into_inner )
- [`array::from_mut`](https://doc.rust-lang.org/stable/core/array/fn.from_mut.html )
- [`char::encode_utf8`](https://doc.rust-lang.org/stable/core/primitive.char.html#method.encode_utf8 )
- [`{float}::classify`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.classify )
- [`{float}::is_finite`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_finite )
- [`{float}::is_infinite`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_infinite )
- [`{float}::is_nan`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_nan )
- [`{float}::is_normal`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_normal )
- [`{float}::is_sign_negative`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_sign_negative )
- [`{float}::is_sign_positive`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_sign_positive )
- [`{float}::is_subnormal`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.is_subnormal )
- [`{float}::from_bits`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_bits )
- [`{float}::from_be_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_be_bytes )
- [`{float}::from_le_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_le_bytes )
- [`{float}::from_ne_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.from_ne_bytes )
- [`{float}::to_bits`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_bits )
- [`{float}::to_be_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_be_bytes )
- [`{float}::to_le_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_le_bytes )
- [`{float}::to_ne_bytes`](https://doc.rust-lang.org/stable/core/primitive.f64.html#method.to_ne_bytes )
- [`mem::replace`](https://doc.rust-lang.org/stable/core/mem/fn.replace.html )
- [`ptr::replace`](https://doc.rust-lang.org/stable/core/ptr/fn.replace.html )
- [`ptr::slice_from_raw_parts_mut`](https://doc.rust-lang.org/stable/core/ptr/fn.slice_from_raw_parts_mut.html )
- [`ptr::write`](https://doc.rust-lang.org/stable/core/ptr/fn.write.html )
- [`ptr::write_unaligned`](https://doc.rust-lang.org/stable/core/ptr/fn.write_unaligned.html )
- [`<*const _>::copy_to`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to )
- [`<*const _>::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to_nonoverlapping )
- [`<*mut _>::copy_from`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_from )
- [`<*mut _>::copy_from_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_from_nonoverlapping )
- [`<*mut _>::copy_to`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to-1 )
- [`<*mut _>::copy_to_nonoverlapping`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.copy_to_nonoverlapping-1 )
- [`<*mut _>::write`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write )
- [`<*mut _>::write_bytes`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write_bytes )
- [`<*mut _>::write_unaligned`](https://doc.rust-lang.org/stable/core/primitive.pointer.html#method.write_unaligned )
- [`slice::from_mut`](https://doc.rust-lang.org/stable/core/slice/fn.from_mut.html )
- [`slice::from_raw_parts_mut`](https://doc.rust-lang.org/stable/core/slice/fn.from_raw_parts_mut.html )
- [`<[_]>::first_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.first_mut )
- [`<[_]>::last_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.last_mut )
- [`<[_]>::first_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.first_chunk_mut )
- [`<[_]>::last_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.last_chunk_mut )
- [`<[_]>::split_at_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut )
- [`<[_]>::split_at_mut_checked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_checked )
- [`<[_]>::split_at_mut_unchecked`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_at_mut_unchecked )
- [`<[_]>::split_first_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_first_mut )
- [`<[_]>::split_last_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_last_mut )
- [`<[_]>::split_first_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_first_chunk_mut )
- [`<[_]>::split_last_chunk_mut`](https://doc.rust-lang.org/stable/core/primitive.slice.html#method.split_last_chunk_mut )
- [`str::as_bytes_mut`](https://doc.rust-lang.org/stable/core/primitive.str.html#method.as_bytes_mut )
- [`str::as_mut_ptr`](https://doc.rust-lang.org/stable/core/primitive.str.html#method.as_mut_ptr )
- [`str::from_utf8_unchecked_mut`](https://doc.rust-lang.org/stable/core/str/fn.from_utf8\_unchecked_mut.html )
<a id="1.83.0-Cargo"></a>
## Cargo
- [Introduced a new `CARGO_MANIFEST_PATH` environment variable, similar to `CARGO_MANIFEST_DIR` but pointing directly to the manifest file.](https://redirect.github.com/rust-lang/cargo/pull/14404/ )
- [Added `package.autolib` to the manifest, allowing `[lib]` auto-discovery to be disabled.](https://redirect.github.com/rust-lang/cargo/pull/14591/ )
- [Declare support level for each crate in Cargo's Charter / crate docs.](https://redirect.github.com/rust-lang/cargo/pull/14600/ )
- [Declare new Intentional Artifacts as 'small' changes.](https://redirect.github.com/rust-lang/cargo/pull/14599/ )
<a id="1.83-Rustdoc"></a>
## Rustdoc
- [The sidebar / hamburger menu table of contents now includes the `# headers` from the main item's doc comment](https://redirect.github.com/rust-lang/rust/pull/120736 ). This is similar to a third-party feature provided by the rustdoc-search-enhancements browser extension.
<a id="1.83.0-Compatibility-Notes"></a>
## Compatibility Notes
- [Warn against function pointers using unsupported ABI strings.](https://redirect.github.com/rust-lang/rust/pull/128784 )
- [Check well-formedness of the source type's signature in fn pointer casts.](https://redirect.github.com/rust-lang/rust/pull/129021 ) This partly closes a soundness hole that comes when casting a function item to function pointer
- [Use equality instead of subtyping when resolving type dependent paths.](https://redirect.github.com/rust-lang/rust/pull/129073 )
- Linking on macOS now correctly includes Rust's default deployment target. Due to a linker bug, you might have to pass `MACOSX_DEPLOYMENT_TARGET` or fix your `#[link]` attributes to point to the correct frameworks. See [#​129369](https://redirect.github.com/rust-lang/rust/pull/129369 ).
- [Rust will now correctly raise an error for `repr(Rust)` written on non-`struct`/`enum`/`union` items, since it previous did not have any effect.](https://redirect.github.com/rust-lang/rust/pull/129422 )
- The future incompatibility lint `deprecated_cfg_attr_crate_type_name` [has been made into a hard error](https://redirect.github.com/rust-lang/rust/pull/129670 ). It was used to deny usage of `#![crate_type]` and `#![crate_name]` attributes in `#![cfg_attr]`, which required a hack in the compiler to be able to change the used crate type and crate name after cfg expansion.
Users can use `--crate-type` instead of `#![cfg_attr(..., crate_type = "...")]` and `--crate-name` instead of `#![cfg_attr(..., crate_name = "...")]` when running `rustc`/`cargo rustc` on the command line.
Use of those two attributes outside of `#![cfg_attr]` continue to be fully supported.
- Until now, paths into the sysroot were always prefixed with `/rustc/$hash` in diagnostics, codegen, backtrace, e.g.
thread 'main' panicked at 'hello world', map-panic.rs:2:50
stack backtrace:
0: std::panicking::begin_panic
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/std/src/panicking.rs:616:12
1: map_panic::main::{{closure}}
at ./map-panic.rs:2:50
2: core::option::Option<T>::map
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/option.rs:929:29
3: map_panic::main
at ./map-panic.rs:2:30
4: core::ops::function::FnOnce::call_once
at /rustc/a55dd71d5fb0ec5a6a3a9e8c27b2127ba491ce52/library/core/src/ops/function.rs:248:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[RFC 3127 said](https://rust-lang.github.io/rfcs/3127-trim-paths.html#changing-handling-of-sysroot-path-in-rustc )
> We want to change this behaviour such that, when `rust-src` source files can be discovered, the virtual path is discarded and therefore the local path will be embedded, unless there is a `--remap-path-prefix` that causes this local path to be remapped in the usual way.
[#​129687](https://redirect.github.com/rust-lang/rust/pull/129687 ) implements this behaviour, when `rust-src` is present at compile time, `rustc` replaces `/rustc/$hash` with a real path into the local `rust-src` component with best effort.
To sanitize this, users must explicitly supply `--remap-path-prefix=<path to rust-src>=foo` or not have the `rust-src` component installed.
- The allow-by-default `missing_docs` lint used to disable itself when invoked through `rustc --test`/`cargo test`, resulting in `#[expect(missing_docs)]` emitting false positives due to the expectation being wrongly unfulfilled. This behavior [has now been removed](https://redirect.github.com/rust-lang/rust/pull/130025 ), which allows `#[expect(missing_docs)]` to be fulfilled in all scenarios, but will also report new `missing_docs` diagnostics for publicly reachable `#[cfg(test)]` items, [integration test](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#integration-tests ) crate-level documentation, and publicly reachable items in integration tests.
- [The `armv8r-none-eabihf` target now uses the Armv8-R required set of floating-point features.](https://redirect.github.com/rust-lang/rust/pull/130295 )
- [Fix a soundness bug where rustc wouldn't detect unconstrained higher-ranked lifetimes in a `dyn Trait`'s associated types that occur due to supertraits.](https://redirect.github.com/rust-lang/rust/pull/130367 )
- [Update the minimum external LLVM version to 18.](https://redirect.github.com/rust-lang/rust/pull/130487 )
- [Remove `aarch64-fuchsia` and `x86_64-fuchsia` target aliases in favor of `aarch64-unknown-fuchsia` and `x86_64-unknown-fuchsia` respectively.](https://redirect.github.com/rust-lang/rust/pull/130657 )
- [The ABI-level exception class of a Rust panic is now encoded with native-endian bytes, so it is legible in hex dumps.](https://redirect.github.com/rust-lang/rust/pull/130897 )
- [Visual Studio 2013 is no longer supported for MSVC targets.](https://redirect.github.com/rust-lang/rust/pull/131070 )
- [The sysroot no longer contains the `std` dynamic library in its top-level `lib/` dir.](https://redirect.github.com/rust-lang/rust/pull/131188 )
</details>
---
### Configuration
📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 **Automerge**: Enabled.
♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/ ). View the [repository job log](https://developer.mend.io/github/oxc-project/oxc ).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xOS4wIiwidXBkYXRlZEluVmVyIjoiMzkuMTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2024-11-29 07:25:36 +00:00
Boshen
d942a8d41a
chore: Rust v1.83.0 changes ( #7535 )
...
This PR does not upgrade rustc. Only changes are applied.
We cannot upgrade to the lastet Rust version yet due to wasm-bindgen
breaking some generated types.
THere's also some elided lifetimes in `**/generated/**`, which requires
modification to ast tools.
2024-11-29 11:59:45 +08:00
leaysgur
3a1ef6a230
refactor(prettier): Refactor IR related macros ( #7491 )
...
- Remove `format!` macro
- Rename string related macros, `&'static`: `text!` and `'a`: `dynamic_text!`
- Apply `wrap!` macro instead of manually using `enter|leave_node`
- Introduce `/ir` directory and move `Doc`, `impl Display`, `DocBuilder`, etc.
I'm not yet determined how to, how deep to use macro, but this is first stepping stone... 🥌
2024-11-26 09:31:30 +00:00
Boshen
f059b0e655
fix(ast)!: add missing ChainExpression from TSNonNullExpression ( #7377 )
...
closes #7375
* `foo?.bar!`
* `foo?.[bar]!`
`TSNonNullExpression` was not wrapped inside `ChainExpression`.
2024-11-20 15:54:28 +00:00
Song Gao
cf3415b0e4
chore(doc): replace main/master to tag/commit to make the url always accessible ( #7298 )
2024-11-16 21:00:30 +08:00
overlookmotel
44375a5662
refactor(ast)!: rename TSEnumMemberName enum variants ( #7250 )
...
Variants of `TSEnumMemberName` were previously only prefixed with `Static` to avoid naming conflicts with the variants inherited from `Expression` for non-static member names. #7219 removed the variants inherited from `Expression`, so all variants are now static. So we can shorten the names again (back to what they were before `inherit_variants!` was introduced).
2024-11-12 12:22:21 +00:00
Boshen
0e4adc15dd
feat(ast)!: remove invalid expressions from TSEnumMemberName ( #7219 )
2024-11-09 08:48:14 +00:00
Boshen
d1d187417b
feat(ast)!: change comment.span to real position that contain // and /* ( #7154 )
...
closes #7150
2024-11-06 05:10:33 +00:00
Boshen
423d54cb74
refactor(rust): remove the annoying clippy::wildcard_imports ( #6860 )
2024-10-24 13:57:19 +00:00
overlookmotel
e1c2d30d44
fix(allocator)!: make Vec non-drop ( #6623 )
...
`oxc_allocator::Vec` is intended for storing AST types in the arena. `Vec` is intended to be non-drop, because all AST types are non-drop. If they were not, it would be a memory leak, because those types will not have `drop` called on them when the allocator is dropped.
However, `oxc_allocator::Vec` is currently a wrapper around `allocator_api2::vec::Vec`, which *is* drop. That unintentionally makes `oxc_allocator::Vec` drop too.
This PR fixes this by wrapping the inner `allocator_api2::vec::Vec` in `ManuallyDrop`. This makes `oxc_allocator::Vec` non-drop.
The wider consequence of this change is that the compiler is now able to see that loads of other types which contain `oxc_allocator::Vec` are also non-drop. Once it can prove that, it can remove a load of code which handles dropping these types in the event of a panic. This probably also then allows it to make many further optimizations on that simplified code.
Strictly speaking, this PR is a breaking change. If `oxc_allocator::Vec` is abused to store drop types, then in some circumstances this change could produce a memory leak where there was none before. However, we've always been clear that only non-drop types should be stored in the arena, so such usage was always a bug.
#6622 fixes the only place in Oxc where we mistakenly stored non-drop types in `Vec`.
The change to `oxc_prettier` is because compiler can now deduce that `Doc` is non-drop, which causes clippy to raise a warning about using `then` instead of `then_some`.
As follow-up, we should:
1. Wrap other `allocator_api2` types (e.g. `IntoIter`) in `ManuallyDrop` too, so compiler can prove they are non-drop too (or reimplement `Vec` ourselves - #6488 ).
2. Introduce static checks to prevent non-drop types being used in `Box` and `Vec`, to make memory leaks impossible, and detect them at compile time.
2024-10-19 15:43:54 +00:00
Boshen
cb8f4210c3
refactor(prettier)!: remove source_text argument from constructor ( #6448 )
2024-10-11 06:27:33 +00:00
Boshen
520096030a
refactor(oxc)!: remove passing Trivias around ( #6446 )
...
part of #6426
2024-10-11 06:09:25 +00:00
Alexander S.
fe25b651bd
feat(prettier): indent for class definition ( #6059 )
...
trying to match the output for:
5b868377c0/tests/format/typescript/classes/__snapshots__/format.test.js.snap (L3-L92)
<details><summary>main branch output:</summary>
```typescript
class MyContractSelectionWidget extends React.Component<void, MyContractSelectionWidgetPropsType, void> implements SomethingLarge {
method() {}
}
class DisplayObject1 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject2 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class DisplayObject3 extends utils.EventEmitter implements interaction_InteractiveTarget, somethingElse_SomeOtherThing, somethingElseAgain_RunningOutOfNames {}
class DisplayObject4 extends utils.EventEmitter implements interaction_InteractiveTarget {}
class Readable extends events.EventEmitter implements NodeJS_ReadableStream {}
class InMemoryAppender extends log4javascript.Appender implements ICachedLogMessageProvider {}
class Foo extends Immutable.Record({
ipaddress: "",
}) {
ipaddress: string;
}
export class VisTimelineComponent implements AfterViewInit, OnChanges, OnDestroy {}
export class VisTimelineComponent2 implements AfterViewInit, OnChanges, OnDestroy, AndSomethingReallyReallyLong {}
```
</details>
<details><summary>this branch output:</summary>
```typescript
class MyContractSelectionWidget
extends React.Component<void, MyContractSelectionWidgetPropsType, void>
implements SomethingLarge
{
method() {}
}
class DisplayObject1
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject2
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class DisplayObject3
extends utils.EventEmitter
implements
interaction_InteractiveTarget,
somethingElse_SomeOtherThing,
somethingElseAgain_RunningOutOfNames {}
class DisplayObject4
extends utils.EventEmitter
implements interaction_InteractiveTarget {}
class Readable
extends events.EventEmitter
implements NodeJS_ReadableStream {}
class InMemoryAppender
extends log4javascript.Appender
implements ICachedLogMessageProvider {}
class Foo extends Immutable.Record({
ipaddress: "",
}) {
ipaddress: string;
}
export class VisTimelineComponent
implements AfterViewInit, OnChanges, OnDestroy {}
export class VisTimelineComponent2
implements
AfterViewInit,
OnChanges,
OnDestroy,
AndSomethingReallyReallyLong {}
```
</details>
Sadly I can't fix the `class Readable` line :/
2024-10-06 22:23:24 +08:00
Dunqing
1fc80d1bba
refactor(ast): move all ts ast related impl methods to ast_impl ( #6015 )
2024-09-24 06:07:37 +00:00
camchenry
2b17003e0b
perf(linter, prettier, diagnostics): use FxHashMap instead of std::collections::HashMap ( #5993 )
...
Using `FxHashMap` is faster than `HashMap` in many cases, especially for hashing-heavy workloads. This change improves the performance of the linter, prettier, and diagnostics crates by using `FxHashMap` instead of `std::collections::HashMap`.
2024-09-23 16:29:05 +00:00
Alexander S.
463c24e5ec
fix(prettier): handle TSTypeLiteral as an object ( #5946 )
...
- [x] semi is optional with the right configuration
2024-09-21 23:27:12 +08:00
Boshen
12d4888120
chore(prettier): remove incorrect comment printing logic ( #5889 )
...
Remove the previous incorrect implementation, cc @leaysgur
2024-09-21 04:45:18 +00:00
Alexander S.
65c337a071
feat(prettier): improve ts compatibility ( #5900 )
2024-09-20 10:40:31 +08:00
Alexander S.
4e37d18b2e
feat(prettier): start supporting tsx syntax ( #5866 )
...
Look at first: #5864
the only merge conflict for this PR should then be the ts snap file.
If you want, you can also skip the other PR and merge this one directly
:)
2024-09-19 09:40:07 +08:00
Boshen
42dcadfccf
fix(parser): hashbang comment should not keep the end newline char ( #5844 )
...
Previously it included a newline in the value
```
"hashbang": {
"type": "Hashbang",
"start": 0,
"end": 16,
"value": "/usr/bin/node\n"
},
```
This change will also make the lexer emit a `\n` token, which will make comment position detection correct.
2024-09-18 05:41:44 +00:00
Alexander S.
31da9bce3f
feat(prettier): class improvements part 2 ( #5838 )
2024-09-18 11:07:51 +08:00
Alexander S.
c6d97e9366
feat(prettier): improve ts class output ( #5835 )
...
please look first at #5834 :)
2024-09-17 17:33:35 -04:00
Alexander S.
6d9ccdda92
feat(prettier): support TSMappedType ( #5834 )
2024-09-17 16:25:51 -04:00
Alexander S.
18e4ac22ad
feat(prettier): improve TSInterfaceDeclaration ( #5817 )
...
last one for today :)
---------
Co-authored-by: Don Isaac <donald.isaac@gmail.com>
2024-09-17 14:41:33 +08:00
Alexander S.
b5ac5a6bf0
feat(prettier): support TSModuleDeclaration ( #5813 )
...
Goal of this PR is to resolve this test:
aa3853b776/tests/format/typescript/interface/separator.ts
2024-09-16 16:39:42 -04:00
Alexander S.
8b1485bb00
feat(prettier): improve ClassMemberish with print_class_property ( #5811 )
2024-09-16 13:32:20 -04:00
Alexander S.
01f8c1bca8
feat(prettier): support TSIntersectionType and TSUnionType ( #5794 )
2024-09-16 13:09:30 -04:00
Alexander S.
52c64093f9
feat(prettier): support typescript enums ( #5790 )
...
The last failed test is only because of the comments. the oxc prettier
output is:
```
enum Direction {
Up = 1,
Down,
Left,
Right,
}
enum FileAccess {
None,
Read = // constant members
1 << 1,
Write = 1 << 2,
ReadWrite = Read | Write,
G = // computed member
"123".length,
}
enum Empty {}
const enum Enum {
A = 1,
B = A * 2,
}
```
Expected output:
aa3853b776/tests/format/typescript/enum/__snapshots__/format.test.js.snap (L91-L99)
Hope you can tell more why this happens :)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-16 11:58:04 +08:00
Boshen
6dd6f7ca26
refactor(ast): change Comment struct ( #5783 )
2024-09-15 09:22:58 +00:00
Boshen
e8bf30a125
feat(ast): add Comment::real_span ( #5764 )
2024-09-13 15:28:34 +00:00
Boshen
4bdc202325
refactor(rust): remove some #[allow(unused)] ( #5716 )
2024-09-12 02:19:01 +00:00
heygsc
5482e73189
feat(prettier): add assignment/sequence ( #5694 )
...
test:
https://github.com/prettier/prettier/blob/main/tests/format/js/assignment/sequence.js
snap:https://github.com/prettier/prettier/blob/main/tests/format/js/assignment/__snapshots__/format.test.js.snap#L870-L888
code:
https://github.com/prettier/prettier/blob/main/src/language-js/needs-parens.js#L790-L796
2024-09-11 18:19:09 +08:00
heygsc
febb29f7f5
perf(formatter): use cow and put cow_ascii on clippy ( #5646 )
...
close : #5639
part of: #5586
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Boshen <boshenc@gmail.com>
2024-09-10 09:38:17 +08:00
Boshen
63a830e08c
chore(dprint): format toml files ( #5599 )
...
Co-authored-by: Boshen <1430279+Boshen@users.noreply.github.com>
2024-09-08 14:26:16 +08:00