Code Monkey home page Code Monkey logo

Comments (6)

LaurenceWarne avatar LaurenceWarne commented on June 11, 2024 1

Ammonite does not seem to have a way to define this inside a file and my ammonite is on the correct scala version.

You can specify the Ammonite version as a comment like // scala 2.13.8 before your code, see here: https://scalameta.org/metals/docs/troubleshooting/faq/#how-do-i-use-scala-2xx-for-my-script.

FYI you can also check more easily which scala versions are being used for partcular scripts using lsp-metals-doctor-run.

from lsp-metals.

kurnevsky avatar kurnevsky commented on June 11, 2024

It's defined in your build.sbt. Can you change this version in vscode? If you can then there will be a similar way to do it in emacs.

from lsp-metals.

EskoJTH avatar EskoJTH commented on June 11, 2024

I do not have build.sbt I'm running these as stand alone scripts. Previously everything worked pretty much perfectly in emacs. I haven't used vscode for a long time. There has been some ammonite support officially in metals for a couple of years though. https://scalameta.org/metals/blog/2020/07/01/lithium/ .

from lsp-metals.

EskoJTH avatar EskoJTH commented on June 11, 2024

In vscode it seems to default to correct version of the compiler for some reason. I didn't manage to change the version yet though. metals seems to say something like this to me:
2022.09.06 13:38:02 INFO no build target found for /home/esko/harjo/ammo/muodoton4typeClasses.worksheet.sc. Using presentation compiler with project's scala-library version: 2.12.13
Now I wonder what is "presentation compiler" and where is its version defined.

from lsp-metals.

EskoJTH avatar EskoJTH commented on June 11, 2024

Thanks a lot! This seems to have fixed everything. Somehow I did not find that line of documentation.

from lsp-metals.

LaurenceWarne avatar LaurenceWarne commented on June 11, 2024

Cool glad I could help 🙂

from lsp-metals.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.