Closed anzhi0708 closed 2 years ago
For pasting, since you're using tabs I assume that you haven't changed the tab width via :indent-style
? Is there a difference between pasting through the terminal and pasting through Helix (:clipboard-paste
or space
+ p
/P
)?
For pasting, since you're using tabs I assume that you haven't changed the tab width via
:indent-style
?
No, I did't. There's no .toml
file under my ~/.config/helix
as well...
For pasting, since you're using tabs I assume that you haven't changed the tab width via
:indent-style
? Is there a difference between pasting through the terminal and pasting through Helix?
I copied the code directly into the terminal(not helix) and the warning about tab size showed up again.
Try pasting through Helix (:clipboard-paste-after
or space
+ p
/P
)
Try pasting through Helix (
:clipboard-paste-after
orspace
+p
/P
)
:clipboard-paste-after
did a perfect paste without indent error
Yeah, the terminal is messing it up by converting the indentation. Not sure how Vim avoids that.
Yeah, the terminal is messing it up by converting the indentation. Not sure how Vim avoids that.
I'll try to reproduce the crush in the beginning. Thanks a lot for your help! :3
I can reproduce this with ElixirLS by creating a file that fails to compile. The code looks roughly like:
Mox.defmock(MyMock, for: SomeModuleThatIsNotABehaviour)
The logger shows this message from the LS right before the crash:
{
"jsonrpc": "2.0",
"method": "textDocument/publishDiagnostics",
"params": {
"diagnostics": [
{
"message": "(ArgumentError) module SomeModuleThatIsNotABehaviour is not a behaviour, please pass a behaviour to :for\n\nStacktrace:\n │ (mox 1.0.1) lib/mox.ex:365: Mox.validate_behaviour!/1\n │ (mox 1.0.1) lib/mox.ex:383: anonymous fn/2 in Mox.generate_compile_time_dependency/1\n │ (elixir 1.13.4) lib/enum.ex:2396: Enum.\"-reduce/3-lists^foldl/2-0-\"/3\n │ (mox 1.0.1) lib/mox.ex:382: Mox.generate_compile_time_dependency/1\n │ (mox 1.0.1) lib/mox.ex:349: Mox.defmock/2",
"range": {
"end": { "character": 0, "line": -1 },
"start": { "character": 0, "line": -1 }
},
"severity": 1,
"source": "Elixir"
}
],
"uri": "file:///home/michael/snip/snip/test/support/mocks.ex"
}
}
And here's the full backtrace:
thread 'main' panicked at 'Failed to parse PublishDiagnostics params: Error { code: InvalidParams, message: "Invalid params: invalid value: integer `-1`, expected u32.", data: None }', helix-lsp/src/lib.rs:279:22
stack backtrace:
0: 0x5607b669fbfc - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h3e2b509ce2ce6007
1: 0x5607b5ff6c9c - core::fmt::write::h753c7571fa063ecb
2: 0x5607b6697f95 - std::io::Write::write_fmt::h2815c0519c99ba09
3: 0x5607b66a2da5 - std::panicking::default_hook::{{closure}}::h78d3e6cf97fc623d
4: 0x5607b66a2a23 - std::panicking::default_hook::hda898f8d3ad1a5ae
5: 0x5607b6563873 - helix_term::application::Application::run::{{closure}}::{{closure}}::h3dfe79fd2c65786a
6: 0x5607b66a3451 - std::panicking::rust_panic_with_hook::h1a5ea2d6c23051aa
7: 0x5607b66a311a - std::panicking::begin_panic_handler::{{closure}}::h07f549390938b73f
8: 0x5607b66a0124 - std::sys_common::backtrace::__rust_end_short_backtrace::h5ec3758a92cfb00d
9: 0x5607b66a2e7d - rust_begin_unwind
10: 0x5607b5f7fd01 - core::panicking::panic_fmt::h3a79a6a99affe1d5
11: 0x5607b5f7fdf3 - core::result::unwrap_failed::ha0327e3803285d6e
12: 0x5607b61dc244 - helix_lsp::Notification::parse::h4b0c62c8102e9a30
13: 0x5607b6571c02 - <core::future::from_generator::GenFuture<T> as core::future::future::Future>::poll::h0a7da9cc4c5b565a
14: 0x5607b653db9e - tokio::park::thread::CachedParkThread::block_on::he36d1026cd6454bc
15: 0x5607b65347e9 - tokio::runtime::thread_pool::ThreadPool::block_on::h27950ba51e21c469
16: 0x5607b65526bc - tokio::runtime::Runtime::block_on::h0f21e182e7a55280
17: 0x5607b653cfba - hx::main::h2020ee9f0a5b563f
18: 0x5607b6534623 - std::sys_common::backtrace::__rust_begin_short_backtrace::h7c8e761f3c8b8510
19: 0x5607b655245d - std::rt::lang_start::{{closure}}::hab23b0f9c2f1672d
20: 0x5607b669f25e - std::rt::lang_start_internal::h52e73755f77c7dd9
21: 0x5607b6540612 - main
22: 0x7fba26b07790 - __libc_start_main
23: 0x5607b5facf0a - _start
24: 0x0 - <unknown>
That message from the language server is malformed: -1
is not a valid line
.
We should be able to remove the panic in this block and replace it with an error log: https://github.com/helix-editor/helix/blob/4b1fe367faa4d64f3823d3fee1f70762a4334e29/helix-lsp/src/lib.rs#L277-L283
Ultimately this is an upstream bug with ElixirLS though. It must not give -1
lines.
Hello, I guess helix just crashed in
iTerm2
and I got this messageI noticed that when pasting python code to helix running in
iTerm2
,iTerm2
warns you about tab size.Paste the exact same code to
Vim
, no warnings at all.And the code pasted into helix have messed up indent as well.
vim
hx
I know the code doesn't make sense, but the indent was twisted in helix.
The code was copied from a browser.
I was using
python-lsp-server[full]
and here's the output ofpip3 list
Here's the log info in
~/.cache/helix/helix.log
uname -a
:env | rg LC_CTYPE
env | rg LC_TERMINAL