You will not know about it though, as compilation silently fails, however when I remove the silent failing, we get the following error:
Panic: C:\Users\---\Documents\code\4-20-24\gleam\compiler-core\src\build\package_compiler.rs:123
called `Result::unwrap()` on an `Err` value: Parse { path: "c:\\Users\\Jason\\Documents\\code\\4-20-24\\examplemod\\src\\ct\\act.gleam", src: "import ct/reflection\r\nimport ct/item\r\n\r\npub fn get_item_from_give_code(give_code: String) -> item.Item {\r\n reflection.\r\n todo\r\n}\r\n", error: ParseError { error: UnexpectedToken { expected: ["A positive integer or a field name."], hint: None }, location: SrcSpan { start: 123, end: 128 } } }
This is a big problem because if we always need completely valid code to offer completions, we can never offer dot completions.
I'm not sure what the next steps are here but I am open to ideas. Maybe something like adding a placeholder for XX.\n to the parser that will allow us to finish parsing the line so that we can still get diagnostics?
The following code can't be completed using ctrl+space because it fails to parse.
You will not know about it though, as compilation silently fails, however when I remove the silent failing, we get the following error:
This is a big problem because if we always need completely valid code to offer completions, we can never offer dot completions.
I'm not sure what the next steps are here but I am open to ideas. Maybe something like adding a placeholder for
XX.\n
to the parser that will allow us to finish parsing the line so that we can still get diagnostics?