Skip to content

Cannot go-to-definition when using source with string concatenation #811

Open
@superDross

Description

@superDross

Code editor

Neovim

Platform

Linux & OS X

Version

4.9.0

What steps will reproduce the bug?

This is a very rough example

Create the following file:

#!/bin/sh
# lib.sh

hello() {
	echo "Hello, world!"
}

Source the file via string concatenation:

#!/bin/sh
# main.sh

PROJECT_DIR="/Users/David.Ross/temp"

source "${PROJECT_DIR}/libs/lib.sh"

hello

Hover over hello and execute go to definition. This will not work.

Edit the main.sh to the following:

#!/bin/sh
# main.sh

PROJECT_DIR="/Users/David.Ross/temp"

source /Users/David.Ross/temp/libs/lib.sh

hello

Hover over hello and execute go to definition, this will now work.

Is go-to-definition not intended to work when part of the path is part of a variable?

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

No response

What do you see instead?

It should go to definition even when sourcing a path by string concatenation (var + substring).

Additional information

No response

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