onivim / oni2

Native, lightweight modal code editor
https://v2.onivim.io
MIT License
7.83k stars 282 forks source link

Support for Scala Metals #3345

Open modoodalvi opened 3 years ago

modoodalvi commented 3 years ago

Installing VS Code extension scalameta yields following error message on restart

error
nolondil commented 3 years ago

Additionally, it looks like the extension scala-lang is no longer able to apply syntax colour once Metals is running. Any new Scala file has no syntax colouring but metals is able to compile it (or Scala file that was not open yet before metals started).

zetashift commented 3 years ago

You have to install this plugin too: https://open-vsx.org/extension/scala-lang/scala to make it work correctly! You'll still get an error but AFAIK it doesn't hamper functionality.

Also if anybody knows how to copy errors from the notifications pane I'd like to know!

image

modoodalvi commented 3 years ago

OK after installing the sclala plugin as suggested in the error message and by @zetashift , I get error This notification is sent quite often during manipulation of files.

Screenshot 2021-03-30 at 20 53 48

I am not able to create Scala classes. Error messages are not shown correctly.

bryphe commented 3 years ago

Interesting, I tried the Scala + Scalametals plugin on a simple, 'hello-sbt' project, and didn't see those errors. It might be something special about the configuration of the project.

A couple of bits of info that might help, @modoodalvi

It's possible this error, like the one in https://github.com/onivim/oni2/issues/3311#issuecomment-807758647 - occurs in VSCode, but doesn't get surfaced like in Onivim.

I am not able to create Scala classes. Error messages are not shown correctly.

Do you have more details about this - when you say not able to create Scala classes, is it because of the issues with the error display?

This is a case where the output from the extension would be useful in troubleshooting (#2365)

zetashift commented 3 years ago

I'm on Linux, using a recent nightly version.
However even when I'm editing non-Scala files I get an error:

  1. Here I'm just editing some Markdown files: image
  2. Here I am in a Nim project: image

EDIT: just wanted to say, even with the notifications things still work from what I've tried. EDIT2: From what I've tried a simple hello-sbt project doesn't notify me of an error either.

bryphe commented 3 years ago

Ah, thanks @zetashift ! I'm able to reproduce the error now, too - will help me figure out if it's a 'real' issue, or not.

I believe that, for some reason, this extension is getting activated inappropriately in this case - it shouldn't be running or activated at all in a nim project or a non-sbt project.

modoodalvi commented 3 years ago

Hi @bryphe, what is interesting: I created a really simple project to make the error message reproducible for you. However, I don't see the error notification anymore ??? Here is the project setup I use: https://github.com/modoodalvi/scala-test.

modoodalvi commented 3 years ago

I can also confirm the error message when installing the Nim plugin.

aldum commented 3 years ago

Hi!

I'd like to provide (an) additional data (point):

  1. I have a very obviously c++ project, where metals activates: https://i.gyazo.com/2b1e4a888a7e750d889c018f5e323a59.png (also, the folder did not show up in the explorer after generation, I suspect that's addressed in #3399)
  2. "cannot read property 'includes' of undefined..." - only for Scala 3 projects, which makes sense, I suppose, because it should be handled by a different extension, which is not in openvsx, thus not easily installable in onivim
  3. For Scala 2, this is not a problem, no error message. Completion looks like it's working. However, 'Create new Scala file' also doesn't seem to work for me, without any apparent error message.