Skip to content
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

Require doesn't recognize case sensitive file paths #436

Closed
sewbacca opened this issue Mar 2, 2021 · 6 comments
Closed

Require doesn't recognize case sensitive file paths #436

sewbacca opened this issue Mar 2, 2021 · 6 comments
Labels
bug Something isn't working os/MacOS The server is running on MacOS

Comments

@sewbacca
Copy link
Contributor

sewbacca commented Mar 2, 2021

Describe the bug
When requiring a module that has captal letters, the language server won't resolve the file path.

To Reproduce
Steps to reproduce the behavior:

  1. Create a new project
  2. Create a lua file with a capital letter in it. Return for a test a string, e. g. return "Hello World"
  3. Create a main.lua file
  4. require the file generated in step 2.
  5. See no suggestion

Expected behavior
See as a value "Hello World"

Screenshots
Lua-bug-capital-letters.gif

Environment (please complete the following information):

  • OS: Kubuntu
  • Is WSL remote? No
  • Client: VSCode
@sumneko sumneko added bug Something isn't working os/MacOS The server is running on MacOS labels Mar 3, 2021
@sumneko
Copy link
Collaborator

sumneko commented Mar 3, 2021

I have tried fix this. Since I don't have a non-Windows test environment, I am not sure if this fix will work. Please apply this fix manually and help me test if the fix works, thank you!

@sewbacca
Copy link
Contributor Author

sewbacca commented Mar 3, 2021

Sorry, but im not really experienced with VSCode Extension developement.
I followed the instructions on your page, however i couldn't find the task Install. I debugged anyway, and here is, what i found in the debug console:
Lua-Debug-Log-Sumneko.png
Then it just stopped debugging, so I couldn't debug my workspace manually.
I realised, that i had to install your extension from the market (steps in the prequisites), which i had uninstalled for the testing purpose. I don't know if this is just a coincidence and you released 1.17.3 during my debugging, or if the update was performed automaticly by debugging your project. However the bug was gone, when testing my project with the new version.

P.S. I noticed that it recognized the require path only, if i opened the corresponding file in vscode. Is there a way to scan my whole project automaticly?

@sumneko
Copy link
Collaborator

sumneko commented Mar 3, 2021

Oh, my intention is to manually modify the changed code locally, or directly overwrite the script file.
But it looks like the problem has been fixed.

I will not scan any directory when opening a single file, unless you set Lua.workspace.library in the global settings of VSCode, but this is not recommended.
If you wish to scan other directories, then you should use it as a workspace.

@sewbacca
Copy link
Contributor Author

sewbacca commented Mar 3, 2021

What I meant was:
In my project, are phantom warnings (e.g. undefined class or not resolving require calls). They disappear if I open the file inside my project with the corresponding definitions.

@sumneko
Copy link
Collaborator

sumneko commented Mar 4, 2021

If thease files are out of your workspace, use Lua.workspace.library. Otherwise, check Lua.workspace.maxPreload and Lua.workspace.preloadFileSize

@sumneko
Copy link
Collaborator

sumneko commented Mar 5, 2021

Should be fixed, closing.

@sumneko sumneko closed this as completed Mar 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os/MacOS The server is running on MacOS
Projects
None yet
Development

No branches or pull requests

2 participants