8000 LSP crashes on completion at method arguments (lsp/requests/completion.cc:1283:98) · Issue #8907 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

LSP crashes on completion at method arguments (lsp/requests/completion.cc:1283:98) #8907

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

Open
henryhchchc opened this issue May 22, 2025 · 0 comments
Labels
bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team

Comments

@henryhchchc
Copy link

Input

→ View on sorbet.run

LSP completion crashes with the following example.

Sorbet version 0.5.12058.20250502171628-3d94f25ee

# typed: true

def foo(x: nil); end
foo 1
foo(y: 1)

def bar(x: nil, y: nil); end
bar(5, x: 8)
bar(5, 8)

def baz(x: nil); end
baz 7

def quux(x, y, z); end
quux

def qaar(a, b, c: nil, d: nil); end
qaar(1, 2, 3, c: nil, d: nil)

def qaadr(e: 1); end
qaadr({a: 1}, {b: 2}, {c: 3})
#     ↑ Trigger completion here

Observed output

LSP crashed

👋 Hey there! Heads up that this is not a release build of sorbet.
Release builds are faster and more well-supported by the Sorbet team.
Check out the README to learn how to build Sorbet in release mode.
To forcibly silence this error, either pass --silence-dev-message,
or set SORBET_SILENCE_DEV_MESSAGE=1 in your shell environment.

Content-Length: 638

{"jsonrpc":"2.0","id":0,"requestMethod":"initialize","result":{"capabilities":{"textDocumentSync":1,"hoverProvider":true,"completionProvider":{"triggerCharacters":[".",":","@","#"]},"definitionProvider":true,"typeDefinitionProvider":true,"implementationProvider":true,"referencesProvider":true,"documentHighlightProvider":false,"documentSymbolProvider":true,"workspaceSymbolProvider":true,"codeActionProvider":{"codeActionKinds":["quickfix","source.fixAll.sorbet","refactor.extract","refactor.rewrite"],"resolveProvider":true},"documentFormattingProvider":false,"renameProvider":{"prepareProvider":true},"sorbetShowSymbolProvider":true}}}Pausing
Resuming
Exception::raise() msg="core/Loc.cc:314 enforced condition this->exists() has failed: (no message provided)"

Backtrace:
  #3 0x5555564db3e6 in bool sorbet::Exception::enforce_handler<>(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, int, fmt::v11::basic_format_string<char>) /proc/self/cwd/./common/exception/Exception.h:64:9
  #4 0x5555564db1bf in sorbet::Exception::enforce_handler(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, int) /proc/self/cwd/./common/exception/Exception.h:58:9
  #5 0x555557ae46a9 in sorbet::core::Loc::contains(sorbet::core::Loc const&) const /proc/self/cwd/core/Loc.cc:314:5
  #6 0x555556719750 in sorbet::realmain::lsp::CompletionTask::runRequest(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/requests/completion.cc:1283:98
  #7 0x555556600856 in sorbet::realmain::lsp::LSPRequestTask::run(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/LSPTask.cc:222:21
  #8 0x5555565ffa57 in sorbet::realmain::lsp::LSPQueuePreemptionTask::run(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/LSPTask.cc:544:15
  #9 0x55555668017b in sorbet::realmain::lsp::(anonymous namespace)::TypecheckerTask::run() /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:58:19
  #10 0x555557ba101e in sorbet::core::lsp::PreemptionTaskManager::tryRunScheduledPreemptionTask(sorbet::core::GlobalState const&) /proc/self/cwd/core/lsp/PreemptionTaskManager.cc:55:22
  #11 0x555556a072f3 in sorbet::realmain::pipeline::typecheck(sorbet::core::GlobalState const&, std::__1::vector<sorbet::ast::ParsedFile, std::__1::allocator<sorbet::ast::ParsedFile>>, sorbet::realmain::options::Options const&, sorbet::WorkerPool&, bool, std::__1::optional<std::__1::shared_ptr<sorbet::core::lsp::PreemptionTaskManager>>, bool, bool) /proc/self/cwd/main/pipeline/pipeline.cc:1278:35
  #12 0x5555566164b6 in sorbet::realmain::lsp::LSPTypechecker::runSlowPath(sorbet::realmain::lsp::LSPFileUpdates&, std::__1::unique_ptr<sorbet::KeyValueStore, std::__1::default_delete<sorbet::KeyValueStore>>, sorbet::WorkerPool&, std::__1::shared_ptr<sorbet::core::ErrorFlusher>, sorbet::realmain::lsp::LSPTypechecker::SlowPathMode)::$_2::operator()() const /proc/self/cwd/main/lsp/LSPTypechecker.cc:583:9
  #13 0x555557ba5997 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const /proc/self/cwd/__bazel_toolchain_llvm_repo__/bin/../include/c++/v1/__functional/function.h:512:16
  #14 0x555556632151 in sorbet::realmain::lsp::LSPTypechecker::runSlowPath(sorbet::realmain::lsp::LSPFileUpdates&, std::__1::unique_ptr<sorbet::KeyValueStore, std::__1::default_delete<sorbet::KeyValueStore>>, sorbet::WorkerPool&, std::__1::shared_ptr<sorbet::core::ErrorFlusher>, sorbet::realmain::lsp::LSPTypechecker::SlowPathMode) /proc/self/cwd/main/lsp/LSPTypechecker.cc:392:35
  #15 0x555556635c5a in sorbet::realmain::lsp::LSPTypechecker::typecheck(std::__1::unique_ptr<sorbet::realmain::lsp::LSPFileUpdates, std::__1::default_delete<sorbet::realmain::lsp::LSPFileUpdates>>, sorbet::WorkerPool&, std::__1::vector<std::__1::unique_ptr<sorbet::Timer, std::__1::default_delete<sorbet::Timer>>, std::__1::allocator<std::__1::unique_ptr<sorbet::Timer, std::__1::default_delete<sorbet::Timer>>>>) /proc/self/cwd/main/lsp/LSPTypechecker.cc:155:27
  #16 0x5555566ac1ca in sorbet::realmain::lsp::SorbetWorkspaceEditTask::runSpecial(sorbet::realmain::lsp::LSPTypechecker&, sorbet::WorkerPool&) /proc/self/cwd/main/lsp/notifications/sorbet_workspace_edit.cc:123:21
  #17 0x55555667f9d6 in sorbet::realmain::lsp::(anonymous namespace)::DangerousTypecheckerTask::run() /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:88:15
  #18 0x55555667e3e8 in sorbet::realmain::lsp::LSPTypecheckerCoordinator::startTypecheckerThread()::$_0::operator()() const /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:189:23
  #19 0x555557dcc207 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const /proc/self/cwd/__bazel_toolchain_llvm_repo__/bin/../include/c++/v1/__functional/function.h:512:16
  #20 0x7ffff7d4e7e2 start_thread
  #21 0x7ffff7dd3800 __GI___cl
7C0B
one3

