Skip to content

fix(cli): preserve spaces and newlines in treesitter chunking. #120

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

Davidyz
Copy link
Owner

@Davidyz Davidyz commented May 4, 2025

Code:

-- example.lua
local a = 1
local b = 2

local function foo_bar()
  local x = 1
  local y = 3
  local z = 5
  return x + y + z
end

Before:

// vectorcode chunks -c 25 example.lua
[
  [
    "local a = 1local b = 2",
    "localfunction foo_bar ()",
    "local x = 1local y = 3",
    "local z = 5",
    "return x + y + z",
    "end"
  ]
]

After:

// vectorcode chunks -c 25 example.lua
[
  [
    "local a = 1\nlocal b = 2",
    "local function foo_bar ()",
    "local x = 1\nlocal y = 3",
    "local z = 5",
    "return x + y + z",
    "end"
  ]
]

@Davidyz Davidyz added bug Something isn't working fix labels May 4, 2025
@Davidyz Davidyz force-pushed the cli/ts-newline-fix branch from ecffddc to c2716bd Compare May 4, 2025 12:57
@Davidyz Davidyz force-pushed the cli/ts-newline-fix branch from c2716bd to 05d2814 Compare May 4, 2025 13:02
Copy link

codecov bot commented May 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.23%. Comparing base (7bfcedc) to head (05d2814).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #120   +/-   ##
=======================================
  Coverage   99.23%   99.23%           
=======================================
  Files          22       22           
  Lines        1440     1447    +7     
=======================================
+ Hits         1429     1436    +7     
  Misses         11       11           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Davidyz Davidyz marked this pull request as ready for review May 6, 2025 08:33
@Davidyz Davidyz merged commit bcc906d into main May 6, 2025
12 checks passed
@Davidyz Davidyz deleted the cli/ts-newline-fix branch May 6, 2025 08:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant