Skip to content

Remove unwrap/expect calls everywhere except tests #2263

@xoloki-stacks

Description

@xoloki-stacks

Describe the bug
We're seeing an issue now in the LSP where certain actions can reliably cause the LSP backend to stop responding. The culprit is unwrap calls, which should only be present in tests not library or binary code.

To Reproduce
I can reliably get the native LSP (in zed in my, but probably emac as well) to stop working under certain conditions. On main (and I suppose on the release version as well)
For example, removing a closing )  and saving the file will cause the lsp to stop sending diagnostics

Steps to reproduce the behavior:

  1. Open a clarity contract in a LSP enabled editor
  2. Remove a closing paren
  3. Save the file
  4. See error

Expected behavior
The editor should display a diagnostic about the missing paren, and continue responding normally to LSP notifications

Screenshots

Environment (please complete the following information):
All editors on all platforms, with current main and probably all previous versions

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions