• Stars
    star
    459
  • Rank 95,377 (Top 2 %)
  • Language
    Lua
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 6 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Metals plugin for Neovim

nvim-metals logo

nvim-metals

nvim-metals is a Lua plugin built to provide a better experience while using Metals, the Scala Language Server, with Neovim's built-in LSP support.1 You can see all the available features here.

link to discord link to help docs

Prerequisites

  • Before you get started you need to ensure that you are using nvim v.0.9.0 or newer. If you're still on v0.8.x then you'll want to target the v0.8.x tag.
  • Ensure Coursier is installed locally.2
  • Ensure that you have all the LSP mappings for the core functionality you want setup.3
  • Ensure plenary.nvim is installed.4
  • Subscribe to this discussion which will notify you of any breaking changes.
  • Unfamiliar with Lua and Neovim? Check out the great :h lua-guide.

Installation

NOTE: This plugin works without needing to install neovim/nvim-lspconfig. If you have it installed for other languages, that's not a problem, but make sure you do not have Metals configured through nvim-lspconfig while using this plugin.1

Example if using packer:

use({'scalameta/nvim-metals', requires = { "nvim-lua/plenary.nvim" }})

Getting started

Settings and Commands

To view all of the available commands, check out :help metals-commands in the help docs. Similarly, to see the available configuration settings check out :help metals-settings.

Integrations

To see the full details on the available configurations, checkout out :help metals-integrations. The currently available integrations are:

Footnotes

  1. If you're familiar with nvim and LSP you'll probably know of nvim-lspconfig which also has a Metals configuration. Note that this is a very minimal version with no specific Metals commands and no Metals extensions. You can see more info on this here. DO NOT try to use Metals both with nvim-lspconfig and with nvim-metals as stuff will not work right. ↩ ↩2

  2. nvim-metals uses Coursier to download and update Metals. NOTE: On Windows, you should run coursier or cs.exe once from the command line as this is how it will install itself. Once this is done you should add C:\Users\YOURNAME\AppData\Coursier\data\bin to your path. To verify that it is properly installed you can run cs --help from a new shell. ↩

  3. By default methods for things like goto definition, find references, etc are there, but not automatically mapped. You can find a minimal example configuration here. ↩

  4. You're more than likely already relying on for other plugins. However, make sure to also have this installed as Metals uses it for things like Jobs, popups, and paths. ↩

More Repositories

1

metals

Scala language server with rich IDE features 🚀
Scala
2,090
star
2

scalafmt

Code formatter for Scala
Scala
1,434
star
3

scalameta

Library to read, analyze, transform and generate Scala programs
Scala
1,112
star
4

munit

Scala testing library with actionable errors and extensible APIs
Scala
428
star
5

mdoc

Typechecked markdown documentation for Scala
Scala
394
star
6

metals-vscode

Visual Studio Code extension for Metals
TypeScript
298
star
7

sbt-native-image

Plugin to generate native-image binaries with sbt
Scala
238
star
8

sbt-scalafmt

sbt plugin for Scalafmt
Scala
201
star
9

coc-metals

Deprecated in favor of scalameta/nvim-metals
TypeScript
166
star
10

metabrowse

Static site generator for code search with IDE features for Scala
Scala
107
star
11

tutorial

Scalameta tutorial
JavaScript
72
star
12

scalagen

WIP - Scalameta powered code generation
Scala
39
star
13

metaconfig

Small library for reading configuration into case classes
Scala
38
star
14

metals-feature-requests

Issue tracker for Metals feature requests
37
star
15

svm-subs

GraalVM native-image substitutions for Scala
Java
25
star
16

metals-eclipse

Eclipse Scala LSP plugin for Metals (WIP)
Scala
22
star
17

moped

Scala
19
star
18

lsp4s

Scala implementation for JSON-RPC and Language Server Protocol
Scala
19
star
19

metals-gitpod-sample

Scala
18
star
20

metals-sublime

Sublime Text package for Metals, a language server for Scala
Python
16
star
21

sbt-semantic-example

DEPRECATED - minimal template to play with the Scalameta semantic API
Scala
15
star
22

fastpass

Command-line tool to export a Pants build to Bloop
Scala
9
star
23

metals-languageclient

Language client library for Node.js Metals clients
TypeScript
9
star
24

mill-scala-seed.g8

A Giter8 template for a sample Scala project using the Mill build tool.
Shell
8
star
25

trees

Scalameta syntax tree definitions
Scala
7
star
26

semanticdb-sbt

Compiler plugin to build Semantic DB for sbt 0.13.
Scala
4
star
27

lsp-example

Minimal example to get started with implementing a language server in Scala
TypeScript
3
star
28

gradle-scala-seed.g8

A Giter8 template for a sample Scala project using the Gradle build tool!
Scala
3
star
29

scalameta.github.io

Scalameta website. No PRs here, this repo contains generated artifacts from https://github.com/scalameta/tutorial
HTML
2
star
30

maven-scala-seed.g8

A Giter8 template for a sample Scala project using the Maven build tool!
Scala
1
star