VisualStudio Markdown高亮語法無法啟用之問題

經過了多年,微軟終於想開了,在Visual Studio 2022 version 17.5 Release中,將Markdown語法的加入原生性支援的行列,這次的加入不僅有語法高亮度來提升撰寫時的可識別性,也加入了語法預覽畫面,可以透過Preview按鈕來即時預覽撰寫後的大略畫面。

但老實說,Markdown的語法已經簡單到爆炸,其實不太需要預覽的畫面。

Visual Studio Markdown 新特性介紹

Markdown的支援性其實在Visual Studio 2022 version 17.5 Preview(預覽版)就開始支援,可是當我興沖沖的升級到17.5 Release(正式版)卻還是沒有看到相關的語法高亮度顯示?

開啟markdown的支援

跟許多新引入的功能不一樣的地方是,Visual Studio對於markdown的支援並不需要特別的設定,經過翻閱設定半天後想起,我好像很久以前有安裝過markdown相關的Extension,因此便參考微軟的建議:

Note that if you're using an extension to edit markdown files today, you may need to bring up the context menu on the .md file and explicitly choose “Open With…”, then select your preferred option.

請注意,如果您今天使用擴展程式來編輯 Markdown 檔案,您可能需要在 .md 檔案上帶出上下文選單,然後明確地選擇「開啟方式…」,再選擇您喜好的選項。

於是我隨便創造了一個.md檔案,在上面點選右鍵選擇開啟方式,就可以看到下列畫面...

在畫面中請選擇Visual Studio Markdown Editor,並將其設為預設值即可看到高亮度語法顯示嘍!

VS VisualStudio VS17.5 Markdown .md HightLight Preview NoEffect Enable Disable Disappear Hide