bash-language-server icon indicating copy to clipboard operation
bash-language-server copied to clipboard

Fix incorrect hover documentation

Open hak33m16 opened this issue 4 years ago • 0 comments

Fixes hover documentation being incorrect for symbols that are already defined on path and adds in a test to verify that's the case.

However, the reason I'm filing as a draft PR is that I realized something interesting... The hover information won't be entirely accurate if the path symbol is used, then redefined and used in reference to the new definition.

For example:

ls

ls() {
  echo "ls override"
}

ls

The first and last ls will say that they're the "function defined on line 3" even though the first ls will call the actual path executable.

Wanted to ping you @skovhus and see if you had any ideas for what a good way of handling a sort of context-aware version of this PR? I only immediately see obvious ways to know if something is defined or isn't, since we don't have access to things as they're being parsed. I could be wrong/misunderstanding that aspect of it, though

hak33m16 avatar Feb 13 '21 01:02 hak33m16