Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
superDross opened this issue Apr 5, 2023 · 0 comments
Open

Comments

@superDross
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant