rune icon indicating copy to clipboard operation
rune copied to clipboard

Does the VSCode extension work as intended?

Open scambier opened this issue 1 year ago • 12 comments

Hello, I've installed the extension, and configured it to set the full path to the rune-languageserver.exe. However, it looks like it's doing nothing, and I have literally 0 log from "Rune (Client)" in the Output window.

By "doing nothing" I mean that I have a .rn file open in vscode, with a few errors that go undetected. Syntax highlighting works, but that's it.

scambier avatar Jul 06 '22 14:07 scambier

Hm. Haven't tried it in a while, so not sure. I'll take it for a spin when I have a minute.

The vscode extension itself could use a bump. I think it's coded against a fairly old version of vscode by now, which shouldn't cause issues in theory but who knows?

udoprog avatar Jul 06 '22 15:07 udoprog

Also if someone is curious to pick up the vscode extension I'd be happy to provide mentoring instructions.

udoprog avatar Jul 06 '22 15:07 udoprog

In case the project is meant to survive for more years to come including support, I would love to help out. This could be my first contribution. How can I help out?

GlenDC avatar Aug 07 '22 13:08 GlenDC

@GlenDC Cool, you should join the Discord! The first step should be to get a development server up and running inside of vscode.

Mentoring Instructions

The following is a small guide on how to get up and running with vscode development:

The language server should "just work", by building and running it like this:

cargo run --bin rune-languageserver

The vscode extension itself is found in editors/code, and might do with some modernization. Following the Your First Extension guide should give a good idea of how it should work. I just tried to open the project in vscode and run the extension, but I'm not getting a development window at this point so this might be the first thing that needs to be fixed (!).

When you get a development window up and running you need to find the binary path of the built server and configure this as the (binaryPath setting). This path should be should be {project}/target/debug/rune-languageserver where {project} is the location of the project.

At this point you should be running a development language server. When you rebuild the language server (cargo build --package rune-languageserver) all you should need to do is reload the development window CTRL+P - Developer: Reload Window.

udoprog avatar Aug 08 '22 09:08 udoprog

Also note that I did try to build a completely new project using yeoman (yo code as shown in the tutorial above), and I got that to run. So porting the old extension to a completely new project structure might be a good way to move forward.

udoprog avatar Aug 08 '22 09:08 udoprog

Thank you very much for this great feedback. I think that's exactly the kind of comment anyone will need to contribute this issue to the project. I think for the time being I'm going to embed Rhai as it was also the original language I used for some earlier prototypes and it did work fine. As such I have no future need for Rune and will not contribute to it for the time being, my apologies for this anti climatic answer... I wish you further luck with the language though, in another universe I would have jumped on it as a contributor like a racoon on trash (they do that, right?).

GlenDC avatar Aug 08 '22 19:08 GlenDC

That's perfectly all right! Good luck with your project!

udoprog avatar Aug 08 '22 20:08 udoprog

Looking at the vscode developer console this error seems to be the problem:

Activating extension 'rhaiscript.vscode-rhai' failed: Cannot find module 'vscode-languageclient'

Which suggests the extension is not completely packed, see https://github.com/Microsoft/vscode/issues/30225

SWW13 avatar Aug 10 '22 09:08 SWW13

I wonder why that extension is named Rhai instead of Rune? Did you load the wrong extension?

schungx avatar Aug 10 '22 10:08 schungx

I wonder why that extension is named Rhai instead of Rune? Did you load the wrong extension?

Well, being able to read helps... I do in fact have both extensions installed and miss read the extension name while trying to debug why the Rune LS (and half of the syntax highlighting) is not working.


Off-topic: The Rhai extension however works as expected (syntax highlighting) and does not mention a LS support, which is probably why I didn't pay to much attention to the extension name.

SWW13 avatar Aug 10 '22 10:08 SWW13

Off-topic: The Rhai extension however works as expected (syntax highlighting) and does not mention a LS support, which is probably why I didn't pay to much attention to the extension name.

There is an LSP in the works under the lsp repo, but the published extension only has syntax highlighting, you're correct.

schungx avatar Aug 10 '22 12:08 schungx

(Proposed) fixes are available in PR #423 and #425.

SWW13 avatar Aug 10 '22 15:08 SWW13