Skip to content

perlPath should be executed at the repository root #163

@delphinus

Description

@delphinus

I'm using carmel to manage Perl modules and execute the app. carmel command needs to be executed at the repository root, more precisely, the directory that has .carmel/MySetup.pm file.

# perl -c will fail not at the repository root
$ cd $HOME
$ carmel exec perl -Ilib -c /path/to/lib/MyApp.pm
Can't locate .carmel/MySetup.pm in '.'. You need to run `carmel install` first.

# move to the repository root, then perl -c works successfully
$ cd /path/to
$ ls .carmel/
MySetup.pm
$ carmel exec perl -Ilib -c lib/MyApp.pm 
lib/MyApp.pm syntax OK

When perlnavigator launches external processes for diagnostics, searching modules, and so on, it does not set cwd for them. So all features will fail when the editor has been launched not at the repository root. Can we use the repository root as cwd in launching processes?

$ cd $HOME
$ nvim /path/to/lib/MyApp.pm
# -> No diagnostics warnings are shown.

$ cd /path/to
$ nvim lib/MyAPp.pm
# -> Diagnostics are shown.
FYI: my perlnavigator settings in Neovim
{
  cmd = { "perlnavigator" },
  filetypes = { "perl" },
  name = "perlnavigator",
  root_markers = { ".git" },
  settings = {
    perlnavigator = {
      includePaths = { "./lib", "./local/lib/perl5", "./t/lib" },
      perlEnv = {},
      perlParams = { "exec", "perl" },
      perlPath = "carmel"
    }
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions