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

Issue passing Uri through Command.arguments array #210

Closed
daviwil opened this issue May 25, 2017 · 3 comments
Closed

Issue passing Uri through Command.arguments array #210

daviwil opened this issue May 25, 2017 · 3 comments
Labels
info-needed Issue requires more information from poster

Comments

@daviwil
Copy link

daviwil commented May 25, 2017

Hey Dirk,

I'm having an issue getting my CodeLens implementation to invoke the editor.action.showReferences command correctly. Here's the response I'm sending to the textDocument/codeLens request:

    {
      "jsonrpc": "2.0",
      "id": "3",
      "result": [
        {
          "range": {
            "start": {
              "line": 2,
              "character": 0
            },
            "end": {
              "line": 16,
              "character": 1
            }
          },
          "command": {
            "title": "2 references",
            "command": "editor.action.showReferences",
            "arguments": [
              "file:///c%3A/dev/vscode-powershell/examples/DebugTest.ps1",
              {
                "line": 2,
                "character": 0
              },
              [
                {
                  "uri": "file:///c:/dev/vscode-powershell/examples/DebugTest.ps1",
                  "range": {
                    "start": {
                      "line": 2,
                      "character": 9
                    },
                    "end": {
                      "line": 2,
                      "character": 19
                    }
                  }
                },
                {
                  "uri": "file:///c:/dev/vscode-powershell/examples/DebugTest.ps1",
                  "range": {
                    "start": {
                      "line": 23,
                      "character": 4
                    },
                    "end": {
                      "line": 23,
                      "character": 14
                    }
                  }
                }
              ]
            ]
          },
          "data": null
        },
        {
          "range": {
            "start": {
              "line": 21,
              "character": 0
            },
            "end": {
              "line": 25,
              "character": 1
            }
          },
          "command": {
            "title": "2 references",
            "command": "editor.action.showReferences",
            "arguments": [
              "file:///c%3A/dev/vscode-powershell/examples/DebugTest.ps1",
              {
                "line": 21,
                "character": 0
              },
              [
                {
                  "uri": "file:///c:/dev/vscode-powershell/examples/DebugTest.ps1",
                  "range": {
                    "start": {
                      "line": 21,
                      "character": 9
                    },
                    "end": {
                      "line": 21,
                      "character": 16
                    }
                  }
                },
                {
                  "uri": "file:///c:/dev/vscode-powershell/examples/DebugTest.ps1",
                  "range": {
                    "start": {
                      "line": 27,
                      "character": 0
                    },
                    "end": {
                      "line": 27,
                      "character": 7
                    }
                  }
                }
              ]
            ]
          },
          "data": null
        }
      ]
    }

The code lenses show up fine in my file but I see this error when I click on one:

image

Any ideas? Thanks!

@dbaeumer
Copy link
Member

dbaeumer commented Jun 6, 2017

@daviwil the only thing I can spot is that ':' is not properly encoded in the URI. It should be %3A. If this doesn't fix the issue can you provide a reproducible case I can debug?

@dbaeumer dbaeumer added the info-needed Issue requires more information from poster label Jun 6, 2017
@daviwil
Copy link
Author

daviwil commented Jun 6, 2017

Good point! I'll give that a shot.

@dbaeumer
Copy link
Member

dbaeumer commented Nov 6, 2017

This issue has been closed because it needs more information and has not had recent activity. Thank you for your contributions.

@dbaeumer dbaeumer closed this as completed Nov 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

2 participants