Change title of untitled tab in Visual Studio Code

后端 未结 2 1231
再見小時候
再見小時候 2021-01-05 04:39

I\'m building a VS Code extension which includes changing the name/title of untitled-1 tab (unsaved file).
I tried running the below code in debugger consol

2条回答
  •  自闭症患者
    2021-01-05 05:02

    It's not possible - if you check out the source code for the API definition in vscode.d.ts, you'll see that fileName is declared as readonly:

    export interface TextDocument {
        // ...
        readonly fileName: string;
        // ...
    }
    

    Unfortunately, it seems that the readonly attribute isn't reflected in the API docs on the website.

提交回复
热议问题