sublimelsp / LSP

Client implementation of the Language Server Protocol for Sublime Text
https://lsp.sublimetext.io/
MIT License
1.66k stars 183 forks source link

Warn about missing scheme in the uri #2530

Closed ryuukk closed 1 month ago

ryuukk commented 1 month ago

More context: https://github.com/sublimelsp/LSP/pull/2527

jwortmann commented 1 month ago

Sorry but I would say we don't really need this print statement. With the latest update we already print to the console, but only if debug logging is enabled: https://github.com/sublimelsp/LSP/blob/a6b17a4aa4d10d8ddc225413d221c4241b877f8b/plugin/locationpicker.py#L34-L35

Also the "perhaps the scheme is missing?" is so generic that it isn't useful; it could also be that perhaps the file doesn't exist, or whatever...

And since a missing URI scheme is a bug in the language server, I'm unsure whether it's really necessary to handle it here. If so, I would say that it should be a proper implementation where parse_uri would raise a https://github.com/sublimelsp/LSP/blob/a6b17a4aa4d10d8ddc225413d221c4241b877f8b/plugin/core/views.py#L84-L89

and then it should catch this exception for example in https://github.com/sublimelsp/LSP/blob/a6b17a4aa4d10d8ddc225413d221c4241b877f8b/plugin/hover.py#L369-L370

(and it would need to be checked if there are other places in the code where it must be handled too)

ryuukk commented 1 month ago

I understand you don't want to improve anything

Therefore, you are right, you don't need this helpful error message, since you don't understand the context

I'm closing this

ryuukk commented 1 month ago

You have to do better than the competition if you want to attract people

Just sayin

predragnikolic commented 1 month ago

@ryuukk's your response to constructive criticism was defensive. @jwortmann offered thoughtful feedback, suggesting a more scalable and structured way of handling URI errors. Instead of engaging in a productive discussion, it looks like you seemed to take it personally, as reflected in comments like, "you don't need this helpful error message, since you don't understand the context."

It seems like you are misinterpreting @jwortmann’s feedback. This statement in my eyes is not true "I understand you don't want to improve anything". This might be a misreading of the situation. The feedback was more about proposing a more systematic solution rather than rejecting the idea of improving the error handling.

Rather than assuming that the feedback is dismissive, it is helpful to assume positive intent and engage in a constructive discussion. Asking for clarification or further discussing why a specific improvement was suggested could have fostered a better conversation.