vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Support for custom editors registered via file extensions

Open pietie opened this issue 10 years ago • 11 comments

Similar to Visual Studio extensions, I would like to register a specific file extension and swap out the code editor for a custom UI experience when that file opened.

pietie avatar Apr 21 '16 12:04 pietie

@bpasero @alexandrudima @jrieken FYI.

dbaeumer avatar Apr 21 '16 13:04 dbaeumer

I am tempted to close this one because I do not think our goal would ever be to support this scenario. But since I cannot look into the future, I leave it open.

bpasero avatar Apr 21 '16 14:04 bpasero

+1, I read vscode API and source, try to find a way open a custom editor, it seems can't be done with extension API.

zzmingo avatar Feb 21 '17 09:02 zzmingo

+1, I'd like to develop a React-based UI designer coupled with a code editor

TomMarius avatar Mar 02 '17 10:03 TomMarius

One current way to do this is using the HTML preview for the GUI. HTML does have checkboxes, textfields, etc. I haven't checked if it is possible but you should be able to save the file path and immediately write-back changes in the HTML preview to the file. Or you could add a redundant save button to the HTML preview.

https://github.com/Microsoft/vscode-extension-samples/tree/master/previewhtml-sample

+1 Because I still feel VS Code needs more robust custom editor extension authoring. The preview work around doesn't really fit with the intended use of the feature.

The number of use cases VS Code would be able to cover would be greatly extended if this feature were implemented. For example, I am currently investigating its use as a project editor for a game engine where this would be extremely useful.

Also, important to mention that this is offered in atom.io as an extension point: https://atom.io/docs/api/v1.17.2/Workspace#instance-addOpener

RobertBColton avatar Jun 15 '17 07:06 RobertBColton

Any plan for "real" custom UI?

cwtuan avatar Sep 01 '17 03:09 cwtuan

+1 ... I want to build an extension that supports a blockly based experience where kids can code using blocks rather than write code ... Something similar to MIT Appinventor or Scratch.

navneet-g avatar Dec 31 '17 01:12 navneet-g

+1 We have system trace files that I'd like to be able to open my own editor to view the trace graphically using html preview. Otherwise it opens as an unknown binary type.

Note that I can do this with my own tree provider. I really just want to do the same in the file explorer for certain file extensions or more generally language modes, i.e. to be able to specify an open command that overrides the default behavior. As a bonus, it would be awesome to hook it up to the dirty bit for the file editor input to make it feel like a real editor.

If I figure out how to do this cleanly, would you be open to a pull request?

dschaefer avatar Feb 02 '18 00:02 dschaefer

@dschaefer another approach is that you contribute a command to the explorer´s context menu for this particular file type that opens the trace graphically.

egamma avatar Feb 02 '18 07:02 egamma

Thanks @egamma yes, I'll do that for the protoype. But it's not a good user experience. It'll be hard to explain why these files don't open like other files in their workspace, especially since the error message says "the file will not be displayed". I think we should be making every attempt for that message not to be displayed, including allowing some other editor, or command at least, to take care of it.

dschaefer avatar Feb 02 '18 15:02 dschaefer

Closing as duplicate of https://github.com/Microsoft/vscode/issues/12176 (which has more votes).

bpasero avatar Feb 06 '18 05:02 bpasero