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

Possible bug in clojureDefinition.ts #26

Closed
simonvizzini opened this issue May 8, 2017 · 4 comments
Closed

Possible bug in clojureDefinition.ts #26

simonvizzini opened this issue May 8, 2017 · 4 comments

Comments

@simonvizzini
Copy link

Hey, I totally randomly stumbled upon your extension. I was just looking for some example VS Code language support extensions :)

While reading clojureDefinition.ts I noticed there is probably a return statement missing at line 31, or maybe I'm missing something. I think the code that follows should throw if info.file is null/undefined/empty? But apparently that never happened yet?

@avli
Copy link
Owner

avli commented May 9, 2017

Hi, @simonvizzini. We use JavaScript promise here, so it's totally fine to just call the reject() function which tells Visual Studio Code that attempt to find the definition was unsuccessful. Please see this page.

@simonvizzini
Copy link
Author

I totally understand Promises, but you are calling reject without a return, which means code execution will continue after the reject. In other places you explicitly call return reject(..)

@avli
Copy link
Owner

avli commented May 10, 2017

Very good point. It's actually me who doesn't understand Promises :-) I fixed the bug.

Thanks again!

@avli avli closed this as completed May 10, 2017
@simonvizzini
Copy link
Author

You're welcome! I use the same return reject/resolve pattern myself in my own code and it happened to me so many times that I forgot the return statement, so that's why this immediately caught my eye while reading your code ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants