Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cover flatshapes #35

Merged
merged 26 commits into from
Dec 17, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
e72a4f9
:construction: add some shapes
AucaCoyan Jun 21, 2023
8ae7105
:construction: add str interpolation boolean
AucaCoyan Jun 22, 2023
1392222
:construction: keep on lining
AucaCoyan Jun 23, 2023
c965da8
:sparkles: resolve some shapes and internal calls
AucaCoyan Jun 25, 2023
f7555d4
:twisted_rightwards_arrows: merge `upstream/main` into this branch
AucaCoyan Jun 29, 2023
b3180dc
:arrow_up: upgrade `nu` dependencies
AucaCoyan Jun 29, 2023
4ab533f
:rotating_light: fix clippy
AucaCoyan Jun 29, 2023
03078d3
:recycle: add `write_only_if_have_comments` fn
AucaCoyan Jun 29, 2023
6b49ff1
refactor the decl ids in an enumeration
amtoine Jul 8, 2023
cbda62d
remove useless comments
amtoine Jul 8, 2023
2cceede
make Clippy happy
amtoine Jul 8, 2023
7faac01
:twisted_rightwards_arrows: bring the changes of upstream/cover-flats…
AucaCoyan Jul 21, 2023
e0e4087
:construction: advance on write comments function
AucaCoyan Jul 21, 2023
1670dae
:bug: remove the merge marker and add link to license
AucaCoyan Jul 21, 2023
37d6bd6
:package: update `nu` packages
Oct 1, 2023
8863caf
:fire: remove string interpolation
Oct 1, 2023
c47174c
Merge remote-tracking branch 'upstream/main' into cover-flatshapes
Oct 7, 2023
93955e5
:bug: fix space in signature
Oct 17, 2023
4e5f322
:rotating_light: Fix clippy and update `nu` dependencies
AucaCoyan Dec 15, 2023
c48df19
:memo: Update nushell version in the README
AucaCoyan Dec 15, 2023
dc7735e
:white_check_mark: Fix failing tests
AucaCoyan Dec 15, 2023
581febd
:recycle: Refactor the boolean
AucaCoyan Dec 15, 2023
63b851e
:fire: Remove files
AucaCoyan Dec 15, 2023
1f385cf
Update docstring on `formatting.rs`
AucaCoyan Dec 16, 2023
07f5076
:fire: Remove unused comment
AucaCoyan Dec 16, 2023
8d8c2e5
:fire: Remove no longer used comment
AucaCoyan Dec 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
🐛 remove the merge marker and add link to license
  • Loading branch information
AucaCoyan committed Jul 21, 2023
commit 1670daec85a7e551d6c40aa335e7d6514bd0767e
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
[![nushell version][nushell-badge]][nushell-url]

[mit-badge]: https://img.shields.io/badge/license-MIT-blue.svg?color=brightgreen
[mit-url]: LICENSE
[mit-url]: https://github.com/nushell/nufmt/blob/main/LICENSE
[discord-badge]: https://img.shields.io/discord/678763474494423051?logo=discord&label=discord&color=brightgreen
[discord-url]: https://discord.gg/NtAbbGn
[ci-badge]: https://github.com/nushell/nufmt/actions/workflows/main.yml/badge.svg
Expand Down
8 changes: 1 addition & 7 deletions src/formatting.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,13 @@ pub(crate) fn format_inner(contents: &[u8], _config: &Config) -> Vec<u8> {
out = write_only_if_have_comments(skipped_contents, out, true);
}

let mut bytes = working_set.get_span_contents(span);
let content = String::from_utf8_lossy(bytes).to_string();
let mut bytes = working_set.get_span_contents(span);
let content = String::from_utf8_lossy(bytes).to_string();
trace!("shape is {shape}");
trace!("shape contents: {:?}", &content);

match shape {
FlatShape::String | FlatShape::Int | FlatShape::Nothing => out.extend(bytes),
FlatShape::Int | FlatShape::Nothing => out.extend(bytes),
FlatShape::StringInterpolation => {
out.extend(bytes);
inside_string_interpolation = !inside_string_interpolation;
Expand Down Expand Up @@ -130,11 +128,7 @@ pub(crate) fn format_inner(contents: &[u8], _config: &Config) -> Vec<u8> {
let printable = String::from_utf8_lossy(remaining_contents).to_string();
trace!("contents: {:?}", printable);

<<<<<<< HEAD
out = write_only_if_have_comments(remaining_contents, out);
=======
out = write_only_if_have_comments(remaining_contents, out, false);
>>>>>>> 8d0769e (:construction: advance on write comments function)
}

start = span.end + 1;
Expand Down
Loading