How to open editor tab with code? Follow
Answered
Hi,
Can someone please tell me what to use if I want to open a new editor window for a specific file, within my plugin? I have tried with editor, project and FileEditorManager. It seems like FileEditorManager is the way to go but the methods setSelectedEditor or openFile dont work for me. I've checked that both the project and virtual file are valid.
Thanks.
Please sign in to leave a comment.
WDYM with "open a new editor window for a specific file"? Open the given file or open _another_ editor tab for that file?
see com.intellij.ide.util.EditSourceUtil#navigate, com.intellij.ide.util.PsiNavigationSupport#createNavigatable and com.intellij.util.PsiNavigateUtil
Thank you, I meant open an editor tab for that file. Everything is working
Are you looking for the FileEditorManager.openTextEditor? e.g.
Yes this is what I was looking for and ended up using. It worked as I wanted it to, thank you :)