本頁面列出與 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 選擇器
- 如果元素沒有聚光燈或插樁ID,請使用
cssSelector參數和 CSS 選取器選取元素。
您只需要提供其中一個參數。如果同時提供這兩項屬性,系統會使用 spotlightId。
參數
| 參數 | 類型 | 說明 |
|---|---|---|
spotlightId |
字串 | 元素的焦點 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 |
來源控管活動列圖示。 |
activity-bar-search |
「搜尋」活動列圖示。 |
| Cloud Code | |
cloud-code-gke-explorer |
Cloud Code Kubernetes 探索器 >「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 |
記錄檢視器 >「重新整理」按鈕。 |
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 快速存取 >「在 Kubernetes 中執行」。 |
cloud-code-open-welcome-page |
Cloud Code 快速存取 >「開啟歡迎頁面」。 |
cloud-code-cloud-run-deploy |
Cloud Code 快速存取 >「Deploy to Cloud Run」(部署至 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 |
輸出記錄。 |