Sorbet raised uncaught exception type="sorbet::SorbetException" what="core/Loc.cc:314 enforced condition this->exists() has failed: (no message provided)"
Backtrace:
  #3 0x55555645b172 in std::__terminate(void (*)()) cxa_handlers.cpp:0:0
  #4 0x55555645a865 in __cxxabiv1::failed_throw(__cxxabiv1::__cxa_exception*) cxa_exception.cpp:0:0
  #5 0x55555645a7ff
  #6 0x5555564db8e3 in bool sorbet::Exception::raise<std::__1::basic_string_view<char, std::__1::char_traits<char>>&, int&, std::__1::basic_string_view<char, std::__1::char_traits<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>(fmt::v11::basic_format_string<char, fmt::v11::type_identity<std::__1::basic_string_view<char, std::__1::char_traits<char>>&>::type, fmt::v11::type_identity<int&>::type, fmt::v11::type_identity<std::__1::basic_string_view<char, std::__1::char_traits<char>>&>::type, fmt::v11::type_identity<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>::type>, std::__1::basic_string_view<char, std::__1::char_traits<char>>&, int&, std::__1::basic_string_view<char, std::__1::char_traits<char>>&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>&&) /proc/self/cwd/./common/exception/Exception.h:76:5
  #7 0x5555564db3e6 in bool sorbet::Exception::enforce_handler<>(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, int, fmt::v11::basic_format_string<char>) /proc/self/cwd/./common/exception/Exception.h:64:9
  #8 0x5555564db1bf in sorbet::Exception::enforce_handler(std::__1::basic_string_view<char, std::__1::char_traits<char>>, std::__1::basic_string_view<char, std::__1::char_traits<char>>, int) /proc/self/cwd/./common/exception/Exception.h:58:9
  #9 0x555557ae46a9 in sorbet::core::Loc::contains(sorbet::core::Loc const&) const /proc/self/cwd/core/Loc.cc:314:5
  #10 0x555556719750 in sorbet::realmain::lsp::CompletionTask::runRequest(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/requests/completion.cc:1283:98
  #11 0x555556600856 in sorbet::realmain::lsp::LSPRequestTask::run(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/LSPTask.cc:222:21
  #12 0x5555565ffa57 in sorbet::realmain::lsp::LSPQueuePreemptionTask::run(sorbet::realmain::lsp::LSPTypecheckerDelegate&) /proc/self/cwd/main/lsp/LSPTask.cc:544:15
  #13 0x55555668017b in sorbet::realmain::lsp::(anonymous namespace)::TypecheckerTask::run() /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:58:19
  #14 0x555557ba101e in sorbet::core::lsp::PreemptionTaskManager::tryRunScheduledPreemptionTask(sorbet::core::GlobalState const&) /proc/self/cwd/core/lsp/PreemptionTaskManager.cc:55:22
  #15 0x555556a072f3 in sorbet::realmain::pipeline::typecheck(sorbet::core::GlobalState const&, std::__1::vector<sorbet::ast::ParsedFile, std::__1::allocator<sorbet::ast::ParsedFile>>, sorbet::realmain::options::Options const&, sorbet::WorkerPool&, bool, std::__1::optional<std::__1::shared_ptr<sorbet::core::lsp::PreemptionTaskManager>>, bool, bool) /proc/self/cwd/main/pipeline/pipeline.cc:1278:35
  #16 0x5555566164b6 in sorbet::realmain::lsp::LSPTypechecker::runSlowPath(sorbet::realmain::lsp::LSPFileUpdates&, std::__1::unique_ptr<sorbet::KeyValueStore, std::__1::default_delete<sorbet::KeyValueStore>>, sorbet::WorkerPool&, std::__1::shared_ptr<sorbet::core::ErrorFlusher>, sorbet::realmain::lsp::LSPTypechecker::SlowPathMode)::$_2::operator()() const /proc/self/cwd/main/lsp/LSPTypechecker.cc:583:9
  #17 0x555557ba5997 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const /proc/self/cwd/__bazel_toolchain_llvm_repo__/bin/../include/c++/v1/__functional/function.h:512:16
  #18 0x555556632151 in sorbet::realmain::lsp::LSPTypechecker::runSlowPath(sorbet::realmain::lsp::LSPFileUpdates&, std::__1::unique_ptr<sorbet::KeyValueStore, std::__1::default_delete<sorbet::KeyValueStore>>, sorbet::WorkerPool&, std::__1::shared_ptr<sorbet::core::ErrorFlusher>, sorbet::realmain::lsp::LSPTypechecker::SlowPathMode) /proc/self/cwd/main/lsp/LSPTypechecker.cc:392:35
  #19 0x555556635c5a in sorbet::realmain::lsp::LSPTypechecker::typecheck(std::__1::unique_ptr<sorbet::realmain::lsp::LSPFileUpdates, std::__1::default_delete<sorbet::realmain::lsp::LSPFileUpdates>>, sorbet::WorkerPool&, std::__1::vector<std::__1::unique_ptr<sorbet::Timer, std::__1::default_delete<sorbet::Timer>>, std::__1::allocator<std::__1::unique_ptr<sorbet::Timer, std::__1::default_delete<sorbet::Timer>>>>) /proc/self/cwd/main/lsp/LSPTypechecker.cc:155:27
  #20 0x5555566ac1ca in sorbet::realmain::lsp::SorbetWorkspaceEditTask::runSpecial(sorbet::realmain::lsp::LSPTypechecker&, sorbet::WorkerPool&) /proc/self/cwd/main/lsp/notifications/sorbet_workspace_edit.cc:123:21
  #21 0x55555667f9d6 in sorbet::realmain::lsp::(anonymous namespace)::DangerousTypecheckerTask::run() /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:88:15
  #22 0x55555667e3e8 in sorbet::realmain::lsp::LSPTypecheckerCoordinator::startTypecheckerThread()::$_0::operator()() const /proc/self/cwd/main/lsp/LSPTypecheckerCoordinator.cc:189:23
  #23 0x555557dcc207 in std::__1::__function::__value_func<void ()>::operator()[abi:v15007]() const /proc/self/cwd/__bazel_toolchain_llvm_repo__/bin/../include/c++/v1/__functional/function.h:512:16
  #24 0x7ffff7d4e7e2 start_thread
  #25 0x7ffff7dd3800 __GI___clone3

Aborted

Expected behavior


@henryhchchc henryhchchc added bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team labels May 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working unconfirmed This issue has not yet been confirmed by the Sorbet team
Projects
None yet
Development

No branches or pull requests

1 participant
0