Visual Studio Code color theme in Visual Studio 2017 for JavaScript and TypeScript files

后端 未结 2 1058
傲寒
傲寒 2021-02-04 05:32

As the topic suggests I would like to import/set Visual Studio Code color theme in Visual Studio 2017 for JavaScript and TypeScript files. The files I therefore would like to se

2条回答
  •  悲&欢浪女
    2021-02-04 06:23

    I did end up finding a way!

    TL:DR:

    Download JavaScript.tmLanguage and JavaScript.tmTheme.

    • Go to %USERPROFILE%\.vs\Extensions\javascript\Syntaxes (%USERPROFILE% usually is C:\Users\{username})
    • Create the folders if they are not present.
    • Paste the two files
    • Restart the VS, should have the vscode highlighting for js, jsx etc files!

    If you want to port any vscode theme to Visual Studio,

    • In vscode generate color theme from current setting.(Ref.) This will be the tmTheme file
    • Get tmLanguage of the language from vscode's repo
    • Convert both json to plist. (I used plist)
    • Add filetypes to tmLanguage file if its not there.
    • Add both to %USERPROFILE%\.vs\Extensions\language\Syntaxes folder.
    • Done!

    I have tested for VS2019, and as I followed VS docs, it seems like it should work till VS2015.

    Screenshot:

提交回复
热议问题