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

TextFileEditorModelManager disposes models it doesn't own #17888

Closed
rebornix opened this issue Dec 28, 2016 · 4 comments
Closed

TextFileEditorModelManager disposes models it doesn't own #17888

rebornix opened this issue Dec 28, 2016 · 4 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debt Code quality issues verified Verification succeeded
Milestone

Comments

@rebornix
Copy link
Member

  • VSCode Version: 1.9.0-Insiders
  • OS Version: macOS

Steps to Reproduce:

  1. Go to https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/electron-browser/actions.ts#L56
  2. Right click on closeEditor, click Find all references
  3. Cmd+Click on references in editorService, the file containing that reference will be opened on the right side editor group.
  4. Expand references tree, part of the references are rendered as blank somtimes

Gif demonstrating the steps:
reference-blank

It's not that easy to reproduce, you might need to run step 4 several times.

@jrieken jrieken added the bug Issue identified by VS Code Team member as probable bug label Dec 29, 2016
@jrieken jrieken added this to the January 2017 milestone Dec 29, 2016
@jrieken jrieken modified the milestones: February 2017, January 2017 Jan 25, 2017
@jrieken jrieken assigned bpasero and unassigned jrieken Feb 10, 2017
@jrieken
Copy link
Member

jrieken commented Feb 10, 2017

The is some textFileEditorManager disposing the models I have references/locked via createModelReference.

model.onDispose(() => {
	const {stack} = new Error();
	console.warn('DISPOSING MODEL FOR ' + this.uri);
	console.warn(stack);
});
DISPOSING MODEL FOR file:///Users/jrieken/Code/vscode/src/vs/workbench/parts/files/browser/editors/textFileEditor.ts
referencesModel.js:181 Error
    at file:////Users/jrieken/Code/vscode/out/vs/editor/contrib/referenceSearch/browser/referencesModel.js:179:33
    at CallbackList.invoke (file:////Users/jrieken/Code/vscode/out/vs/base/common/callbackList.js:57:43)
    at Emitter.fire (file:////Users/jrieken/Code/vscode/out/vs/base/common/event.js:88:40)
    at TextFileEditorModel.EditorModel.dispose (file:////Users/jrieken/Code/vscode/out/vs/workbench/common/editor.js:320:29)
    at TextFileEditorModel.BaseTextEditorModel.dispose (file:////Users/jrieken/Code/vscode/out/vs/workbench/common/editor/textEditorModel.js:146:38)
    at TextFileEditorModel.dispose (file:////Users/jrieken/Code/vscode/out/vs/workbench/services/textfile/common/textFileEditorModel.js:665:38)
    at TextFileEditorModelManager.disposeModelIfPossible (file:////Users/jrieken/Code/vscode/out/vs/workbench/services/textfile/common/textFileEditorModelManager.js:64:23)
    at file:////Users/jrieken/Code/vscode/out/vs/workbench/services/textfile/common/textFileEditorModelManager.js:356:58
    at Array.forEach (native)
    at TextFileEditorModelManager.disposeUnusedModels (file:////Users/jrieken/Code/vscode/out/vs/workbench/services/textfile/common/textFileEditorModelManager.js:356:18)

@jrieken jrieken changed the title References are shown as blank if the tab width is too small TextFileEditorModelManager disposes models it doesn't own Feb 10, 2017
@bpasero
Copy link
Member

bpasero commented Feb 10, 2017

Needs #17073 for file models.

@bpasero
Copy link
Member

bpasero commented Mar 2, 2017

And actually blocked by #21709

@bpasero
Copy link
Member

bpasero commented Apr 10, 2017

Fixed via 5ecf0cd

@bpasero bpasero closed this as completed Apr 10, 2017
@michelkaporin michelkaporin added the verified Verification succeeded label Apr 28, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
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 debt Code quality issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants