maurobalbi / glas Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
Add config (autoformat on save, edit, none) aswell
The order of downloading / loading the dependencies into glas is in the wrong order in a fresh project.
Originally posted by @MalinavyBusel in #13 (comment)
for example (| is the cursor)
import gleam/|
// this will autocomplete to `gleam/io`, `gleam/otp`...
when i select gleam/io, i'd expect it to have result like this
import gleam/io
instead it gives me this
import gleam/gleam/io
glas dies on casual editting
[Error - 7:46:14 PM] Request textDocument/semanticTokens/range failed.
Message: Panicked in textDocument/semanticTokens/range: called `Option::unwrap()` on a `None` value
Location: crates/ide/src/ty/infer.rs:73:28
Backtrace: 0: 0x10297404c - std::backtrace::Backtrace::create::hfe9b0c8b0decb4ab
1: 0x1026baff8 - glas::server::with_catch_unwind::{{closure}}::{{closure}}::h011b2297043d86a1
2: 0x102980144 - std::panicking::rust_panic_with_hook::h9b82bdc13ccb171b
3: 0x10297fed4 - std::panicking::begin_panic_handler::{{closure}}::hf609a05c98725eb7
4: 0x10297e87c - std::sys_common::backtrace::__rust_end_short_backtrace::hea0399d584786a2b
5: 0x10297fc88 - _rust_begin_unwind
6: 0x1029cc8ac - core::panicking::panic_fmt::hb4d79f470bcac176
7: 0x1029cc934 - core::panicking::panic::h200a44837950e7c1
8: 0x1029cc830 - core::option::unwrap_failed::h99ae810f9cb8e26d
9: 0x10292e5c8 - ide::def::hir::Local::ty::h0821ce4b439e2d67
10: 0x1028d3628 - core::ops::function::impls::<impl core::ops::function::FnMut<A> for &mut F>::call_mut::h8cdfbdc5c042d443
11: 0x1028cb64c - <core::iter::adapters::filter_map::FilterMap<I,F> as core::iter::traits::iterator::Iterator>::next::hbf367b77afb14868
12: 0x1028d1d30 - <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter::h62d39df5204a4195
13: 0x1028d9184 - ide::ide::semantic_highlighting::highlight::hc0e959ab6636565a
14: 0x1028c7340 - salsa::Cancelled::catch::h0d4f15666fa4a140
15: 0x1028c15f4 - ide::ide::Analysis::syntax_highlight::hc2a0b7e89f6c2a3d
16: 0x102731450 - glas::handler::semantic_token_range::h849fb8a2c0a5a690
17: 0x1026ba278 - glas::server::with_catch_unwind::hc4d72faa76c3ce05
18: 0x1026fdbb8 - tokio::runtime::task::core::Core<T,S>::poll::h0d25ebbda1e22aa2
19: 0x1026ee3b8 - tokio::runtime::task::harness::Harness<T,S>::poll::h68c7ef79021ecf1d
20: 0x10280bd30 - tokio::runtime::blocking::pool::Inner::run::hcb46ad0008e9644f
21: 0x10280ed88 - std::sys_common::backtrace::__rust_begin_short_backtrace::h662079a47ac8f7d6
22: 0x102806380 - core::ops::function::FnOnce::call_once{{vtable.shim}}::h92f3939abd732dbd
23: 0x102983d1c - std::sys::pal::unix::thread::Thread::new::thread_start::h028c70d4ad289ac9
24: 0x18af26f94 - __pthread_joiner_wake
Code: -32603
This would help, specifically for NixOS. At least for me, gleam isn't installed globally and I usually just configure my extensions with a PATH setting.
System: Ubuntu 22, rustc 1.75.0
This is the extension output example:
thread 'tokio-runtime-worker' panicked at /cargo/registry/src/index.crates.io-6f17d22bba15001f/salsa-0.17.0-pre.2/src/input.rs:106:32:
no value set for FileSourceRootQuery(FileId(0))
stack backtrace:
0: rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
1: core::panicking::panic_fmt
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
2: <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
3: <DB as ide::base::SourceDatabase>::file_source_root::__shim
4: ide::def::scope::module_scope_with_map_query
5: salsa::runtime::Runtime::execute_query_implementation
6: salsa::derived::slot::Slot<Q,MP>::read_upgrade
7: salsa::derived::slot::Slot<Q,MP>::read
8: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
9: salsa::QueryTable<Q>::get
10: <DB as ide::def::DefDatabase>::module_scope_with_map
11: salsa::runtime::Runtime::execute_query_implementation
12: salsa::derived::slot::Slot<Q,MP>::read_upgrade
13: salsa::derived::slot::Slot<Q,MP>::read
14: <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch
15: <DB as ide::def::DefDatabase>::module_source_map::__shim
16: ide::def::semantics::find_container
17: ide::ide::hover::hover
18: salsa::Cancelled::catch
19: ide::ide::Analysis::hover
20: glas::handler::hover
21: glas::server::with_catch_unwind
22: tokio::runtime::task::core::Core<T,S>::poll
23: tokio::runtime::task::harness::Harness<T,S>::poll
24: tokio::runtime::blocking::pool::Inner::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
[Error - 17:17:12] Request textDocument/hover failed.
Message: Panicked in textDocument/hover: no value set for FileSourceRootQuery(FileId(0))
Location: /cargo/registry/src/index.crates.io-6f17d22bba15001f/salsa-0.17.0-pre.2/src/input.rs:106:32
Backtrace: 0: 0x7fe5f48367fe - std::backtrace_rs::backtrace::libunwind::trace::h7d9d6777fb8bb20d
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: 0x7fe5f48367fe - std::backtrace_rs::backtrace::trace_unsynchronized::hf7cc901404488615
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x7fe5f48367fe - std::backtrace::Backtrace::create::hd75710cb70a42f36
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/backtrace.rs:331:13
3: 0x7fe5f4836740 - std::backtrace::Backtrace::force_capture::h7402a920a98228b8
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/backtrace.rs:312:9
4: 0x7fe5f452ec03 - glas::server::with_catch_unwind::{{closure}}::{{closure}}::h067ed652390b6a61
5: 0x7fe5f4842b36 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::ha49528d6bb122ccd
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2029:9
6: 0x7fe5f4842b36 - std::panicking::rust_panic_with_hook::hc412fca92650d4b2
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:783:13
7: 0x7fe5f4842882 - std::panicking::begin_panic_handler::{{closure}}::hf6e9952ead3e2c54
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:657:13
8: 0x7fe5f4841056 - std::sys_common::backtrace::__rust_end_short_backtrace::h1410a9c85ac94b3e
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys_common/backtrace.rs:171:18
9: 0x7fe5f48425e0 - rust_begin_unwind
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/panicking.rs:645:5
10: 0x7fe5f448c885 - core::panicking::panic_fmt::h2838d0515af9b2ed
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/core/src/panicking.rs:72:14
11: 0x7fe5f479292b - <salsa::input::InputStorage<Q> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::he0b0e02df5dc779d
12: 0x7fe5f47a90fa - <DB as ide::base::SourceDatabase>::file_source_root::__shim::h478deda2930e308f
13: 0x7fe5f477b177 - ide::def::scope::module_scope_with_map_query::h164de293526c30f2
14: 0x7fe5f478679a - salsa::runtime::Runtime::execute_query_implementation::h05e08b4b824059dd
15: 0x7fe5f47b3ba9 - salsa::derived::slot::Slot<Q,MP>::read_upgrade::h4143b2c7eab33d8d
16: 0x7fe5f47d15d4 - salsa::derived::slot::Slot<Q,MP>::read::hec8921686c06954d
17: 0x7fe5f4771735 - <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::hddad7f0d0b967ae0
18: 0x7fe5f47861de - salsa::QueryTable<Q>::get::h7f23c23d63a8012f
19: 0x7fe5f473981f - <DB as ide::def::DefDatabase>::module_scope_with_map::h88856ee117664130
20: 0x7fe5f47869cb - salsa::runtime::Runtime::execute_query_implementation::h06add4c949ed1ddc
21: 0x7fe5f47b51dc - salsa::derived::slot::Slot<Q,MP>::read_upgrade::h540d66a3b5fb77d0
22: 0x7fe5f47ceb3d - salsa::derived::slot::Slot<Q,MP>::read::h796e06c36b726a60
23: 0x7fe5f476e284 - <salsa::derived::DerivedStorage<Q,MP> as salsa::plumbing::QueryStorageOps<Q>>::try_fetch::h10f43a3e12f3071f
24: 0x7fe5f479a94a - <DB as ide::def::DefDatabase>::module_source_map::__shim::h31266f8d959614d0
25: 0x7fe5f4737c52 - ide::def::semantics::find_container::h83283511dd339c32
26: 0x7fe5f4797155 - ide::ide::hover::hover::hf436f79a802db256
27: 0x7fe5f47885b5 - salsa::Cancelled::catch::he9c8286c27095da6
28: 0x7fe5f4738a10 - ide::ide::Analysis::hover::ha716ef33cd2f8e9c
29: 0x7fe5f45522fc - glas::handler::hover::h34f9551c5c5d20fb
30: 0x7fe5f44f42d0 - glas::server::with_catch_unwind::h688c6907f203d18b
31: 0x7fe5f456bbf5 - tokio::runtime::task::core::Core<T,S>::poll::h5512e2189bd18e90
32: 0x7fe5f4518b16 - tokio::runtime::task::harness::Harness<T,S>::poll::h9dfbf7e146c85fc3
33: 0x7fe5f46a953c - tokio::runtime::blocking::pool::Inner::run::h97622e1faf281135
34: 0x7fe5f46b8fa4 - std::sys_common::backtrace::__rust_begin_short_backtrace::h00e99ec19de4aaad
35: 0x7fe5f46b99a9 - core::ops::function::FnOnce::call_once{{vtable.shim}}::hd46e71c8ef512c30
36: 0x7fe5f4847f05 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h0c19c267a854c212
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
37: 0x7fe5f4847f05 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::hc50bf08128f952fb
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/alloc/src/boxed.rs:2015:9
38: 0x7fe5f4847f05 - std::sys::unix::thread::Thread::new::thread_start::ha18af1a028ebd29e
at /rustc/07dca489ac2d933c78d3c5158e3f43beefeb02ce/library/std/src/sys/unix/thread.rs:108:17
Code: -32603
Hi, thanks for this extension, it really helps learning the language!
I don't know if it's Gleam LSP or glas, but this code is throwing syntax errors when there are letters in the hex values:
import gleam/io
fn dbg(i: Int) {
io.debug(i)
}
pub fn main() {
io.println("Hello from glas_test!")
dbg(0x0)
dbg(0x00112233)
dbg(0x0a)
dbg(0xa0)
dbg(0xaa)
dbg(0xAA)
dbg(0xAABBCCDD)
}
The program compiles and runs just fine, it's not a big problem for me.
The official gleam extension doesn't show this error, but it's too early to use it.
My setup:
import module.{Constructor as AliasConstructor}
type Constructor
the Imported Constructor resolves to the local constructor.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.