SF Scala: A Metals Retrospective By Chris Kipp
Recording: SF Scala: A Metals Retrospective By Chris Kipp
[Music] uh but yeah thanks uh thanks a lot for having me i'm really really excited to be here uh my name is chris and tonight i'm gonna do a short talk on meadows retrospective uh as i'm kind of giving the talk i have twitch up too so if you have questions at all feel free to just like shoot them in there and i'll kind of watch as i'm going along and answer anything i can but just a quick note about myself as i said my name is chris uh i'm a software engineer at lunatec here in the netherlands we have offices in the netherlands uh just outside of paris and then also a new one in brussels as well i'm a big neovim fan slr was saying uh how he can now use vim with metals that makes me extremely happy because yeah i uh i'm also a vim user uh i enjoy working on tooling i'm one of the current metals maintainers and i'm also the author of i said that the two vim extensions uh just to double check too that my screen is actually being broadcasted twitch because i have twitch up and i don't see my screen so i just want to make sure other people see my screen if that's accurate yes i see your screen um i don't know why i don't see it so never mind oh good all good all right so what's the plan for tonight so the plan is i'm just going to do a short intro i'll do an overview of metals in 2020 uh go over like a lot of the things that we added uh we'll look at the year-end survey results that we sent out at the end of the year we'll talk a bit about some of the common frustrations that people have with metals uh we'll go over some of the most commonly asked for features and then depending on like how much time we have left uh we'll go over a little bit of extra stuff maybe do a demo of some sorts if anybody has like questions about how do you do something with metals or does this work uh and then also we'll answer some some questions uh so first of all what is meadows uh if you can in the chat just like say i use metals because i'm curious out of the 50 some people that are here if there is like a large chunk of you that use metals or not uh but metals is a scala language server with rich ide features so that's that's a little uh like vague but basically what it means is it provides you language features like autocomplete go to definition find all references and all the types of things that you would expect an editor to provide for you as you're editing it works with any editor that knows lsp lsp stands for language server protocol if you're not familiar with it and i say more or less here because metals makes pretty heavy usage of lsp extensions so like any editor that supports lsp will work fine with metals it just may not have all the extra like functionality that metals can offer versus like an extension that's made specifically for metals and a question that i've seen recently a couple times pop up is well what is where does the name come from and the name is just scalameda which we use really heavily language server medals uh and a retrospective so what does that mean so at the end of the year last year we decided you know hey this last year we feel we got we like gained a lot of users uh we've seen like an increase in downloads and engagement and stuff so we really wanted to get a better picture of like where people were at with metals what they thought um what they wanted to work uh what they wanted us to work on and stuff like that so we yeah we gave a year-end survey which gave like a ton of useful information so that's that's what i mean by retrospective here and i also want to give a shout out to a few other people that like made metals what metals is plus there's obviously more than i have here on the screen uh but tomic uh from virtus labs on the far left hand side is kind of leading the charge now on metal's development he works full-time for the scala center and with virtuous labs uh and yeah he's sort of the one like leading the charge and and helping everybody else get contribute to it uh olafer and gabriella are both two people that sort of laid the foundation of what medals is and they're are still around and definitely help us out with questions and and everything else too and there's obviously like way more people than that that have made metals what metals is so a look at 2020. some quick stats we had 171 000 downloads and metals uh last year which doesn't tell a lot in itself to be honest because those are just like peer raw downloads doesn't say like how many you were unique or perversion or something but i thought it was a fun stat to have uh we had just over a hundred thousand vs code extension uh extension downloads that was our like most popular one uh the second most popular one behind the vs code extension was the coc metals extension which had just over 20 000 downloads we merged in just under 700 prs last year we had 13 different releases 46 contributors and 54 000 unique visitors to the meadows website so what are some things that we added this last year to metals uh i mentioned lsp before and lsp the language server protocol defines a whole bunch of different methods that you can implement or that every uh language server and client should kind of implement and it was actually kind of crazy looking through some of these because i i didn't realize that before last year we didn't have some of the stuff that i'll go over so it's pretty cool to to see everything that was added so things like text document implementations where you can find the implementation of of of any symbol or member all throughout your code base we didn't have that text document renames which allow you to rename symbols we didn't have we didn't have any uh any like foundation for code actions at all and this last year we added both just in general the ability to do code actions but also the ability to import missing symbols uh insert missing abstract members create new symbols import all missing symbols organize imports and insert infer type refactorings and uh organize imports i put that one in there twice maybe because i'm excited about it or because i didn't realize i put it in there twice uh we added debugging into uh metals this last year um this is one that often gets talked about in vs code but it actually is in multiple other editors as well uh so vs code supports it neovim supports it and emac supports it as well uh and i'm seeing some questions come in too so i'll let me finish this section and i'll go to them uh and i do have an image of vs code here and i purposely put vs code as the example for debugging because i wanted to to talk about this a little bit later so remember that i talked about debugging and that i put a picture of vs code uh we implemented worksheets which are one of my like most favorite features probably that i used super often they're actually implemented with mdoc if you're familiar with it which a lot of people use to parse mark or to type check mark down and to make like a docusource website um with it it's another scala meta project but yeah so it powers worksheets behind the scenes and as you can see it allows you to get real-time evaluations in your worksheet and then allows you to sort of hover over the evaluation result and get the full the full result and this works uh in almost any editor at all that will even editors that don't support virtual text we added the ability to analyze stack traces so you can just copy a stack trace do the metals analyze stack trace command and you'll get like a nice web view of the stack trace where you could just click and jump to the part of your code base where the stack trace is from we added tons of stuff to do with synthetics so things like show implicit and type decorations show implicit conversions in classes uh type decorations for definitions and you can kind of see that in the example i gave here the vs code where you see all the inferred types that are shown there and that's not actual text but that's virtual text that is being inferred and i purposely uh used vs code here again even though i'm a vim user because i'll talk about it in a little bit in the in the future here and we also added a ton of other features that honestly each could have like its own slide but just to name them all is we have a new file provider which will give you like a new class object case class or whatever type of file you're trying to create we have a rename preview so if you do a rename and that touches like a whole bunch of different files it will actually in vs code pop up and show you like a preview of all the files that it's about to to change uh super method code lenses which are turned off by default actually but uh once you turn them on you'll see virtual text next to uh like a method and you'll be able to jump to the super method and the parent methods of of that method uh ammonite support uh alex archambault actually like jumped in and just like dropped ammonite support into metals which is it was an awesome feature um a new project provisor using getter8 so you can bootstrap an entire new project uh with like two clicks basically in while you're in metals uh multiple build tool selection within a workspace meaning that if you have a project that has for example like a build sbt and a build.sc if you're using mill you can open that up in metals and it'll actually give you the choice are you trying to use spt here or are you trying to use mill here and it will like intelligently uh know that uh there's also spt file support for things like completions hover and stuff like that but it's not as advanced as the as the rest of the support we offer in metals but there is basic spt file support uh if you're using bloop as a bsp server at the moment not uh spt ironically uh customizable package exclusion so like if you're a scala developer but you don't want like java dsl akka stuff you can you can actually you can exclude those we added in spt bsp support which was really exciting uh and then also remote debugging uh which will yeah which is pretty self-explanatory so like there's a ton of stuff that we added this last year and like i said as i was going through this list i was like what like i can't believe we didn't have this like before last year which is crazy to see uh how much it how much we added so i'm gonna jump into some of the questions that came up so far so one of them was wasn't the point of lsp not to have an implementation of separate extensions for each editor why vs code and cc need different implementations from metals cool so that's a good question i'll kind of clarify what i meant by that so what i meant by that was lsp does provide like a base uh protocol for any editor and any language server that can follow but then certain editors obviously as you can think because of different languages there's very specific things they may need so in metals some of the things that we've needed to implement you just really couldn't do it with the base lsp support so then on top of lsp you create an lsp extension which then defines the protocol of that extra thing that you're trying to do so then the specific extension will be the one to uh implement that that lsp extension so there's like lots of extensions going on but that and enables and sort of unlocks extra features so like the tree view protocol is one where like in in vs code on the on the left hand side you see like a full tree view or any editor emac supports it uh vim supports it as well and i think your question was actually a little bit more towards like why do you need specific editor implementations instead of just using the editor itself uh and primarily is because uh you could for example like i'll use the coc example because i'm more familiar with it so coc why does it need a separate implementation for metals because you can use csc so c is for those of you that aren't vim users coc is like a lsp uh extension to make vim speak lsp and you could use metals with coc without an extension but you're just going to get very basic support you're not going to get automated you're not going to get automated installation you're not going to get any of the lsp extensions the extra ones that metals needs and you're not going to get like it's not going to know we do we use something called execute command a lot like i want to do a build import so if you don't have an extension that has build import button into it you would have to somehow like type out execute this command here's the name of the command send this to the server so it does a lot of stuff like that uh okay cool so i'll jump on a little bit the next thing i'll talk about was uh next thing i will talk about is the survey results so again if you took the survey thank you it was super useful to get insight from different people uh one of the first things uh that we asked was how important is metal support uh to you in the following editor uh and surprising to like literally nobody uh vs code like is wildly more popular than any editor uh as you can see here with probably vim being the second most popular then emac sublime text eclipse and then adam had like no support here uh and to be honest this was like the last uh the last thread i would say for us to decide if we wanted to just drop atom support completely so actually shortly after this we dropped to adam support um but here it kind of shows you the breakdown of metals users and what editors they're using uh and one question that came up like throughout the survey in multiple different places was why is there so much focus on va's code and uh that's a good question but also like a question that little that uh frustrated me a little bit because i was like oh it's not true the short answer is there's there's there's not like so much focus on vs code and i'm going to give you a few examples of that because a lot of the examples we get or a lot of the examples people give to say like oh this this killer feature is in vs code but it's not another stuff and one of those features is debugging and actually there's other uh editors that work fine with debugging support in metals uh emacs also use uh works great with debugging support if you're using another extension i think called uh dap mode this view that you're seeing on the screen right now uh is actually it's showing something that's not actually merged into metals yet i was really hoping to have it merged but it's not and what it's doing is it this this example is to show you that you can also do debugging in vim and running and testing and what this is doing actually is you're in a file that has multiple main methods and you can just say metals run there's no configuration you're not passing in any launch.json anything and it will automatically find the main methods in that build target and then give you the the option of which one you want to choose and the same thing for tests and and uh tests in a single file so you could just say test this file and it will test this file automatically or you can say test this target and it will test all the classes in that target that are test classes and that's something that's currently being worked on but debugging itself works in vim it works in emacs and it works in vs code as well uh another thing is i mentioned a little bit earlier about the analyze stack trace command how it opens up this like really neat like web panel that you can click on uh but there's some of us that don't like clicking on stuff because we don't want to use our our mouse so this is a really good example of coc metals of being able to use the analyze stack trace command and you don't have to use it like you can use it in combination with bloop cli even and that's what i'm doing here is on the right hand side i try running a project with bloop cli it doesn't work i have an exception so i can literally copy that exception from the terminal and go into metals which is the left hand side and then hit the analyze stack trace command and it will read into that and then it will i don't have a web view so actually give me another file which is like a hidden file uh with code lenses on it and i could use those code lenses to then jump to that part of the code base where the stuffing so uh we've like made sure to implement these features in ways that work in editors that aren't vs code basically another big one is like all these implicits like we have these really cool features to toggle implicits on and off or complicit conversions or inferred types and stuff like this and one of the first things we noticed when we were adding those features were oh look well this doesn't work so well if my editor doesn't have virtual text and not only does it have to have virtual text but it has to have inline virtual text and then the amount of editors that have inline virtual text are like pretty pretty few so as you can see here for example uh it has an implicit parameter that it's showing in the bottom section of the hover called with synthetics added and this will work for conversions uh inferred types and implicit parameters all that types of stuff and they're they're all under settings they're not turned on by default so you can get all these features and editors that aren't vs code and i also want to take a moment and just say too that like the from the very beginning of metals uh they did an amazing job of making sure all the features that were added were added in a way that were agnostic to editor so you can truly like do this do the vast majority of stuff in metals in any editor that's not vs code bs code is like an amazing editor so that's why a lot of people use it and that's also why a lot of people have the assumption that like all the stuff we're editing is for vs code when in reality it's it's really not and i also want to like take a moment and point out some of the some of the extensions that we have so we have a metals vs code extension uh we have the coc metals extension which works for both vim and neovim uh that was the kind of the first vim extension we had but then i also made another vim extension called neoven metals this one is targeting the next release of neovim which actually has lsp support built into it so coc metals is i would say more stable and more feature full ish and but it requires a whole other plug-in to allow lsp to work inside vim where neovim will not need that it'll by default have lsp built into it so that's what this plug-in is for there's a metal sublime plug-in there's a metals eclipse plug-in and then there's also an emax lsp metals plugin as well so lots of editor extensions and at the end i actually have another slide about like why this is important as well which will maybe get to the question that uh that was asked a little earlier as well uh the most common request we got in this part of the survey was will you support intellij and uh the short answer is no like we won't support intellij the longer answer is that metals was never intended or created as an intellij alternative like if you use intelligent intellij is incredible and in some ways like intellij is is i dare i say like far superior than metals like if you're using a very intermixed java and scala project like metals will not offer you the same level of support that intellij will um so the goal is not to convince people to move away from intellij the goal is more to provide an experience for people that already have an editor of choice and they may not want to use intellij so that's or they want and a lighter word alternative or something else and that goes a little bit into this question that we asked in the survey was why do you use metals it was actually like pretty mixed so uh some people said i wanted to use my favorite editor which this was me for example i wanted a lighter weight alternative to ides or i wanted more accurate compile errors that's another one we get is like i get little squigglies in places i don't want to get little squigglies and um we directly are getting diagnostics from the compiler so like if if it's if it's running you should be getting the same exact diagnostics from from metals um and then i wanted a fully open source solution was was also pretty high up there and as you can see metals has feature other ides don't wasn't very popular just because yeah the other ids such as intellij do offer a lot more support i see a question about scala 3 but i will skip it and get to it later because i have a specific section on scholar 3. uh i also see like imagine making an lsp client for an ide that's that's that's a good point and there actually are intellij plugins i think that implement lsp for intellij uh but yeah it's a good question like why because intellij works really well the other question we asked was build tools desired support like what is the what is the build tool that you wish we had support for uh not really surprising uh to us was basil came out on top of this there's a lot of people that want basil support uh next to that was fury pants seed ammonite generic workspaces and then make and i'll kind of break these down into a couple different sections so the first one is basil we get the question all the time like when are you guys going to support basil that's a tricky one because uh if you are a little bit unfamiliar with how metals actually works is you have your editor and i think i have a diagram in here somewhere yeah right here uh so i'll yeah i'm gonna skip this i don't know why i ordered them this way this doesn't make a ton of sense so just look at the diagram and ignore the top of the page so you have your editor and you have a build definition and that is communicating to your language server through lsp then you have your language server and that's communicating to your build server through bsp so by default the way that this works is you have your editor so let's say vim then you have your build definition which we're going to say is spt for example and then there's lsp communication between that and metals and then there's bsp communication between metals and bloop which is used by default so going with bloop in mind then well does bloop support bazel and that's the first question and the question is at this moment no there is no basal integration for bloop so the immediate roadblock block that we hit with metals is that we can't add bazel support because there's no bloop support for it if you look to the right hand side of the screen you'll see that there are a rule stat scala bloop integration that was drafted and it's a huge pr and a ton of work it just hasn't crossed the finish line uh so it's sort of like stagnated in this like will there be bazel support for bloop or bloop support for bazel and we don't really know so at the moment like maybe that will happen but we we are sort of beholden to uh this other stuff however uh one thing that may be a little bit uh more exciting in my opinion is uh the bazel bsp support and what this means is that instead of making sure that bloop can support bazel builds you could instead use bazel as a build server so similarly one of the things we added this this year was a sbt bsp support and what does that mean well that means that instead of using bloop you could use spt as a build server as well besides your build tool and that's what this diagram is showing here with bazel bsp which is actually a jetbrains project you could have your editor your build definition could be in bazel again you're communicating through lsp from your editor to metals and then the bsp communication instead of being from metals to bloop which has your which would have your bloop definition or your bill definition sorry from bazel uh instead you would just again be talking to bazel which would also be serving as your build server so this could be another way that we could implement uh bazel support but again it's it's more of a like we haven't really had the time to dive into it i i don't want to speak for others but like i don't know bazel well enough either to like really dive into the internals of how this would all work so it's something that once we have time we definitely want to to dive into it's just yeah it's more of a time issue than something else the other most common uh desired support for build tools are fury which comes up a lot which is ironic because like it's not stable yet uh there's seed and then also a generic workspace containing bloop i put these three together primarily because they're all actually similar in what would need to happen because all these rely on bloop basically because fury i believe when you're using fury you will also have a dot bloop directory which holds of your bloop files uh seed works in a similar way you can use seed i believe to generate a bloop definition as well for so offer all of your bloop files or you can just have a generic workspace containing bloop uh if you're unfamiliar with what the dot bloop directory contains uh i won't go that much into it but basically it will just have like a json file for every build target slash and well every build target so like in sbt terms you'll have like your build target configuration so like you'll have root uh root test and then root dash like i t if you have i t enabled um so uh why doesn't this work with metals right now uh for the most part a lot of the functionality we need will work if we just have a bloop directory however the tricky part is that for your editor it needs to send in a workspace route to metals and sometimes if you don't have a build file at the root uh then you won't like it won't recognize that there's a correct route there and it won't send in anything which either won't even trigger metals or metals will be like i don't see any build file so i'm just going to assume you're not in a scala workspace so there is a little bit of tweaking that we need as fury becomes more like widely used for example since it is like the pretty high up on the list of people wanting support for it uh we'll definitely work on that and figure out a way to correctly detect a fury workspace and if i'm not mistaking as well uh john purdey is working on a vs code extension that actually like wraps around metals and and has metals as a as a dependency and like offers even more in-depth theory support and stuff so that will happen for sure uh and for seed and bloop directories that's something we can definitely work on if people if people want it basically the next thing i want to talk about is metals frustrations so uh another thing we tried to do is like really read through all the comments in the survey and uh we had multiple questions that were open-ended about like what is like the one thing that we could do to make metal is a better experience for you or like or just like any other comments you have for us and a lot of times people's frustrations came out in those so we tried to do our best to like yeah just find patterns in that and and we weren't really surprised by any of them to be honest um so one of the things that people hate i even hate this is uh when you're coding in something and you like can't jump to a definition or you can't find the references or something if something's not working correctly and you look in the logs and you see like file name doesn't work for or sorry or like whatever you're trying to do doesn't work for your fault.scala there can be many reasons for this error and like as a developer sometimes that's like the most frustrating type of message you can get because you're like cool thanks like this tells me nothing really but the problem is is that there can be tons of reasons for why something's not working so like this is an accurate message however uh we do know some of this stuff and we do know more information than we're showing sometimes um so when something goes wrong like for myself personally i always say like uh if something goes wrong i want to know what went wrong uh when my build import doesn't work i want to know why it didn't work or if my worksheet isn't evaluating why is this not evaluating whoops uh this is something we're currently working on is that we're trying to make sure that when something isn't working inside of metals that we f like forward the information up to the user in a way that is like presentable because we obviously don't want to say like oh it doesn't work here's the here's the stack trace or here's the error like we want to do it a little bit nicer than that and just to give you like a couple examples that we've actually worked on recently like uh for example if you if you're doing uh ammonites and you're you're in ammonite script and for example a lot of people also don't know that uh at the top of the ammonite script if you want you can do like a um a comment and you can put the scala version there and it will metals will automatically detect that well it's not actually metals we use another library another library called ammoniterunner a project from alex and that will basically pull in that scala version of ammonites and then you can also do the same thing with a specific ammonite version so one of the things that we did was if that didn't work we just sort of failed and your ammonite scripts weren't imported and it was like well why aren't my ammonite support why isn't ammonite support working and we actually knew like there's a resolution error so we couldn't download this version of ammonite so we just buried it in the past so instead now we show a nice message like oh this version of ammonite with this scala version isn't available try a different one so things like that and same thing with worksheets and imports and worksheets so we're trying hard to locate parts of the metals experience that we do know more information but that aren't always floated up to the user a couple questions did pop up again uh which question which plug-in do you use in neovim to debug code it's a plug-in called neovim dap if you're actually i'll answer that question a little bit later because there's it's a more in-depth question than that and i want to spend a little more time on it because there's two two answers to it another thing that people talked a lot a bit about was stability like they want metals to be maybe more stable uh and i broke this into three different parts the first one was memory usage and i think thankfully we've like mostly addressed this one already because one of the issues was that bloop uh was like eating up a ton of memory uh and we had a fix for that um and then also metals was at times eating up a ton of memory and we had a memory leak which was fixed so for the most part this should be fixed if it's not fixed please let us know and we'll continue to work on it but that's something that we're definitely aware of is that we want to make sure that metals is as light as it can be because when working correctly like metals is extremely light uh stable and clear bsp connections what do i mean by that and why do i put a question mark by clear so i'll break this into two parts first of all stable like bsp in a lot of ways is like an abstraction that you don't necessarily need to even know about in metals like it's there you kind of just like start metals and you expect it to work you don't really need to know a lot about bsps so we want that to be stable obviously so you don't have issues with it uh and then we also i put clear because i see again like at certain times it's sort of an abstraction that you don't necessarily need to know a lot about so like we want it to be clear if you need to know about it but also like hidden if you don't need to know anything about it because then you don't need to like add the overhead of understanding it uh so now that we have the ability to like jump to multiple different bsp servers such as bloop or such of spt we really want the that information to be clear like what build server am i using how do i switch build servers if one's not working what's not working with it and how do i switch again we also really want smooth reloads to happen so like if you are changing your build definition you will get prompted that you need to reload it and then if that doesn't work well why doesn't it work uh one thing like is there honestly bloop and sbt uh aren't the greatest at this if like if you have something and that you screw up your build definition and the bsp reload triggers you don't always get like the best error message about when to run what went wrong you just get told that your import failed and you have to fix it so we would like to really improve that and then finally better recoverable state uh there's certain times where you're using metals and something just like doesn't work and like a lot of times people will just like rmrf bloop metals target just blow everything away and then we'll start again and try to like fix it and honestly like you should hardly ever have to do that um and we really want to try to get to a point where it's very rare that you do have to do that because um there is a lot of times where if metals get stuck into a state where it's on like where something's not working a lot of times it's like a pretty simple thing if you know what it is to get it working again and sometimes it's just as simple as like well there's a file over here that's not compiling correctly so it's not for compiling which means you're not getting semantic db for something which means you're not finding references for something and it's not working so you don't need to blow everything away for that you just need to fix the error so we're trying to get better at like really pinpointing what the issue is when you're in a state that's not working and how can you recover from it i'm gonna take a quick drink of water is everybody following any other questions or anything that you have so far about like things common frustrations with metals if you have a frustration with metals that i didn't mention at all feel free to drop it in the chat and i'll read it and maybe add it to the list um so this next section was uh things that we pulled from the survey that we felt that people would were sort of of the mindset of like this would be a killer feature if metals had this i want that scholar three goodness scholar 3 is the hot stuff right now everybody's interested in scholar 3. people want like the best support for it and they basically want like the same level of support that metals has for the rest of stuff in scholar 3. so like people want better completions they want auto imports better signatures they want to see inferred types like they can see with scala 2 now and the thing is is that we had to redo a lot of stuff in metals to add scala 3 support as you're probably fully aware like the presentation compiler of scala 2 and the presentation compiler of scala 3 which we rely on uh is completely different so uh we couldn't just like take a feature that we had for scholar 2 drop it in scholar 3 land and expect it to work it's almost like we had to like redo a ton of stuff part of the reason for that also was because stuff was changing so much so frequently that we didn't really have the scala meta parser completed yet and if you're not familiar with scala meta and i keep mentioning that uh because we use it really heavily and it's like an incredible technology that there are multiple people behind that have done tons of work on it uh and there's two parts of of scala meta and one of them that we use really often is the scala made of trees and what this is is just an ast representation of your code and we use this uh quite a bit to for a ton of different things and because this parser wasn't necessarily completed for scala 3 a lot of the things we may need scala made up for uh or a lot of the things that in metals that we needed support for skalameda to do advanced type of features we didn't we didn't have it yet so we were almost fully reliant on the scala 3 presentation compiler to to do all these features but then that gives you sort of a a limited uh subset of features or a limited subset of features that we didn't want to implement with this presentation compiler when we knew when scala meta would be released and we'd have trees and semantic db for that feature that we would just use that for it so we were sort of like beholden to the grammar finalizing and then being able to to do that one big uh question that we also get and i saw somebody like early on i think in the chat mentioned that they were excited about this that uh what about java like i want java support like and to be honest like we'll never probably have the level of java support and metals that you can get in intellij because it's not a java language server like there is a java language server it works really well if you're using like peer java projects however like a couple weeks ago uh i know i mentioned olaf before and uh he's sort of a wizard and just like does an insane amount of work uh and always a really incredible work uh but he recently started working at source graph and one of the projects that he worked on was uh lsif java and this project uh i'm i'm not super familiar with it so i apologize if this is a little bit wrong but source graph also allows for like intelligent uh code information to like find references and to jump around a really large code base all using these lsfia files however during the process of working on this uh he was able to enable semantic db in java sources and if you're unfamiliar with semantic db semantic db is this other scala the other part of scala meta which we use really heavily and as you can see here in this little like code snippet thing uh i just took like a main.scala and i ran something called meta c which is a command line tool uh from scala meta which will produce semantic db from a standalone scala file and then i use meta p uh which reads this into a readable format so here's the output and for if you're using metals uh every single scala file that you have in your project produces semantic db like this so you can kind of get the idea of what's going on here because you have like what symbols are in this this main file so we have you know object main extends app so you like we know that this is sort of a main method here we have method x we have method z and then we have all these different occurrences of other symbols all throughout this this file so as you can see we use this for things like how do you find references across your project how do you uh just do anything that you would need to do to find different things in your project so we really heavily use this and it's only for scala files right now so that's why for example uh you'll be able to be in a scala file jump to a java source but then when you try to jump to another source from that java file you just get blocked and it doesn't work and that code navigation doesn't work uh because there's no semantic db that was produced for those sources because it's a java source however now that there is the ability to produce semantic db for java sources that unlocks a whole bunch of things for us on the metals end because now if we have java sources that can also be producing semantic db code navigation between java and scala gets unlocked because we have the semantic d representation of our code base so that's something that's super excited the super exciting and i'm hoping we're able to like really jump into that this year uh refactorings uh we want people want new code reactions like the thing that we get mentioned all the time i have a little lower here is like i want to be able to extract stuff like i want to be able to extract this into this method over here or i want to be able to inline this thing uh i want better support to move files around and to like automatically update the name of the package and all the imports get like changed to match and there's a whole bunch of other stuff but time like all these refactorings are totally great and there's tons of opportunities for them they just take a lot of time another thing we get a lot that people want a lot is multi-workspace support so this is something for example that eclipse did a really great job at in the past of like i have three projects they all have their own build file they're all separate i want to like load all of them up and i want metals to like know about them and i want to be able to navigate between them or do a refactoring that like impacts other projects where right now in metals you can't like we need a single workspace route so like you can open my awesome project my other project or yet another project but you can't necessarily open all three of them at the same time or you can't have like a mixed project with like a front end back end and the back end located here and you want to like open it the route in one place and then metals knows exactly where like it should work like it doesn't that part doesn't work great um we that is something we're aware of and it's something we want to work on but it's implementing something that we like don't have support for at the moment in metals and it also is like a pretty large refactoring to work with multiple workspaces so it's something that's on our radar better support for non-compiling workspaces this is probably also the other thing we get the most uh questions about i don't have a lot of information to be honest on this one because this is a really large problem and because we are reliant on things like semantic bd db so heavily at the moment we're reliant on a source to be able to be compiled before it can produce semantic db and if it can't be compiled it can't produce semantic db which means that we're limited in the types of things that we can do so there are different ideas of how to get around this but they're again ideas that would take a lot of work and would you pick pretty large refactorings possibly um so yeah it it's a combination of we need somebody who knows things like semantic db well enough and also somebody who's like willing to put into effort to do these things and here are some extra thoughts and reactions because i also realize that we're coming up on time here we plan to do a v1 release this year uh what does that mean uh nothing it just means we're going to release v1 basically uh it's exciting like we've we've added a ton of support this last year uh basically what it means is that this year we don't want to focus on adding a whole bunch of ton of features we basically want to focus on adding scholar 3 support up to the level of what we have for scholar 2 and then solidifying solidifying and solidifying the current support that we have making sure things are stable making sure things are clear making sure installation works perfectly making sure things like proxies that that's another thing i didn't really bring up is like we get a lot of questions about like i'm behind this proxy and it's not working correct and and as you know like the jvm ecosystem is super fun because like corsier is doing it one way and then sbt has got its way to do it and bloop's got another way to do it and metals is doing it so like you have all these different ways of like figuring out how to like get metals to work correctly behind a like a proxy but that's something we're aware of we're also trying to work on so the plan this year is to do a v1 release have a big party about it people will be happy we'll probably do like some type of stream or something answer questions for people uh but the focus is on getting scholar 3 support and making sure metals is stable and a note about extensions which is what somebody asked a little bit about earlier having a metal specific extension for your editor makes a huge difference because like bare bones you get bare bones experience like you do get things like go to definition works find references work or maybe renames work but anything extra is not going to work there's not going to be an automatic way to import your build necessarily there's not going to be a way to choose to do a cascade compile instead of a normal compile uh metals isn't going to be installed automatically like there's so many different things that like an extension can help with the metals experience especially because metals does make pretty heavy uses of lsp extensions they need to be implemented in editor also automate stuff that can be automated like i said there's some editors right now if you are going to use metals for you need to like manually use corsier to install it like that is pretty easy especially now that we have like a like a metals uh executable in the main uh corsier channel so you can just do cs install metals like that's super easy but um be even better if you didn't have to do that and then also things can be done in line with the editor like if you're a heavy emax user or vim user you know that you like really care about how your editor is set up so you want to do it a very specific way in line with the editor so uh all the extra things that you have around the metals experience can be done in that way so extensions are extremely important and it's also a great way to contribute to the project because those of you who are using an editor maybe besides vs code or vs uh and you have like pain points with it they're totally hackable and able to be uh edited and stuff uh one other point i want to bring up is that there was a couple points in the survey where people seem to be concerned that like you know scala id is gone now what happened is metals gonna be gone like how do i know metals is gonna stick around uh and i wanna like assure people that metals is not going anywhere like the scala center is very invested in metals and is behind metals virtus lab is extremely invested in metals they have multiple people that are working full time basically on metals or we're on the metals ecosystem because there's a lot of other tools related there my own company as well where i work lunatec is also like super gracious with their time and gives me sometimes multiple days a week to work on medals so like uh with there's like both community support for medals and then also like business support and scholar center support for metal so like rest assured to know that like you're not going to wake up tomorrow and medals is going to be like a dead project also documentation helps if you have something in metals that isn't working great or that you're confused about uh documentation always really really helps like for us that are working on metals all the time and are like diving into things we very like quickly forget that like certain things that are extremely clear to us like are not clear to other people or things that uh you know how do i do this in metals and it's like well you just do this this and this like it's really clear like that's not clear to everybody because if they've never done it before it's not written anywhere necessarily so please do help with documentation let us know if something's missing from the docs we'll totally add them we're also like very open and uh quick to respond on the various channels that we have so please reach out to us if that's um something that you think you can improve on that's pretty much it i feel like i went over like a ton of stuff uh i hope that was informative i hope you get a better idea of like all the stuff that was added in 2020 i hope you have a better idea of uh where we're headed this next year and yeah so let me look to see if there's any questions in here um so i'm glad to see the scala centers google of course yes yes this so uh this this issue or sorry this comment was that the scholar center has applied for the google summer of code and there's a large project list and there's quite a few metals projects that are listed on there and one of them is added mixed scala support for mixed scala java code bases so that'd be super cool if that would happen uh scala stewart apparently has ls lsp support not really sure what that is just check this out oh yeah lsp sport for intellij yeah so i'm pretty sure like i said there are some lsp support plugins for intellij but they're not maintained by they're not like maintained by intellij they're just like community plug-ins so we probably wouldn't yeah i think i went over that pretty well enough that i don't have to do more uh question which plug-in do you use with new of mdbt-bug code code great question so it depends on if you're using coc metals or if you're using neo-vim metals if you're using coc metals uh there's integrated support for a plug-in called vimspector which only works if you're using neovim with coc metals and vimspectr is a great project and it offers support if you look in the readme there's even a section about it if you're using neoven metals then there's i'm working currently on an integration with a great lua plugin called neovim dap and dap stands for debug adapter protocol and it's what's needed in the client side in order to yeah to make debugging stuff work uh how did the name of metals come about that was already answered uh hi chris emax frustration question above thanks did i miss that yoya just my emacs lsp metals scala experience while just typing burn cpu introduces keystroke latency laptop runs hot had to switch off yeah so without knowing more information i don't have a whole lot to help you with probably but i would say things to look at uh yeah jump on something like top and see like what's actually eating up all the memory is it bloop that's running in the background that's that's eating it up is it uh metals that's running and is eating it up and if it is metals then please let us know if it's bloop let them know uh if it ends up being like lsp mode or something for some reason then yeah you kind of you kind of have to like figure out which part of the chain is like is causing the memory issues um so yeah uh regarding scala id yeah exactly so eclipse eclipse if you saw on the chart that we had like the eclipse usage is extremely low so uh if you have a project like scala ide that's really tied to an editor it's really hard to maintain a project like that if you have a very small amount of users like honestly it's just not worth it and that's one of the things that lsp kind of aims to address is that uh there's wider range of support because there's uh every editor that supports lsp can use it so yeah it's a really good point that wasn't like a jab at scala id or anything at all like great projects so any other questions that people have or anything question is the new feature you showed for run test will it replace vim test uh i don't know what vim test is actually is vim test a a plug-in uh specific for metals or is it a plug-in that's agnostic too like the language server vim test run your test at the speed of uh i'll say yes it'll replace this for me anyways or uh yeah because i think so this is like my 10 second look at this to understand what it probably is i'm pretty sure that these are actually just using spt and bloop directly to run these tests with are totally fine whereas if you're using something like neovim dap for example you have the full debug adapter protocol at your disposal so where you can use this for example to just run a test and get the results what i didn't show was that you can also set breakpoints and step in and step over and all that type of stuff with something like neobimdap as well where with a project like this you wouldn't necessarily be able to do that so this is probably great if you're just going to run or test but probably not great if you want to do more in-depth like debugging and stuff like that that's a good question anything else thank you so much chris for awesome talk and uh coming to scholar to give the talk selfishly i really appreciate all your work on uh metals and the integration so thank you so much yeah and it makes me happy to hear when people are using using it yeah yeah just just i remember i remember setting up metals before the clc metals plug-in and it was like a little annoying to have self-configured and download executable put it in your path and yeah there's a lot of ceremony about that i don't but that i don't have to do thanks to your work so super appreciate that thank you yeah one thing that's really cool is like for example on coc metals like something that i think maybe isn't clear and this is the same with vs code as well is that uh when you actually start up metals through vs code or through coc metals you're not actually starting an executable necessarily we're using corsier to like grab the full class path of everything that it needs to run metals and to to start it um so you can actually like be be working on metals and do a publish local and just restart vs code and you automatically have like the new version of metals that was published there you don't even have to like click install or do anything it's pretty it's pretty cool that's awesome on that topic um i would love if we could have a speaker do a talk on course here more i don't think there's enough online content of course here and it's like a unsung hero of two to many of us um yeah if you know anyone in the scholars who can look like i tap for doing a talk on at some point let me know really i mean you can always maybe ask alex if he's willing to do it himself since he's the he's the wizard of corsier uh but i also know that the scala center uh in collaboration with 47 degrees and and with uh up with us at lunatec uh one of my colleagues eric who's our cto in the belgian office actually just did a video on how to set up scala your full leg and scala environment using core ca and that video i think just aired like yesterday or two days ago so it's a cool video to check out and i believe they have more videos upcoming as well yeah awesome that's great it's great fabulous yeah great uh thank you both william and chris for coming to today's event uh our next event is currently scheduled for april 14th it's an introduction to cat sports by jeff lewis um if anyone else in the audience would like to do a talk at scholar let me know i personally quite like the side of the morning slot so we get more viewers from europe and usa and of course both women chris open invitation for you to come back whenever you can for more talks and if you don't want to go to please come back as an attendee yes thank you so much great great well um if there's no more questions i guess that's a wrap that's a wrap for today and hope to see everyone on the april 14th keep in touch and um thanks for attending today and thanks to our speakers for the talk and thanks for joining joining us on zoom as well appreciate it thank you seller for organizing no thank you pleasure pleasure thank you so much it's amazing and i hope i didn't cough too much to annoy everyone no it's great and yeah thanks for having us great well the have a great weekend i'll see you soon at another event take care bye bye bye you