Cloud Shell 編輯器指令

本頁面列出與 Cloud Shell 編輯器相關的指令。

開啟檔案

<walkthrough-editor-open-file filePath="FILE_PATH">LINK_TEXT</walkthrough-editor-open-file>

建立連結,在編輯器中開啟 Cloud Shell 磁碟上的檔案。

參數

參數 類型 說明
filePath 字串 相對於在 Cloud Shell 中開啟的工作區的檔案路徑。

開啟已選取文字的檔案

<walkthrough-editor-select-line filePath="FILE_PATH" startLine="START_LINE" endLine="END_LINE">LINK_TEXT</walkthrough-editor-select-line>

建立連結,在編輯器中開啟 Cloud Shell 磁碟上的檔案,並選取檔案內的文字行。

參數

參數 類型 說明
filePath 字串 相對於在 Cloud Shell 中開啟的工作區的檔案路徑。
startLine 整數 選取範圍的起始檔案行。與程式碼編輯器不同的是,行數從 0 開始計算。
endLine 整數 選取範圍結束的檔案行。選取範圍會在該行開頭結束。與程式碼編輯器不同的是,行數計數從 0 開始。
startCharacterOffset 整數 startLine 中開始選取的字元編號。
endCharacterOffset 整數 要選取的 endLine 位置後方字元數。

開啟含有以規則運算式選取的文字的檔案

<walkthrough-editor-select-regex filePath="FILE_PATH" regex="REGEX">LINK_TEXT</walkthrough-editor-select-regex>

建立連結,在 Cloud Shell 編輯器中開啟 Cloud Shell 磁碟上的檔案,並根據規則運算式選取檔案中的文字。系統只會選取檔案中的第一個相符項目。

參數

參數 類型 說明
filePath 字串 相對於在 Cloud Shell 中開啟的工作區的檔案路徑。
regex 字串 要比對的規則運算式。多行模式已開啟。

焦點指標

<walkthrough-editor-spotlight spotlightId="SPOTLIGHT_ID">LINK_TEXT</walkthrough-editor-spotlight>
<walkthrough-editor-spotlight cssSelector="CSS_SELECTOR">LINK_TEXT</walkthrough-editor-spotlight>

建立連結,在編輯器中醒目顯示指定的 UI 元素。

您可以透過下列任一方式在頁面上標示元素:

Spotlight ID
使用 spotlightId 參數,指定 DOM 元素的 spotlight-id 屬性值,以便選取元素。
CSS 選取器
如果元素沒有 SpotlightID,請使用 cssSelector 參數搭配 CSS 選取器來選取元素。

只需提供其中一個參數即可。如果同時設定了兩項參數,系統會使用 spotlightId

參數

參數 類型 說明
spotlightId 字串 元素的 Spotlight ID。
spotlightItem 字串 spotlightId 設為 navigator 時,此為必要屬性。預期的值是相對於在 Cloud Shell 中開啟的工作區的檔案路徑。

spotlightId 參數只接受下列值:

Spotlight ID 醒目顯示的元素
活動列
activity-bar-cloud-apis Cloud API 活動列圖示。
activity-bar-cloud-k8s Cloud Kubernetes 活動列圖示。
activity-bar-cloud-run Cloud Run 活動列圖示。
activity-bar-debug 「偵錯」活動列圖示。
activity-bar-scm 「Source Control」活動列圖示。
activity-bar-search 「搜尋」活動列圖示。
Cloud Code
cloud-code-gke-explorer Cloud Code Kubernetes Explorer > Google Kubernetes Engine 專區。
cloud-code-k8s-explorer Cloud Code Kubernetes Explorer > Kubernetes 專區。
cloud-code-k8s-explorer-minikube Cloud Code Kubernetes Explorer > minikube 叢集 (如果有)。
cloud-code-logs-viewer-cluster 記錄檢視器 >「叢集」篩選器。
cloud-code-logs-viewer-container 記錄檢視器 >「容器」篩選器。
cloud-code-logs-viewer-deployment 記錄檢視器 >「部署」篩選器。
cloud-code-logs-viewer-namespace 日誌檢視器 >「命名空間」篩選器。
cloud-code-logs-viewer-pod 記錄檢視器 >「Pod」篩選器。
cloud-code-logs-viewer-refresh 記錄檢視器 >「Refresh」按鈕。
cloud-code-logs-viewer-stream-toggle 記錄檔檢視器 > 切換「串流」
cloud-code-new-app Cloud Code 快速存取功能 >「New Application」
cloud-code-debug-on-k8s Cloud Code 快速存取 >「在 Kubernetes 中偵錯」
cloud-code-run-on-k8s Cloud Code 快速存取 >「Run on Kubernetes」
cloud-code-open-welcome-page Cloud Code 快速存取功能 > 開啟歡迎頁面
cloud-code-cloud-run-deploy Cloud Code 快速存取 >「Deploy to Cloud Run」
cloud-code-run-on-cloud-run-emulator Cloud Code 快速存取 > 在 Cloud Run 模擬器上執行
選單
menu-edit 「編輯」選單。
menu-file 「檔案」選單。
menu-terminal 「Terminal」選單。
menu-terminal-new-terminal 依序點選「Terminal」選單 >「New Terminal」
狀態列
cloud-code-status-bar Cloud Code 狀態列選單按鈕。
minikube-status-bar Minikube 狀態列選單按鈕。
其他元素
debug-configuration 偵錯檢視畫面 > 設定下拉式選單。
file-explorer 檔案總管。
navigator Cloud Code 檔案瀏覽器中的檔案。必須搭配 spotlightItem 參數使用。
output 「Output」記錄檔。