Skip to content

cwd setting does not seem to work #217

@sdondley

Description

@sdondley

I have this test module in sandbox/code/User.pm:

package User;
use lib 'dir';
use Blah;

use strict;
use warnings;

1;

My cwd is sandbox.

Module Blah is in sandbox/dir/Blah.pm. The module runs fine without out error from the command line. However, when I open the file code/User.pm module in neovim, they syntax checker gives me @inc warnings.

If I change use lib 'dir' to use lib '../dir', the syntax checker warning errors disappear, but of course the the code is broken. I tried addressing the problem with this config:

		lspconfig[lsp].setup({
			settings = {
				perl = {
					perlcritic = { enabled = true, severity = 1 },
					syntax = { enabled = true },
					cwd = "/Users/steve/Documents/my_perl_lib/sandbox",
					perlInc = {
						"/Users/steve/Documents/my_perl_lib/sandbox",
					},
				},
			},
			single_file_support = true,
			on_attach = on_attach,
			capabilities = capabilities,
			flags = {
				debounce_text_changes = 150,
			},
		})

But this didn't help.

For now, I'm using FindBin to get around the problem. Just wanted to report the issue here. I'm on a mac running neovim 0.10

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