mfussenegger / nvim-jdtls

Extensions for the built-in LSP support in Neovim for eclipse.jdt.ls
GNU General Public License v3.0
979 stars 62 forks source link

Displaying err.data.cause.message if present #590

Closed lbrayner closed 7 months ago

lbrayner commented 7 months ago

While trying to run a test class I got the error org/eclipse/jdt/ls/core/internal/hover/JavaElementLabels. Inspecting the error object I got:

{
  code = -32001,
  data = {
    cause = {
      message = "org.eclipse.jdt.ls.core.internal.hover.JavaElementLabels cannot be found by com.microsoft.java.test.plugin_0.39.1"
    },
    message = "org/eclipse/jdt/ls/core/internal/hover/JavaElementLabels"
  },
  message = "org/eclipse/jdt/ls/core/internal/hover/JavaElementLabels",
 }

I think what's in data.cause.message is more useful.

mfussenegger commented 7 months ago

Thanks but I'd rather stick with the specified message. The data property can contain anything:

https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#responseError