Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [lsp4e-dev] Project types with LSP4E

One thing that gets lost is the ability to include a Package, so inside src/main/scala you get a whole directory tree rather than a single package object. Although File->New offers Java Package, when you come to create it because the host package is not a Java Package it will not create it (I think because it does not know where the Source directory is).

In fact, you can use a Java project and you’ll get packages and everything works. Metals just gets activated when you open a scala file. However, eclipse compilation does not take scala files into account, so this configuration works well if you only have scala files and no mixed java. I use this configuration to program the eclipse metals plugin itself, which is in scala. When doing this, you can even debug the scala program using the eclipse debugger and do step by step through the scala file, just by using setting a breakpoint in some java file that calls the scala file, this way.

To enable this, just give you project the Java nature.

Best regards,



-- 
Edmundo López B.

On September 25, 2019 at 10:49:44, David Goodenough (david.goodenough@xxxxxxxxxxxxxxxxxxxx) wrote:

On Monday, 23 September 2019 18:41:29 BST David Goodenough wrote:

I am trying to move from the old ScalaIDE (which was Eclipse with a plugin that provided Scala Projects and did things the pre-LSP way) to Eclipse with the newly released Scala Metals LSP plugin.

 

My projects used to be Scala Projects, but that relied on the code that did all the Scala stuff the old way, and now they are either Java Projects or just Projects.

 

I guess this is going to be a problem with all languages that move to using LSPs.

 

Is there a way for the Metals LSP plugin to set the project type? If not do we need something like an LSP project which the LSP code can decorate to, in my case, Scala?

 

The alternative would be to enable something like the Sbt Eclipse plugin to mark the project as a particular type of project (in this case an SBT project) without having to provide code which does things the old way.

 

David



One thing that gets lost is the ability to include a Package, so inside src/main/scala you get a whole directory tree rather than a single package object. Although File->New offers Java Package, when you come to create it because the host package is not a Java Package it will not create it (I think because it does not know where the Source directory is).

 

Oddly although this is a general project, the offer in File -> New still includes all the Java options (I suppose I did install the Java installer package). Given that they are uninstallable in that context, it is odd that Eclipse offers them.

 

For any JVM based language that uses Java style packages this could be a problem with using a general project rather than a java project.

 

David

_______________________________________________
lsp4e-dev mailing list
lsp4e-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://www.eclipse.org/mailman/listinfo/lsp4e-dev


Back to the top