jonnyboyC/kos-language-server

[BUG] Warning "Function xy already exists. Originally declared here" always refers to the current file

chrbkr opened this issue · 1 comments

Hey, thanks for this great tool!

I noticed a small bug that confused me until I realized what was going on (using Visual Studio Code):

When a function is already defined in ANOTHER file, I get warned, and the line number etc. is correct, but the filename specified is the current one, not the one where the function is defined.

Example:

  • currently editing file is launch.ks, containing "run once util.ks"
  • function foo is defined in util.ks at line 50
  • function foo is also defined in launch.ks at line 120

Problem:

  • In launch.ks at line 120, I get the warning:
    "Function foo already exists. launch.ks(50, 10): Originally declared here"

Expected result:

  • "Function foo already exists. util.ks(50, 10): Originally declared here"

Thanks for the issue, make it a lot easier these small edge cases! This should be an easy one liner fix I'll try to push out a small patch update sometime this week.