Closed schungx closed 2 years ago
In Windows, expressions within strings interpolation does not seem to be processed.
For example:
const HELLO = 42;
let x = HELLO; // <- press F12 on HELLO to jump to definition
let s = `Hello = ${HELLO}`; // <- press F12 on HELLO does nothing
Yeah interpolated code is not yet processed, I opened an issue for it (#46).
in
statements not working.
Also throw
statements.
Strange behavior in VScode:
examples/main.rhai
(probably external.d.rhai
not yet indexed)Click on examples/external.d.rhai
(probably indexing it)
Open examples/main.rhai
again
BTW, I see that you need a definition file just to put comments in modules.
Should I, say, add the //!
doc-comments style to Rhai scripts? They should, like Rust, go to the top of the script, and be taken as that script file's documentation.
So, bar.rhai
can actually be simplified to:
//! Definition for "bar.rhai".
//!
//! Omitting the module path is the same as `module "./bar.rhai"`.
/// Some constant.
export const X = 10;
/// This function is private.
private fn cant_touch_this() {
}
/// This function is exported.
fn hello() {
print("hello");
}
(probably external.d.rhai not yet indexed)
That's weird, we should traverse the entire workspace after initialization and load all the files.
Should I, say, add the //! doc-comments style to Rhai scripts?
I'm not sure if they're worth the hassle, but yes, it'd make sense imo.
I'm not sure if they're worth the hassle, but yes, it'd make sense imo.
Adding a definition file is good in the sense that we can add all sorts of nice things to it later on.
However, if scripts always need another file just to attach module docs, that will be a chore...
That's weird, we should traverse the entire workspace after initialization and load all the files.
bar.rhai
has an error (print
again), so I'm not sure if that is tripping up all later files?
bar.rhai
has an error (
There are still issues with adding/removing sources to the HIR (#52), if you open the LSP logs, you should see a lot of panics probably. I want to hunt these down and write reproducible tests.
@tamasfe I'm pinning this repo to the top as this is going to be a material addition.
BTW, are you on Discord? If so, I can open up a channel for the LSP.
BTW, are you on Discord?
I don't normally use it, but sure, good idea, I'll join to make communication faster.
The Windows-specific issues are all resolved, and so I'll close this.
These are some of the issues I found running the LSP on Windows:
src/ast/rhai.ungram
must have LF line ending. Windows CR+LF line ending is not supported by Rowan. Git for Windows automatically converts all line endings to Windows-style when cloning.All Windows CR+LF line endings in Rhai scripts throw an
invalid input
error.print
seems to be unresolved, and it gives a hint saying maybe it should beprint
.It no longer works once you start editing the code. Before edit, popup's work fine. After editing anything, no longer.