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

Don't use activeEditor inside provide-function #1

Closed
jrieken opened this issue May 9, 2018 · 2 comments
Closed

Don't use activeEditor inside provide-function #1

jrieken opened this issue May 9, 2018 · 2 comments

Comments

@jrieken
Copy link

jrieken commented May 9, 2018

I came across your blogpost https://medium.com/@marcinbaraniecki/developing-visual-studio-code-extensions-c43a47321296 and as the maintainer of the VS Code I couldn't resit taking a look at your extension code.

Just FYI - it is best not to use activeTextEditor inside provideXYZ-calls because it must not always be the active editor for which completions are requested. In your case can do two things

  • use the provided document and position to figure out where you are, or
  • at least check that the provided document is the document of the active editor.

Thanks for the nice words ❤️. Happy Coding

@belfz
Copy link
Owner

belfz commented May 11, 2018

Thank you @jrieken ! That's an awesome feedback. I will definitely take a look into this.

belfz added a commit that referenced this issue May 11, 2018
@belfz
Copy link
Owner

belfz commented May 11, 2018

closed with 6f76130

@belfz belfz closed this as completed May 11, 2018
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