Comments (7)
Whether this should go to the LSP was discussed here microsoft/language-server-protocol#109
Maybe we should have an additional interface for such things that clients can optionally implement. Longterm we will need to use additional interfaces for LSP extensions anyway to avoid breaking clients.
from lsp4j.
If it is possible for a client to send notification messages not strictly defined by the protocol, the current way of handling it in lsp4j... i.e. crashing the server... is not very nice.
As mentioned in the link above by @dbaeumer:
$ messages should/could be ignored since they depend on the implementation capabilities on the server. That is why I used the $ prefix.
We've implemented our own 'wrapper' to catch these errors, log them and ignore these. But perhaps lsp4j should just ignore these unknown messages by default?
from lsp4j.
I think they should at least be logged with warn level.
from lsp4j.
I think they should at least be logged with warn level.
Agreed. Especially if they are totally 'unknown' notification messages. However, if its a specific message, like say $/setTraceNotification
, then perhaps a decision can explicitly be made that that particular type of message is not one the server should want to handle. Then, dropping it silently might be okay too.
What I mean is, unless the warning serves a purpose, like, informing someone that they need to make a decision (whether they do or do not want to handle it), a warning seems right. If however the decision has already been made, then the warning is just a nuisance.
from lsp4j.
I changed the UnsupportedOperationExceptions to log warnings.
@dbaeumer wrote:
$ messages should/could be ignored since they depend on the implementation capabilities on the server. That is why I used the $ prefix.
Should we include this behavior in LSP4J, i.e. suppress the log warnings in case the method name starts with $
?
from lsp4j.
I would prefer to not do it.
from lsp4j.
Then we can close this issue.
In order to explicitly ignore a certain type of message, one must add a @JsonNotification
annotated method with an empty implementation to the service class.
from lsp4j.
Related Issues (20)
- Server side LSP request hangs if executed from a notification handler HOT 5
- Upgrade to recent BND HOT 8
- Build failing on `main` HOT 3
- ls4j as jar files HOT 2
- LSP4J 0.21.2
- Incorrect dependency in pom.xml for jakarta websocket HOT 1
- vtsls and typescript-language-server don't retrieve all references when trying to retrieve code references HOT 2
- Unable to identify the input message HOT 2
- ResponseErrorException is not propagated with the default exception handler HOT 3
- LSP4J 0.23.0 HOT 11
- Support for SnippetTextEdit HOT 4
- The problem of org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer HOT 5
- OOM when working with large files because of huge DocumentSymbols response HOT 10
- Why is `WorkspaceEditCapabilities`'s constructor setting `documentChanges` is deprecated? HOT 3
- Position's line and character fields should be long, not int HOT 6
- Provide FileOperationRegistrationOptions class HOT 4
- Add module-info to the modules HOT 2
- LSP4J 0.24.0
- Update Gson to accept wider version HOT 1
- LSP4J 0.23.1 HOT 3
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 lsp4j.