liquidev / lintplus

An improved linting plugin for the lite text editor.
59 stars 7 forks source link

lint command lags the editor nonetheless #2

Closed liquidev closed 3 years ago

liquidev commented 3 years ago

what a shame.

Well this is caused by the fact that the lint command still runs on the main thread. The proper way of solving this would be writing a Nim .dll/.so that would be loaded using package.loadlib in Lua. This library would provide some rudimentary IPC facilities, such as starting a new process and calling a callback once it's complete.

takase1121 commented 3 years ago

I previously wanted to try this out for my fallback font plugin. Problem is, lua in lite is linked statically so I don't think it can load a shared library. I might be wrong though.

liquidev commented 3 years ago

I'm aware of this, and have my doubts too. From my understanding of how the linker works it should theoretically work if the native module doesn't link to system Lua, but I don't know how hard that will be to achieve with my current plan of using Rust and mlua for the native module.

liquidev commented 3 years ago

Well, I just tried, and no dice. It won't run no matter how much I fiddle trying to get it to work.

I believe the only solution would be to build lite with a dynamically linked Lua. I'll try to get that to work and report on whether it works.

With as much hassle involved as getting async processes working, I think I may make this an optional feature as many linters don't really take that long to execute.

liquidev commented 3 years ago

As of commit ef61cdb, this is now implemented as an optional feature. The hassle to set it up is worth it though, and the difference is very noticable.