Visual Studio Code

ไมโครซอฟท์ออกอัพเดตเวอร์ชัน 1.42 ให้กับ Visual Studio Code โดยได้เพิ่มฟีเจอร์ใหม่และการปรับปรุงหลายอย่าง

ฟีเจอร์ใหม่ที่น่าสนใจ คือตัวช่วยพรีวิวผลการ refactor ชื่อที่ใช้ภายในโค้ด (ยกตัวอย่างเช่นชื่อคลาส หรือชื่อตัวแปร) ใช้งานได้ผ่านการกดคีย์ Shift + Enter ขณะเปลี่ยนแปลงชื่อ (คลาส/ตัวแปร) เพื่อสั่งให้ VS Code เปิดพาเนล Refactor Preview ซึ่งจะแสดงรายการของโค้ดที่จะได้รับการ refactor ให้สอดคล้องกับการเปลี่ยนชื่อที่กำลังดำเนินการ

โดยผู้ใช้จะสามารถคลิกเลือกที่แต่ละรายการเพื่อเปิด diff editor ขึ้นมาเปรียบเทียบโค้ดก่อนและหลังการ refactor ก่อนตัดสินใจยืนยันหรือเรียกคืนการเปลี่ยนแปลงที่ไม่ต้องการ ผ่านการติ๊ก checkbox ข้างหน้าแต่ละรายการ

ทั้งหมดนี้ทำให้การตรวจสอบโค้ดที่ได้รับผลกระทบจากการ refactor ชื่อทำได้ง่ายและสะดวกขึ้นมาก

ส่วนการปรับปรุงอื่นๆ ที่ไมโครซอฟท์ยกให้เป็นไฮไลท์ของอัพเดตมีดังนี้

  • เพิ่มกลุ่มการตั้งค่า workbench.editor.limit ใช้กำหนดจำนวน editor สูงสุดที่เปิดใช้งานพร้อมๆ กัน หากเปิดฟีเจอร์นี้ editor แท็บที่เก่าสุด (ซึ่งไม่มีการแก้ไขโค้ดที่ยังไม่ได้บันทึก) จะถูกปิดอัตโนมัติ
  • เพิ่มทางเลือกให้สามารถย้ายตำแหน่งพาเนล Output, Debug Console, Terminal และ Problems ไปยังด้านซ้ายของหน้าต่าง editor ปรับปรุงจากเดิมที่สลับตำแหน่งได้เพียงแค่ด้านล่างและทางขวาเท่านั้น เรียกใช้งานได้ด้วยการพิมพ์คำสั่ง View: Move Panel (Left, Right, To Bottom) ลงใน command palette
  • เพิ่มการไฮไลท์โค้ดที่ถูกซ่อนด้วย code folding
  • ปรับปรุง Debug Console ให้อินพุทได้รับการไฮไลท์สี, ช่วยจัดย่อหน้า/ปิดเครื่องหมายปีกกา ตาม syntax ของโค้ด และยังช่วยแสดงประวัติอินพุทที่เคยใช้งานในกล่องช่วยเติมโค้ด (IntelliSense) ให้อีกด้วย
  • เพิ่มการกำหนด task (ไฟล์ tasks.json) ในการตั้งค่าระดับ User Settings ทำให้สามารถนำสคริปต์ที่ใช้งานบ่อย (ยกตัวอย่างเช่น build script) มาใช้สั่งรันได้หลายโปรเจ็กต์ แทนที่จะถูกจำกัดไว้ในระดับ Workspace ซึ่งสามารถใช้งานได้เพียงโปรเจ็กต์เดียวอย่างแต่ก่อน
  • ปรับปรุงส่วนขยาย Java ให้รองรับการดีบักด้วย Data Breakpoints (หยุดโปรแกรม เมื่อค่าของตัวแปรที่ติดตามถูกเปลี่ยนไปจากค่าเดิม), เพิ่มความสามารถในการเรียกดู Call Hierarchy หรือลำดับชั้นของการใช้งานฟังก์ชั่นภายในโค้ด
  • ปรับปรุงมุมมองจัดการ Forwarded Ports สำหรับการเชื่อมต่อกับ SSH, Container บนส่วนขยาย Remote Development
  • เพิ่มคู่มือสอนการใช้งาน Container บน VS Code

ที่มา - Visual Studio Code

Hiring! บริษัทที่น่าสนใจ

Carmen Software company cover
Carmen Software
Hotel Financial Solutions
Next Innovation (Thailand) Co., Ltd. company cover
Next Innovation (Thailand) Co., Ltd.
We are web design with consulting & engineering services driven the future stronger and flexibility.
KKP Dime company cover
KKP Dime
KKP Dime บริษัทในเครือเกียรตินาคินภัทร
Kiatnakin Phatra Financial Group company cover
Kiatnakin Phatra Financial Group
Financial Service
Fastwork Technologies company cover
Fastwork Technologies
Fastwork.co เว็บไซต์ที่รวบรวม ฟรีแลนซ์ มืออาชีพจากหลากหลายสายงานไว้ในที่เดียวกัน
Thoughtworks Thailand company cover
Thoughtworks Thailand
Thoughtworks เป็นบริษัทที่ปรึกษาด้านเทคโนโยลีระดับโลกที่คว้า Great Place to Work 3 ปีซ้อน
Iron Software company cover
Iron Software
Iron Software is an American company providing a suite of .NET libraries by engineer for engineers.
CLEVERSE company cover
CLEVERSE
Cleverse is a Venture Builder. Our team builds several tech companies.
Nipa Cloud company cover
Nipa Cloud
#1 OpenStack cloud provider in Thailand with our own data center and software platform.
Bangmod Enterprise company cover
Bangmod Enterprise
The leader in Cloud Server and Hosting in Thailand.
CIMB THAI Bank company cover
CIMB THAI Bank
MOVING FORWARD WITH YOU - CIMB is the leading ASEAN Bank
Bangkok Bank company cover
Bangkok Bank
Bangkok Bank is one of Southeast Asia's largest regional banks, a market leader in business banking
MuvMi (Urban Mobility Tech Co.,Ltd.) company cover
MuvMi (Urban Mobility Tech Co.,Ltd.)
Shape the future of urban mobility towards affordable, clean, and safe solutions
T.N. Digital Solution Co., Ltd. company cover
T.N. Digital Solution Co., Ltd.
TNDS has been involving in every first move of banking’s major digital transformation.
KBTG - KASIKORN Business-Technology Group company cover
KBTG - KASIKORN Business-Technology Group
KBTG - "The Technology Company for Digital Business Innovation"
Siam Commercial Bank Public Company Limited company cover
Siam Commercial Bank Public Company Limited
"Let's start a brighter career future together"
Icon Framework co.,Ltd. company cover
Icon Framework co.,Ltd.
Global Standard Platform for Real Estate แพลตฟอร์มสำหรับธุรกิจอสังหาริมทรัพย์ครบวงจร มาตรฐานระดับโลก
REFINITIV company cover
REFINITIV
The Financial and Risk business of Thomson Reuters is now Refinitiv
H LAB company cover
H LAB
Re-engineering healthcare systems through intelligent platforms and system design.
The Gang Technology Co., Ltd. company cover
The Gang Technology Co., Ltd.
We're a Digital Agency that helps our customers transform their business into digital with ease.
LTMH company cover
LTMH
LTMH มุ่งเน้นการพัฒนาผลิตภัณฑ์ที่สามารถช่วยพันธมิตรของเราให้บรรลุเป้าหมาย
Seven Peaks company cover
Seven Peaks
We Drive Digital Transformation
Wisesight (Thailand) Co., Ltd. company cover
Wisesight (Thailand) Co., Ltd.
The Best Choice For Handling Social Media · High Expertise in Social Data · Most Advanced and Secure
MOLOG Tech company cover
MOLOG Tech
We are Modern Logistic Platform, Specialize in WMS, OMS and TMS.
Data Wow Co.,Ltd company cover
Data Wow Co.,Ltd
We enable our clients to realize increased productivity by solving their most complex issues by Data
LINE Company Thailand company cover
LINE Company Thailand
LINE, the world's hottest mobile messaging platform, offers free text and voice messaging + Call
LINE MAN Wongnai company cover
LINE MAN Wongnai
Join our journey to becoming No.1 food platform in Thailand

ถ้าหมายถึง Refactor Preview ผมลองแล้ว ไม่จำเป็นต้องติดตั้งส่วนขยาย IntelliCode ที่เป็น AI ช่วยเติมโค้ดนะครับ

เข้าใจว่าฟังก์ชั่น refactor นี่จะอยู่ที่ตัวส่วนขยายสำหรับแต่ละภาษาเองเลย ว่าทำมารองรับไหม

อย่างผมที่ลองคือ ผมเคยติดตั้ง Language Support for Java เอาไว้ใช้งาน

ซึ่งส่วนขยายตัวนี้รองรับการ refactor โค้ดอยู่แล้ว พออัพเดต 1.42 มาผมก็ใช้งาน Refactor Preview กับ Java ได้เลยครับ

ผมติดปัญเรื่อง ชื่อไฟล์ยาวๆแล้วมันกินที่ tab name น่ะครับ
แล้วก็ scroll bar ที่เลื่อนเลือกไฟล์(เนื่องจาก tab name มันกินที่)มันบางมากๆ ปรับตรงไหนให้หนาขึ้นครับ ตอนกดจะได้ไม่ต้องเล็งมาก

อาจจะไม่ตรงกับที่ถามซะทีเดียว แต่เห็นว่ามี setting ให้ย่อขนาด tab โดยไม่สนใจชื่อไฟล์อยู่นะครับ