Coder Social home page Coder Social logo

Show progress during startup about metals HOT 13 CLOSED

scalameta avatar scalameta commented on August 15, 2024 1
Show progress during startup

from metals.

Comments (13)

gabro avatar gabro commented on August 15, 2024 1

Ah right, without anything fancy, we could probably just use the onReady method on the client to show a spinner (without any details).

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

I'm not sure what is connection.sendStatus in that code and the "status" type of notifications you mention. window/logMessage has only 4 types of message (MessageType):

  • Error
  • Warning
  • Info
  • Log

We can use Log type, of course and then have a convention with clients to treat it specially, but I think this doesn't fit nicely with LSP.

from metals.

gabro avatar gabro commented on August 15, 2024

Ah, I thought this was a standard lsp features but it looks like it's a custom addition by eclipse lsp? https://github.com/eclipse/eclipse.jdt.ls/blob/0bba050b76ea867564bd6221e78782bc69d09cfa/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/JavaClientConnection.java#L39

I'll look it up better tomorrow.

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

This is how it looks now in Atom:

2017-12-03 22 48 54

No details about indexing, it just starts spinning when initialization request is sent and stops when it gets a response. And it works even without logMessage, because atom-languageclient allows you to hook on pre/post-initialization. I think vscode-languageclient should have something similar. Other requests usually don't take so long, so it's not essential.

I think that doing the same in VS Code client + implementing #85 will be enough: if you're wondering what exactly is happening, you can check logs. In VS Code there's a special panel for that, in Atom, unfortunately, it's still not implemented..

from metals.

cquiroz avatar cquiroz commented on August 15, 2024

@laughedelic I don't see the spinner in Atom, is that change on the plugin?

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

I think it's OK to implement vscode specific functionality if it's valuable and not too much work. A progress bar would be super nice for example, it's one of thing I I'd otherwise miss from IntelliJ.

from metals.

gabro avatar gabro commented on August 15, 2024

The problem is that we need to define some custom message over the protocol to communicate the progress from the server to the client. The Java LSP seems to do just that.

The editor-specific part is how to show the progress, but that's really tiny.

from metals.

ShaneDelmore avatar ShaneDelmore commented on August 15, 2024

This looks like it has at least some support from vscode team. Might be worth using until there is an official answer. microsoft/vscode-languageserver-node#261

from metals.

laughedelic avatar laughedelic commented on August 15, 2024

@cquiroz Try pulling the master and running sbt apmPackage again. I forgot to push an update of atom-languageclient which adds this feature. If it doesn't work, ping me on Gitter, I'll help you to debug it.

I think it's OK to implement vscode specific functionality if it's valuable and not too much work.

As @gabro says, it's not so much about vscode specific functionality. LSP just doesn't support yet this concept of progress communication. I think we should wait for the linked microsoft/vscode-languageserver-node#261 (note, it's already a pull-request) instead of inventing conventions.

I think if @gabro knows how to do #92 (comment), it's a good compromise solution for now, similar to what I shown in Atom.

P.S. sorry, closed it accidentally

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

This should be fairly easy easier to do now after #167 and #164, we need to first detect if the client supports this feature and then send notifications to the "status" endpoint

from metals.

olafurpg avatar olafurpg commented on August 15, 2024

After #332, actual indexing of project and dependency sources + semanticdb may be fast enough that it won't be necessary to report progress. The source file indexer processes ~800k loc/s.

I think it's worth revisiting this however once we have a bsp client that triggers compile in the build tool to report batch compilation progress in the build tool.

from metals.

pca006132 avatar pca006132 commented on August 15, 2024

Hi, LSP now supports progress report via $/progress: https://microsoft.github.io/language-server-protocol/specifications/specification-current/#progress . Wondering if it is possible to add an option to statusBarProvider to use this method, so editor plugins such as https://github.com/j-hui/fidget.nvim can handle this without the need to special case metals.

from metals.

ckipp01 avatar ckipp01 commented on August 15, 2024

Hey @pca006132 we actually have a feature request for this here: scalameta/metals-feature-requests#125. We have a couple different custom LSP extension that we use in instead of progress to enable us to do a few more things, but it is a good idea to default to progress when the client doesn't support metals/status.

from 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.