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

assertion failed: start.raw <= end.raw appears again #11429

Closed
zhangzhen opened this issue May 15, 2024 · 6 comments
Closed

assertion failed: start.raw <= end.raw appears again #11429

zhangzhen opened this issue May 15, 2024 · 6 comments

Comments

@zhangzhen
Copy link

zhangzhen commented May 15, 2024

I'm using ruff in neovim 0.9.5.

RANGE_DICT = {
    ("NRF1_chr9_gap1_g0", 0): (32, 43),
    ("NRF1_chr9_gap1_g0", 1): (62, 73),
}

Before the constant defining statement, i typed def and then type a space. No errors occurred.
After it, i typed def and then a space. I got the following error:
thread 'main' panicked at /Users/runner/work/ruff/ruff/crates/ruff_text_size/src/range.rs:48:9:
assertion failed: start.raw <= end.raw

The current Ruff version: 0.4.4.
The current Ruff settings:

[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
[tool.pyright]
include = ["foodie"]
@dhruvmanila
Copy link
Member

Thanks for the report!

Can you tell me exactly where you're typing the def and a space? Is it like below?

RANGE_DICT = {
    ("NRF1_chr9_gap1_g0", 0): (32, 43),
    ("NRF1_chr9_gap1_g0", 1): (62, 73),
}
def 

I'm not getting any panics if I type def and a space anywhere around this code.

Can you confirm that Neovim is using the correct ruff executable i.e., the one you mentioned the version for?

@zhangzhen
Copy link
Author

zhangzhen commented May 15, 2024

Can you confirm that Neovim is using the correct ruff executable i.e., the one you mentioned the version for?

yes, it is 0.4.4

Can you tell me exactly where you're typing the def and a space? Is it like below?

yes. In any line after the global variable definition, the error occurs. here is the screenshot:
image

@dhruvmanila
Copy link
Member

Sorry but I'm unable to reproduce this with the snippet above.

yes, it is 0.4.4

Can you provide the steps you took to get this value? I'm specifically referring to the Ruff version ruff-lsp is using. You can get this by following the steps below:

  1. Set the LSP log level to INFO with: :lua vim.lsp.set_log_level(vim.lsp.log_levels.INFO)
  2. Write the function to reproduce the panic
  3. Open the LSP logs with :LspLog command
  4. Look for a message like Found ruff 0.4.3 at /Users/dhruv/.local/bin/ruff

Can you confirm the Ruff version with this steps? If you face any problem, you can connect withe me on Discord (username: dhruvmanila) and we can diagnose the issue :)

@zhangzhen
Copy link
Author

Can you confirm the Ruff version with this steps?

Found ruff 0.4.0 at /Users/zhangzhen/.local/share/nvim/mason/packages/ruff-lsp/venv/bin/ruff
The Ruff version is 0.4.0 not 0.4.4.

@charliermarsh
Copy link
Member

Ah ok. Can you upgrade the ruff version installed in that environment? I believe this was fixed in a prior release as @dhruvmanila mentioned.

@dhruvmanila
Copy link
Member

Yes, this was fixed in 0.4.1 via #11032. Can you try it after upgrading Ruff to 0.4.1 or later?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants