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

No autocompletion of uses of upvalues not at top level on lines created after sourcemap regeneration with project path using .. #645

Closed
Ketasaja opened this issue Jun 9, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@Ketasaja
Copy link
Contributor

Ketasaja commented Jun 9, 2024

Reproduction for post-1.29.1 0ebfa54:
luau-lsp_#645_reproduction.zip

  1. Open project in VS Code.
  2. aftman install.
  3. In server/code/init.lua, on line 2, start typing autocomplete.
    #645_working
  4. Delete what you typed.
  5. Insert at least two new lines within the function after line 2.
  6. Start typing autocomplete again.
    #645_not_working
  7. Delete what you typed.
  8. Save the file.
  9. Start typing autocomplete again.
    #645_working_again

sourcemap.json:

{
  "emitLegacyScripts": false,
  "name": "Reproduction",
  "tree": {
    "$className": "DataModel",

    "ServerScriptService": {
      "server": {
        "$path": "directory/../server"
      }
    }
  }
}
@Ketasaja Ketasaja closed this as completed Jun 9, 2024
@Ketasaja Ketasaja changed the title No autocompletion of uses of function parameters on lines created after opening file No autocompletion of uses of function parameters on lines created after sourcemap regeneration with project path using .. Jun 9, 2024
@Ketasaja Ketasaja reopened this Jun 9, 2024
@Ketasaja Ketasaja changed the title No autocompletion of uses of function parameters on lines created after sourcemap regeneration with project path using .. No autocompletion of uses of upvalues not at top level on lines created after sourcemap regeneration with project path using .. Jun 9, 2024
@Ketasaja Ketasaja closed this as completed Jun 9, 2024
@Ketasaja Ketasaja reopened this Jun 9, 2024
@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Jul 14, 2024
@JohnnyMorganz
Copy link
Owner

The underlying cause seems to be the interesting sourcemap, where the filepath for code is stored as "directory/../server\\code\\init.luau. This causes us to fail to match the "real path" of this file with the path that VSCode understands (because we don't normalise it correctly). That is a bug, thanks for the report!

Curious why your project.json is configured to do it like this, seems odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants