jtokoph / ghosttext-vscode

Use the new official extension: https://marketplace.visualstudio.com/items?itemName=fregante.ghost-text
https://marketplace.visualstudio.com/items?itemName=fregante.ghost-text
28 stars 11 forks source link

Set a default file language #3

Closed iherman closed 1 year ago

iherman commented 6 years ago

This is related to #1. At present, the file language is set to .txt by default (and, per #1, it is essentially impossible to change that, because the change would result in the change of the temporary file suffix). At the minimum, it should be possible to set the default file language via the settings.

wormeyman commented 6 years ago

@iherman I fixed it with

"files.associations": { "*.tmp": "html" },

in my settings config for vscode.

wormeyman commented 6 years ago
    if (this.editor === null) {
      this.editorTitle = request.title;
      tmp.file({
        postfix: '.html'
      }, (err, path, fd, cleanupCallback) => {
        console.log("File: ", path);
        console.log("Filedescriptor: ", fd);
        this.cleanupCallback = cleanupCallback;

also works.

fregante commented 1 year ago

This is now possible in the official extension https://github.com/jtokoph/ghosttext-vscode/issues/13

Screenshot