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

LSP crash when source file not in workspace #4143

Closed
kobyhallx opened this issue Jan 24, 2024 · 0 comments
Closed

LSP crash when source file not in workspace #4143

kobyhallx opened this issue Jan 24, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@kobyhallx
Copy link
Contributor

kobyhallx commented Jan 24, 2024

Aim

Open noir source document in editor with LSP support (vscode)

Expected Behavior

Noir source code opened normally with "some" LSP features available.

Bug

LSP craching with

[Info  - 7:52:42 AM] Starting LSP client using command: /mnt/user-data/jan/aztec-packages/noir/target/release/nargo lsp
{"codeLensProvider":{"resolveProvider":false},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"nargo":{"tests":{"fetch":true,"run":true,"update":true}},"textDocumentSync":1,"typeDefinitionProvider":true,"resolvedTextDocumentSync":{"openClose":true,"change":1,"save":{"includeText":false}}}
Failed to Resolve Workspace - Nargo.toml not found for file: "/mnt/user-data/jan/aztec-packages/noir/tooling/nargo_fmt/tests/expected/contract.nr" (jsonrpc error -32803)
[Info  - 7:52:42 AM] Connection to server got closed. Server will restart.
true
[Info  - 7:52:42 AM] Starting LSP client using command: /mnt/user-data/jan/aztec-packages/noir/target/release/nargo lsp
LSP starting...
[Info  - 7:52:42 AM] Starting LSP client using command: /mnt/user-data/jan/aztec-packages/noir/target/release/nargo lsp
{"codeLensProvider":{"resolveProvider":false},"declarationProvider":true,"definitionProvider":true,"documentFormattingProvider":true,"nargo":{"tests":{"fetch":true,"run":true,"update":true}},"textDocumentSync":1,"typeDefinitionProvider":true,"resolvedTextDocumentSync":{"openClose":true,"change":1,"save":{"includeText":false}}}
Failed to Resolve Workspace - Nargo.toml not found for file: "/mnt/user-data/jan/aztec-packages/noir/tooling/nargo_fmt/tests/expected/contract.nr" (jsonrpc error -32803)
[Error - 7:52:42 AM] The Noir Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

Reported by @benesjan - Thank You!

To Reproduce

  1. https://github.com/AztecProtocol/aztec-packages/blob/271de71e7cc9402bd85ea0ff22811f9a6b47403a/noir/tooling/nargo_fmt/tests/expected/contract.nr
  2. Plugin will communicate lsp crash

Installation Method

Compiled from source

Nargo Version

nargo version = 0.23.0 (git version hash: 602f23f, is dirty: false)

Additional Context

This happens because this specific workspace will lack noir workspace definition in form of Nargo.toml in ancestor folder structure.

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

@kobyhallx kobyhallx added the bug Something isn't working label Jan 24, 2024
@kobyhallx kobyhallx self-assigned this Jan 24, 2024
@github-project-automation github-project-automation bot moved this to 📋 Backlog in Noir Jan 24, 2024
@kobyhallx kobyhallx moved this from 📋 Backlog to 🏗 In progress in Noir Jan 24, 2024
github-merge-queue bot pushed a commit that referenced this issue Jan 24, 2024
# Description

## Problem\*

Resolves <!-- Link to GitHub Issue -->

LSP crash when source file not in workspace #4143

## Summary\*



## Additional Context



## Documentation\*

Check one:
- [x] No documentation needed.
- [ ] Documentation included in this PR.
- [ ] **[Exceptional Case]** Documentation to be submitted in a separate
PR.

# PR Checklist\*

- [x] I have tested the changes locally.
- [x] I have formatted the changes with [Prettier](https://prettier.io/)
and/or `cargo fmt` on default settings.
@github-project-automation github-project-automation bot moved this from 🏗 In progress to ✅ Done in Noir Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

1 participant