Pseudo-documents like foo.git, output://…, and ~/.vscode/argv.json are included in ide_editCodeFile metrics even though they were not actually opened by the user.
onDidOpenTextDocument doesn't correctly represent user activity: it fires for all documents opened with onDidOpenTextDocument(), which includes all documents/buffers opened for programmatic purposes by application or library code.
Solution:
Listen to onDidChangeActiveTextEditor instead of onDidOpenTextDocument. This represents when a user actually opens a file in the IDE.
Ignore various "noise" documents.
License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
Problem:
foo.git
,output://…
, and~/.vscode/argv.json
are included inide_editCodeFile
metrics even though they were not actually opened by the user.onDidOpenTextDocument
doesn't correctly represent user activity: it fires for all documents opened withonDidOpenTextDocument()
, which includes all documents/buffers opened for programmatic purposes by application or library code.Solution:
onDidChangeActiveTextEditor
instead ofonDidOpenTextDocument
. This represents when a user actually opens a file in the IDE.License: I confirm that my contribution is made under the terms of the Apache 2.0 license.