-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Allow other applications to hook into showerror
#70
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #70 +/- ##
==========================================
- Coverage 91.46% 89.65% -1.81%
==========================================
Files 4 4
Lines 246 232 -14
==========================================
- Hits 225 208 -17
- Misses 21 24 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Not quite sure what the coverage diff is about - it seems to be inconsistent in terms of what it compares? Or I'm clicking on the wrong thing, not sure. |
These were either not errors at all (just range definitions) or were in the application specific range, so not appropriate to keep in a more general library.
a690d26
to
5a7ab22
Compare
The original intention here was to keep the LSP specific ones around until the time that LanguageServer.jl can/wants to integrate the functionality, but since that would require compat bumping sooner or later anyway, might as well just remove them now and do a lockstep release with appropriate compat upper bounds and/or upper bounding previous versions in the registry. The question is just - is this a technically breaking release, since it changes the error message of LanguageServer.jl from e.g. |
Mh, not sure. The error type doesn't change after all. I don't mind tagging a 2.0 for correctness either way, but imho that wouldn't really be necessary. |
These were leftover from a previous version were the equal signs were aligned vertically. Since these constants have their own docstrings now, this is no longer necessary.
Yeah, I don't mind either way :) Whichever is more convenient to have this percolate through the dependencies without causing too much disruption. Is there some NEWS file or release notes specific to JSONRPC.jl that this should be mentioned in as a new feature? |
Closes #68.
This change allows other applications to customize
showerror(::IO, ::JSONRPCError)
depending on their specific needs and chosen meanings for their errors. It also introduces the fixed error codes as constants, to allow them to be transparently referenced in other places of the codebase.Regarding
serverErrorStart
andserverErrorEnd
- I don't know exactly how they're used in the VSCode extension/LS.jl (are the messages themselves matched anywhere?), so these could be added explicitly until those dependents are explicitly adding them toRPCErrorStrings
. I've added them for now to make tests pass, but having them implicit seems cleaner to me.For every PR, please check the following: