starkware-libs / cairo

Cairo is the first Turing-complete language for creating provable programs for general computation.
Apache License 2.0
1.6k stars 489 forks source link

bug: vscode language server implementation issue #3884

Closed nirnaeth-arnoediad closed 4 months ago

nirnaeth-arnoediad commented 1 year ago

Bug Report

Cairo version:

cairo-run 2.1.0

Current behavior:

While coding on vscode this warnings appear on output section

Using Scarb binary from: /home/nirnaeth/.local/bin/scarb
Cairo language server running from Scarb at: /home/nirnaeth/.local/bin/scarb
Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete 
Server stderr> file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Server stderr> Semantic analysis failed. File 'file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo' does not exist.
Semantic analysis failed. File 'file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo' does not exist.

Server stderr> Semantic analysis failed. File 'file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo' does not exist.

Server stderr> Semantic analysis failed. File 'file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo' does not exist.

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Server stderr> Caught panic in LSP worker thread.

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
Caught panic in LSP worker thread.

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
Caught panic in LSP worker thread.

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47

Server stderr> Caught panic in LSP worker thread.

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
Caught panic in LSP worker thread.

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
Caught panic in LSP worker thread.

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47

Server stderr> Caught panic in LSP worker thread.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47
Server stderr> 
Caught panic in LSP worker thread.
thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/registry/src/index.crates.io-6f17d22bba15001f/cairo-lang-parser-2.0.2/src/parser.rs:1862:47

Server stderr> Caught panic in LSP worker thread.

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Complete file:///home/nirnaeth/cairo_projects/hello_scarb/src/hello_scarb.cairo

Server stderr> Hover file:///home/nirnaeth/cairo_projects/hello_scarb/src/lib.cairo

Any idea how to resolve this conflicts?

spapinistarkware commented 1 year ago

Can you check with scarb nightly?

nirnaeth-arnoediad commented 1 year ago

After updating scarb to scarb 0.6.1+nightly-2023-08-16 (cairo-run 2.1.0) output is:

Using Scarb binary from: /home/mburaky/.local/bin/scarb
Cairo language server running from Scarb at: /home/mburaky/.local/bin/scarb
Server stderr> thread 'main' panicked at 'called `Option::unwrap()` on a `None` value', /cargo/git/checkouts/cairo-f086c7e6d4098a68/f42b647/crates/cairo-lang-semantic/src/corelib.rs:551:60
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Server stderr> Caught panic in LSP worker thread.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
Hover failed. Failed to find module.
cwkang1998 commented 1 year ago

Can I take a jab at this issue?

orizi commented 9 months ago

Is this still happening?

mkaput commented 4 months ago

Closing as this looks like a stale issue.