Comments (13)
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.
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.
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.
This is how it looks now in Atom:
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.
@laughedelic I don't see the spinner in Atom, is that change on the plugin?
from metals.
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.
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.
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.
@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.
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.
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.
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.
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)
- Metals starts in non-Scala projects HOT 2
- Undesirable navigation for Mill's task
- Apache Spark build error: "'17' is not a valid choice for '-target'" HOT 3
- Hovers ignore renamed symbols from imports
- Can't extract method if there is empty line in between HOT 1
- Metals doesn't find all definitions depending on how the variable is used HOT 3
- Provided dependencies not seen while running HOT 8
- 2.x: "Show decompiled with javap" doesn't show lambdas HOT 3
- Latest release wrongly reported as snapshot HOT 2
- Mill BSP import bug HOT 3
- Bloop error when switching between minor versions of Scala 3 due to dirty cached compiler output directory HOT 1
- Metals on Java 17 starts Bloop with Java 8, leading to confusing error messages due to incomplete standard library HOT 9
- Lenses "jump" on refresh? HOT 1
- Long project compilation in some cases HOT 3
- didFocus should not run compilation if nothing changed
- Don't show completions in comments
- For pattern match show only things that have `unapply`
- DocumentHighlightSuite and SemanticTokensSuite failing in latest Scala 2.13.13 nightly HOT 3
- Different UX for hovering over extension methods with type arguments HOT 1
- Semantic highlighting and symbol information broken for extension methods with inferred type arguments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metals.