How to create an extension command similar to VSCode's File: New File command? - visual-studio-code

I want to create a command that has the same flow where once you create the command it will take you to the explorer window and allow you to type the name of the file there. Is there a way to do that with the existing vscode API?
Update: The flow of creating the file through the explorer was done by executing 'explorer.newFile'. I want to take the user's input, create 2 template files, and then delete the original file created by 'explorer.newFile'. It does not seem like 'explorer.newFile' returns info about the new file so I created a filewatcher to do this which makes for choppy creation/deletion of the files. Is there a way to make this smoother?

No, not as VSCode 1.15. Your best bet currently is to either try reusing the built-in create file command (explorer.newFile) or to use the quick picker API to achieve a similar flow

Related

VSCode: is it possible to create a command that will fill a file with text on creation?

At my place of work, we have a standard source header. I've been using snippets to generate it when adding text to a file. However, since it's supposed to be pretty much used on everything, I figure I might as well see if I can automate its generation on file creation.
Is there a way to automatically add text to a file on creation in vscode? Can I generate different text based on the file extension?

create ssh-compatible vscode extension

I often run scripts on remote machines and sometimes create custom html dashboards to monitor progress. I was wondering if something like that would be better done taking advantage of vscode's ssh extension, which I use to edit files remotely anyway.
For example, I'd like to display a custom panel with information derived from a list of files in the remote server. My traditional approach would be to run a web server to get the file contents in some custom json format and create a custom html client to display the data. Would it be possible to skip the web server part and instead create some custom vscode extension that gets the data via some ssh api?
It might be your case to use LogTail extension to fetch your data and then proceed with your desired display method.
VSCode Marketplace for LogTail: https://marketplace.visualstudio.com/items?itemName=tiansin.logtail
I hope it helps :)

Is it possible to create a virtual editor in an extension

I want to process lots of files in my extension and editors have lots of useful methods that I need to use to process the content of a file with, but I don't want to open each file individually in VSC.
I have been able to read the files I plan on editing but how can I create an editor?
Can this be done?
Have you tried vscode.window.openTextDocument()?
openTextDocument(uri: Uri): Thenable<TextDocument>
Opens a document. Will return early if this document is already open. Otherwise the document is loaded and the didOpen-event fires.
That does not imply showing the editor, which is done with a separate vscode.window.showTextDocument() call, so it should qualify as "virtual".

Trying to get along with Interwoven

I am to create a new design (CSS & HTML) for a web site which is created using Interwoven ContentCenter Professional.
Now, I can see the existing files in CMS (Interwoven) but, I can't make changes. My changes are displayed only when I'm in edit mode. Nothing in the live page. I tried to submit, create editions of files but still no good.
How should I create or edit pages in Interwoven CMS?
Thanks.
If you're talking about generic pages, then once you are finished you have to click on the Generate option, then choose a directory and click Finish. Last thing you should do is to choose yeswhen it asks you to Re-generate the page.
What you are trying to do is just creating a new file, not generating a file from TeamSite's Formpublisher. It is just like if you are in Windows Explorer and creating a new file. In order to generate a file from a form entry, you need to be in the templatedata directory, ex: /default/main/branch1/WORKAREA/wa1/templatedata/category/type(on unix) or Y:/default/main/branch1/WORKAREA/wa1/templatedata/category/type (on Windows). There should be a file call datacapture.cfg there. There is another directory called data under the above path which stores your data content record (dcr) that are created from the form. This is the file that you can use to generate which will use the (tpl) file under the presentation directory.

Web deployment tool

I would like to know if in IIS manager, when I export an application, there is a way to save components selected so, when I export next time, to select them by default (like appHostConfig). Thank you.
Unfortunately that is not possible today, if you are constantly using it you should consider using the command line instead that will easily allow you to save those in an external file and run them as frequently as needed without having to specify everything again.