Request for help: ide-ruby outline view issues


#1

I have recently started writing a language server for ruby. I have the outline view working - mostly.

I get the call and respond to it, but each ‘container’ (like classes) that have children (like variables) gets duplicated at the root level and the children are placed in that copy instead of where I expect.

Here is the debug output of the JSON response to the textDocument/documentSymbol request:

[
  {
    "name": "RubyLanguageServer",
    "kind": 5,
    "location": {
      "uri": "file:///Users/kurt/Source/ruby_language_server/lib/ruby_language_server/version.rb",
      "range": {
        "start": {
          "line": 0,
          "character": 1
        },
        "end": {
          "line": 0,
          "character": 1
        }
      }
    }
  },
  {
    "name": "VERSION",
    "kind": 14,
    "location": {
      "uri": "file:///Users/kurt/Source/ruby_language_server/lib/ruby_language_server/version.rb",
      "range": {
        "start": {
          "line": 1,
          "character": 1
        },
        "end": {
          "line": 1,
          "character": 1
        }
      }
    },
    "containerName": "RubyLanguageServer"
  }
]

https://github.com/kwerle/ide-ruby/issues/2


#2

It turns out that the parentName won’t be used if the start line for the child is not within the range of the container. So with some tweaking/fixing of the range lines I was able to get this working.