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

Handle Invalid WSL URIs #1057

Merged
merged 5 commits into from
Sep 7, 2022
Merged

Handle Invalid WSL URIs #1057

merged 5 commits into from
Sep 7, 2022

Commits on Sep 6, 2022

  1. Handle Invalid WSL Uri

    This adds another piece of logic to attempt to detect UNC WSL Uri as the workspace to open, and return a more informative error so the client can handle prompting the user.
    
    The UNC WSL Uri being passed is in the form of `\\wsl$\Ubuntu\home\james\some\path`. If the user wants to edit files in the WSL instance, they should be opening the workspace in the Remote WSL extension.
    
    When the VS Code sends the path to terraform-ls, it is urlencoded as `\\wsl%24\Ubuntu\home\james\some\path`. This fails `uri.IsURIValid`, which is incorrect because it is a valid path that needs to be decoded. Even if it is decoded, further on in the `uri` package we make assumptions about file paths that ignore the server portion of a UNC path, resulting in terraform-ls attempting to use `Ubuntu\home\james\some\path`. A future PR can address that.
    jpogran committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    25d9a8e View commit details
    Browse the repository at this point in the history
  2. updates

    jpogran committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    78a8637 View commit details
    Browse the repository at this point in the history
  3. fix test

    jpogran committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    2b10e21 View commit details
    Browse the repository at this point in the history
  4. new test

    jpogran committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    451869b View commit details
    Browse the repository at this point in the history
  5. feedback

    jpogran committed Sep 6, 2022
    Configuration menu
    Copy the full SHA
    6cd7bd0 View commit details
    Browse the repository at this point in the history