Repository navigation
Replies: 2 comments
|
The mechanism here is that EmmyLua registers a listener for workspace files. However, the listener used by IntelliJ via LSP4ij doesn't seem to be able to watch non-Lua files. I haven't verified this point, and this mechanism may not always work. EmmyLua has its own listening mechanism — we only start our own listener if the LSP client doesn't provide a registration mechanism. Your modification approach could try adjusting the capability parameters that LSP4ij registers with. |
|
[not sure if you saw my comment on #1283, copying it here] Thank you for the explanation on the PR about having a fast/slow path. I have seen this with VSCode, where the IDE, after a few seconds of inactivity does a full scan of all files in the workspace. How much of that support is supposed to come from the IDE proper and how much can be driven by the analyzer? Looking at the LSP APIs, it seems that the client needs to send a workspace/diagnostic to trigger that behavior. The current lsp4ij for IntelliJ does not implement workspace/diagnostic. I might start by addressing that issue first. GPT also pointed out to me that "There is also an analyzer-side gap to investigate: its workspace diagnostic loop is invalidated on saves and workspace reloads, but ordinary unsaved edits and watched Lua-file changes do not mark it for another pass." I will work in that direction, would you be open to reviewing a patch once I wrap that work up? |
Uh oh!
There was an error while loading. Please reload this page.
Hi,
I have been working on a development environment for the Factorio game using IntelliJ IDEA and I am using the emmylua-analyzer-rust analyzer for the lua language (Factorio uses Lua 5.2.1, so it is quite a bit behind 5.5 but it does not really matter for most things).
There is an existing development environment for VSCode (https://github.com/justarandomgeek/vscode-factoriomod-debug) which also supports emmylua and I modeled quite a bit after this.
One difference that I noticed early between vscode and intellij is refreshing when a file changes. intellij does not do that automatically.
GPT explained that (in summary)
VS Code has an additional diagnostic refresh cycle that can hide the missing server notification. LSP4IJ relies on the server to explicitly announce cross-file changes.andVS Code's language client polls workspace diagnostics, and the analyzer has a VS Code-specific refresh path. LSP4IJ refreshes open documents when the server explicitly asks it to.Is there interest in a patch that addresses this? It is a behavior change but it seems to be the right thing to me (and it works well with IntelliJ :-) )
All reactions