Features List #279
Replies: 30 comments 41 replies
-
Importing your buildUpon opening a new project for any supported build tool, you'll see a prompt to import your build. This should happen automatically in a new workspace and also when you change something in your build. Keep in mind that if you make multiple changes it a row, it may not prompt you every time because there is a refresh time so we don't constantly spam you with requests if you're making a lot of changes in succession. For some reason if you either ignore this request by saying |
Beta Was this translation helpful? Give feedback.
-
Triggering specific compilesApart from the default save, which triggers a compile for your current build target and it's dependencies, you may also find situations where you want to not only compile those, but also the inverse dependencies. You can use a cascade compile for this ( Since cascades can take a while, there is also a Cancel Compilation command ( For those times where things may get out of wack, there is also a Compile Clean command to both clean and then compile ( |
Beta Was this translation helpful? Give feedback.
-
Goto DefinitionIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Find referencesIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Find implementationsIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Hovers (plus inferred types, implicit params, and other synthetics)In order to make this work you'll need a mapping for If you'd also like the extra information shown in the |
Beta Was this translation helpful? Give feedback.
-
Goto super methodIn order to use this you'll need to have a mapping for In more advanced situations there is al an option to see the entire hierarchy and choose where you jump to using the Super Method Hierarchy command ( |
Beta Was this translation helpful? Give feedback.
-
RenameIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Insert type annotationIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
FormattingIn order to use this you'll need a mapping for |
Beta Was this translation helpful? Give feedback.
-
Signature helpIn order to use this you'll need a mapping set up for |
Beta Was this translation helpful? Give feedback.
-
Document symbolsIn order to use this you'll need a mapping set up for |
Beta Was this translation helpful? Give feedback.
-
Workspace symbolsIn order to use this you'll need a mapping set up for A couple extra things to note for using this:
|
Beta Was this translation helpful? Give feedback.
-
Workspace diagnosticsThere are a lot of way to view your diagnostics as the vim.diagnostic.setqflist() // all diagnostics
vim.diagnostic.setqflist({severity = "E"}) // all errors
vim.diagnostic.setqflist({severity = "W"}) // all warnings |
Beta Was this translation helpful? Give feedback.
-
Switching your build serverYou can switch your build server by using the Switch Build Server command ( |
Beta Was this translation helpful? Give feedback.
-
Worksheet supportBy default opening any Long output or printed linesIf you have very long output or you maybe print lines in a function, you see this indicated by Copying all the worksheet outputSometimes you want to be able to share some code with the output. You can do this by using the Copy Worksheet Output command ( |
Beta Was this translation helpful? Give feedback.
-
Analyzing stacktracesIf you have a stack trace that you'd like to analyze it, just copy it and then trigger the Analyze Stacktrace command ( |
Beta Was this translation helpful? Give feedback.
-
Find in dependency jars (useful for searching configs)If you'd like to search through files in your dependency jars to for example find values in a config or another type of file, you can do this using the Find in Dependency Jars command ( |
Beta Was this translation helpful? Give feedback.
-
Generating a BSP configIf you're using a build tool that can also be a build server, such as sbt or mill, Metals can also generate the |
Beta Was this translation helpful? Give feedback.
-
Info about Metals, locations of files, etcTo see all this information you can use the Info command ( You can also see information about all of your build targets and info about possibly misconfiguration in the server via the Metals Doctor command ( |
Beta Was this translation helpful? Give feedback.
-
Creating a new Scala fileMetals can create new files which will include a skeleton structure for the type of file and also the package name. There are multiple ways to trigger this. The first is with the New Scala File command ( The second way to trigger this is if you create a type that doesn't yet exist that you intend to make a file for, it will offer this to you when you trigger a code action via your |
Beta Was this translation helpful? Give feedback.
-
TVP SupportMetals has an LSP extension called the Tree View Protocol which can be used to provide various panels of information. NOTE: There are some Jumping into the tree structure from your code and vice versaNOTE: This also works for your external dependencies. |
Beta Was this translation helpful? Give feedback.
-
Show various formats of the fileMetals allows you to see your current file in various formats. The formats and their commands that are available are:
|
Beta Was this translation helpful? Give feedback.
-
Debugging supportThanks to the great work of mfussenegger/nvim-dap there is also support for running, testing, and debugging your code right in Running your codeSetting a breakpoint and looking at the current scopeExpression evaluationRunning your testsUsing code lensesYou can also directly trigger these via the |
Beta Was this translation helpful? Give feedback.
-
Creating a new Scala projectUnder the hood Metals calls g8 to do this. You can use this with the New Scala Project command ( |
Beta Was this translation helpful? Give feedback.
-
Creating a new Java FileJust like the feature to create a new Scala file, you can also trigger the "New Java File" command ( |
Beta Was this translation helpful? Give feedback.
-
Show Build Target InfoStarting with 0.11.2 (or the latest snapshot as of posting this) you can view all sorts of info about a chosen build target by using the |
Beta Was this translation helpful? Give feedback.
-
Toggling the Metals LogsThis feature is used to show you the Metals-specific logs for your workspace. Behind the scenes all this command does is issue a |
Beta Was this translation helpful? Give feedback.
-
Run Scalafix RulesNOTE: This feature currently requires usage of the latest Metals Snapshot
|
Beta Was this translation helpful? Give feedback.
-
This is an ongoing demonstration of features that exist while using
nvim-metals
.Feel free to subscribe to this to get notified when new features are added!
A couple things to keep in mind when looking at the examples.
telescope.nvim
along with the telescope extensionnvim-metals
provides to trigger all my metals commands. All commands are available this way. They are also all available with their:command
equivalents. For example:MetalsImportBuild
is the same as the Import Build command in the telescope extension.nvim-bqf
to give a nice preview of what's in my quickfix. So commands that will by default pipe stuff into my quickfix window will then be automatically previewed.Again, this is just my workflow. The beauty of the built-in LSP of Neovim is that you can mix and match all sorts of stuff to get the exact experience you want. The above extensions work great for me, but maybe not for you. You'll have to experiment or just use the default, that works too.
Features
Beta Was this translation helpful? Give feedback.
All reactions