Thanks for reaching out!
To achieve the desired behavior—opening an untitled file that doesn’t persist to disk until explicitly saved—you’ll need to:
- Avoid writing the file to disk initially. Instead, use a memory stream or in-memory buffer to simulate the file content.
- Use a custom editor factory that supports untitled documents. This typically involves implementing IVsEditorFactory and handling the CreateEditorInstance method to manage the document lifecycle.
- Use IVsUIShellOpenDocument or IVsRunningDocumentTable to register the document without a backing file, and defer saving until the user triggers it.
- Set up your language service via MEF (Managed Extensibility Framework) and ensure it’s registered to handle the file extension or content type.