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

onDidChangeActiveTextEditor fires twice #38818

Closed
EvgeniyMakhmudov opened this issue Nov 20, 2017 · 1 comment
Closed

onDidChangeActiveTextEditor fires twice #38818

EvgeniyMakhmudov opened this issue Nov 20, 2017 · 1 comment
Assignees
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Milestone

Comments

@EvgeniyMakhmudov
Copy link

  • VSCode Version: 1.18.1
  • OS Version: Linux Mint 18.2

Steps to Reproduce:

  1. Make HelloWorld project as in tutorial
  2. In the end of activate function add code like this
vscode.window.onDidChangeActiveTextEditor(function (editor) {
        console.log("onDidChangeActiveTextEditor" + editor.document.fileName);
    })
}
  1. Run Debug session, open two ordinal files, activate extension via run command, change active editor from file 1 to file 2, and then back from file 2 to file 1.

As result in debug console there are messages like this

Congratulations, your extension "vsct" is now active!
onDidChangeActiveTextEditor /home/john_16/Projects/file2.py
onDidChangeActiveTextEditor /home/john_16/Projects/file2.py
onDidChangeActiveTextEditor /home/john_16/Projects/file1.py
onDidChangeActiveTextEditor /home/john_16/Projects/file1.py

I am expected that log messages must be only 2, instead i see 4. Its mean that if i use in this event a real function that it will execute twice - that is not what i expect.

Is it a bug or i doing something wrong?

Reproduces without extensions: no info

@vscodebot vscodebot bot added the debug Debug viewlet, configurations, breakpoints, adapter issues label Nov 20, 2017
@weinand weinand removed the debug Debug viewlet, configurations, breakpoints, adapter issues label Nov 20, 2017
@weinand weinand assigned bpasero and unassigned weinand Nov 20, 2017
@bpasero bpasero assigned jrieken and unassigned bpasero Nov 21, 2017
@jrieken jrieken added api bug Issue identified by VS Code Team member as probable bug labels Nov 21, 2017
@jrieken jrieken added this to the November 2017 milestone Nov 21, 2017
@jrieken
Copy link
Member

jrieken commented Nov 21, 2017

Proper bug report. Thanks @EvgeniyMakhmudov.

@roblourens roblourens added the verified Verification succeeded label Dec 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Jan 5, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api bug Issue identified by VS Code Team member as probable bug verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants