Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix URI parse error #38

Merged
merged 2 commits into from
Jul 28, 2022
Merged

Fix URI parse error #38

merged 2 commits into from
Jul 28, 2022

Conversation

tcx4c70
Copy link
Contributor

@tcx4c70 tcx4c70 commented Jul 27, 2022

  1. Replace "%3A" with ":": Some lsp client will escape ":" with "%3A", while the constructor of System.Uri will not unescape "%3A". So unescaping "%3A" manually before passing it to the constructor.
  2. Don't concat "file://" manually: Uri("file://" + path) is not equal to Uri(path) because path might contain chars that are interpreted (# and ?). For example, if path is "/mnt/code/c#/project", then the former will treat "/mnt/code/c" as LocalPath and "/project" asFragment.

tcx4c70 added 2 commits July 27, 2022 21:44
Signed-off-by: Adam Tao <tcx4c70@gmail.com>
1. Replace "%3A" with ":": Some lsp client will escape ":" with "%3A",
   while the constructor of System.Uri will not unescape "%3A". So
   unescaping "%3A" manually before passing it to the constructor.
2. Don't concat "file://" manually: Uri("file://" + path) is not equal
   to Uri(path) because path might contain chars that are interpreted (#
   and ?). For example, if path is "/mnt/code/c#/project", then the
   former will treat "/mnt/code/c" as LocalPath and "/project" as
   Fragment.

Signed-off-by: Adam Tao <tcx4c70@gmail.com>
@razzmatazz
Copy link
Owner

looks and works good for me (I am testing mostly on emacs w/ lsp-mode)

btw which editor did you hit this on?

@razzmatazz razzmatazz merged commit d99d3f9 into razzmatazz:master Jul 28, 2022
@razzmatazz
Copy link
Owner

and thank you!

@razzmatazz
Copy link
Owner

I will add changelog entry but it would be nice to add a remark which editor this fix was most applicable for

@tcx4c70
Copy link
Contributor Author

tcx4c70 commented Jul 29, 2022

btw which editor did you hit this on?

I'm using vim/Neovim+coc.nvim with the following config:

{
    "languageserver": {
        "csharp-ls": {
          "command": "csharp-ls",
          "filetypes": ["cs"],
          "rootPatterns": ["*.csproj", ".vim/", ".git/", ".hg/"]
        }
    }
}

@razzmatazz
Copy link
Owner

a new release has been issued that contains fixes from this PR:

@tcx4c70 tcx4c70 deleted the fix/uri branch February 28, 2023 12:30
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants