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

File commands have wrong arguments (e.g. Revert File) #44895

Closed
bpasero opened this issue Mar 2, 2018 · 3 comments
Closed

File commands have wrong arguments (e.g. Revert File) #44895

bpasero opened this issue Mar 2, 2018 · 3 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@bpasero
Copy link
Member

bpasero commented Mar 2, 2018

Steps to Reproduce:

  1. open a dirty file
  2. add a breakpoint here
  3. select File > Revert File
  4. see how the second argument is typed as a URI but actually is not

@isidorn I suggest you make a pass over the file commands, there are probably more cases. I only noticed this issue because I wanted to revert a file and that failed and the error message was not bubbling up because the error message assumes the second argument is a URI.

I guess this would also happen if running a command via command palette.

@bpasero bpasero added the bug Issue identified by VS Code Team member as probable bug label Mar 2, 2018
@bpasero
Copy link
Member Author

bpasero commented Mar 2, 2018

@isidorn actually it looks like you already fixed this issue sort of, I can no longer reproduce the error case. However, the command is still typed such as the second argument would be a URI which is dangerous because in this case where I run it from the menu the second argument is something else:

image

I think the commands need a URI.isURI check to make sure the argument is what was expected.

@isidorn isidorn closed this as completed in 7735281 Mar 2, 2018
@bpasero
Copy link
Member Author

bpasero commented Mar 2, 2018

@isidorn nicer than {} is to just write object as TypeScript type.

@isidorn
Copy link
Contributor

isidorn commented Mar 2, 2018

Nice idea, fixed via 15e754e

isidorn added a commit that referenced this issue Mar 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Apr 16, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants