opened
ferdaber
username_0
I have Solargraph as a language server on VSCode, and as of v0.39.11, it fails to start with the following error:
```
[NoMethodError] undefined method `match' for nil:NilClass
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/pin/yard_pin/method.rb:44:in `arg_name'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/pin/yard_pin/method.rb:35:in `block in get_parameters'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/pin/yard_pin/method.rb:30:in `map'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/pin/yard_pin/method.rb:30:in `get_parameters'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/pin/yard_pin/method.rb:21:in `initialize'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map/mapper.rb:61:in `new'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map/mapper.rb:61:in `generate_pins'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map/mapper.rb:18:in `block in map'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map/mapper.rb:17:in `each'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map/mapper.rb:17:in `map'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map.rb:291:in `process_yardoc'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map.rb:210:in `block in process_requires'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map.rb:187:in `each'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map.rb:187:in `process_requires'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/yard_map.rb:84:in `change'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/api_map.rb:121:in `catalog'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/library.rb:23:in `initialize'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/library.rb:377:in `new'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/library.rb:377:in `load'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/host.rb:278:in `prepare'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/host.rb:295:in `block in prepare_folders'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/host.rb:294:in `each'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/host.rb:294:in `prepare_folders'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/message/initialize.rb:14:in `block in process'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/benchmark-0.1.0/lib/benchmark.rb:293:in `measure'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/message/initialize.rb:10:in `process'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/host.rb:101:in `receive'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/adapter.rb:44:in `process'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/adapter.rb:17:in `block in opening'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/data_reader.rb:59:in `parse_message_from_buffer'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/data_reader.rb:35:in `block in receive'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/data_reader.rb:30:in `each_char'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/data_reader.rb:30:in `receive'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/solargraph-0.39.12/lib/solargraph/language_server/transport/adapter.rb:27:in `receiving'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/backport-1.1.2/lib/backport/client.rb:63:in `tick'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/backport-1.1.2/lib/backport/server/tcpip.rb:76:in `update'
/Users/fbudhidharma/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/observer.rb:197:in `block in notify_observers'
/Users/fbudhidharma/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/observer.rb:196:in `each'
/Users/fbudhidharma/.rvm/rubies/ruby-2.4.2/lib/ruby/2.4.0/observer.rb:196:in `notify_observers'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/backport-1.1.2/lib/backport/client.rb:121:in `read_input'
/Users/fbudhidharma/.rvm/gems/ruby-2.4.2/gems/backport-1.1.2/lib/backport/client.rb:102:in `block in run_input_thread'
```

It seems like it's failing to process a specific block of YARDoc but I don't really know how to trace it back. Is there some sort of debug mode for Solargraph so I can provide additional information?
Solargraph language server failing to start
issue
created
ferdaber
username_0
Update: it seems to be failing on parsing this specific gem's yardoc, but I still don't know how to get Solargraph to log what it's trying to parse:

```
[INFO] Loading bson_ext 1.5.1 from yardoc
```
comment
created
ferdaber
username_0
More information from some injection of `puts` statements:
`code_object.source`:
```c
static VALUE objectid_generate(int argc, VALUE* args, VALUE self)
{
    VALUE oid;
    unsigned char oid_bytes[12];
    unsigned long t, inc;
    unsigned short pid;
    int i;

    if(argc == 0 || (argc == 1 && *args == Qnil)) {
        t = htonl((int)time(NULL));
    } else {
        t = htonl(NUM2UINT(rb_funcall(*args, rb_intern("to_i"), 0)));
    }
    MEMCPY(&oid_bytes, &t, unsigned char, 4);

    MEMCPY(&oid_bytes[4], hostname_digest, unsigned char, 3);

    pid = htons(getpid());
    MEMCPY(&oid_bytes[7], &pid, unsigned char, 2);

    /* No need to synchronize modification of this counter between threads;
     * MRI global interpreter lock guarantees serializaility.
     *
     * Compiler should optimize out impossible branch.
     */
    if (sizeof(unsigned int) == 4) {
        object_id_inc++;
    } else {
        object_id_inc = (object_id_inc + 1) % 0xFFFFFF;
    }
    inc = htonl(object_id_inc);
    MEMCPY(&oid_bytes[9], ((unsigned char*)&inc + 1), unsigned char, 3);

    oid = rb_ary_new2(12);
    for(i = 0; i < 12; i++) {
        rb_ary_store(oid, i, INT2FIX((unsigned int)oid_bytes[i]));
    }
    return oid;
}
```

`code_object.parameters`:
```rb
[
  [nil, nil],
  ["self", nil]
]
```

`code_object.files`:
```rb
[
  "ext/cbson/cbson.c"
]
```
comment
created
castwide
username_1
Thanks for the details. I'm guessing you already found the `solargraph.logLevel` setting in VS Code.

I confirmed the error locally and will have it fixed in a patch release in the next few days.
comment
created
ferdaber
username_0
Oh I actually didn't know that! I just went into the locally installed gem and changed its source code directly to increase the default log level 🤷🏻‍♀️
comment
created
castwide
username_1
Fix released in v0.39.13.
comment
closed
castwide
username_1
issue