Skip to content

Error occurs if analysis_unit_dirs is not set #323

@sinsoku

Description

@sinsoku

The file generated by typeprof --init are as follows.

{
  "typeprof_version": "experimental",
  "rbs_dir": "sig/"
  // "analysis_unit_dirs": [],
  // "diagnostic_severity": "warning"
}

However, when I start TypeProf with this file, an error occurs.

/Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/lsp/server.rb:107:in 'block in TypeProf::LSP::Server#add_workspaces': undefined method 'each' for nil (NoMethodError)

            conf[:analysis_unit_dirs].each do |dir|
                                     ^^^^^
	from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/lsp/server.rb:79:in 'Array#each'
	from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/lsp/server.rb:79:in 'TypeProf::LSP::Server#add_workspaces'
	from /Users/sinsoku/ghq/github.com/ruby/typeprof/lib/typeprof/lsp/messages.rb:64:in 'TypeProf::LSP::Message::Initialize#run'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions