为了解决函数计算本地环境差异和配置繁琐的问题,在此背景下,就有了我们的 WebIDE 产品,WebIDE 能让函数的开发、测试和部署更加流畅,降低了函数计算的学习成本和缩短了函数的开发周期。
WebIDE 入口地址:https://ide.fc.aliyun.com
WebIDE 是一个基于 H5 支持多语言的集成开发环境。相当于 VS Code 的网页版。
功能特色:
F1
,唤出快捷打开功能搜索框,搜索想要的快捷功能说明:WebIDE 上的每一个标签页,我们称之为视图窗口,也叫视图。
视图相当于 WebIDE 上的标签页,例如:Files 视图、Hosts 视图和 Workspaces 视图等等。视图布局效果和 eclipse 的视图布局差不多。支持自由分窗和拖拽,刷新页面后,布局状态能还原到上一次的状态。如下图所示:
注意:当我们想还原到默认布局,可以通过快捷键 F1
打开命令面板,在命令面板中模糊搜索命令:Reset Workbench Layout,执行该命令即可。
通过快捷键 F1
唤出命令面板,可以模糊搜索想要的命令,如下图所示:
菜单栏功能如下:
文件树在 IDE 中是操作最频繁的视图,文件树与 VS Code 的文件树的操作大致相同。文件树主要功能:
编辑区是对文件或其他(如:运行器)进行编辑的区域,该区域通过标签页的形式展现,可以同时对个文件进行编辑。其中,代码编辑器,集成 Monaco Editor,与 VS Code 同款编辑器。编辑区主要功能:
主机管理,包含主机的增删改查,主机管理功能位于 Hosts 视图中。
ide start
命令启动 Agent 服务。工作空间管理,包含了工作空间的增删改查,工作空间管理功能位于 Workspaces 视图中。
主机与工作空间的关系是一对多的关系,即一个主机可以包含多个工作空间,一个工作空间只能隶属于一个主机。工作空间映射到主机上的一个文件夹。
点击菜单栏 File -> Open Workspace Preferences,打开工作空间级别的偏好设置,第一次打开,会自动创建 ./ide/settings.json 文件,如下图:
继续点击菜单 File -> Auto Save,结果如下图:
还有很多其他的偏好设置,具体请查看:偏好设置详情。
函数计算资源(FC Resources),包含本地资源(Local Resources)和远程资源(Remote Resources)相关操作。
fun deloy
可以将本地函数部署到远程函数计算服务中。当打开某一个工作空间后,就可以新建一个命令行终端视图。命令行终端的工作目录初始值为当前工作空间的根目录,oh-my-zsh 开箱即用。后端运行在当前主机上的 docker container 中,如果当前主机是本地机器,也就是说运行在您本地机器的某个 docker container 之中。
状态栏分为左侧区域和右侧区域,状态栏包含来自 WebIDE 的各种状态,状态的形式:文字、图标、文字加图标和颜色。状态按照是否可操作来分,又分为:可操作的(展现的同时关联相关操作)和不可操作的(只展现状态)。
本文将 WebIDE 主要功能以先总后分的方式讲解,先让读者有一个大概的了解,然后在分解各个功能。大部分读者都用过其他的 IDE,本文中很多功能一看就能理解。其中,主机、工作空间和函数计算相关的概念可能是第一次接触,可以着重了解一下。函数计算相关的概念,我并没有做过多解释,想要了解更多,可以参考:函数计算文档。
{
"navigator.autoReveal": {
"type": "boolean",
"description": "Selects file under editing in the navigator.",
"default": true
},
"navigator.exclude": {
"type": "object",
"description": `Configure glob patterns for excluding files and folders from the navigator. A resource that matches any of the enabled patterns, will be filtered out from the navigator. For more details about the exclusion patterns, see: \`man 5 gitignore\`.`,
"default": {
"**/.git": true
}
},
"notification.timeout": {
"type": "number",
"description": "The time before auto-dismiss the notification.",
"default": 5000 // time express in millisec. 0 means : Do not remove
},
"workspace.preserveWindow": {
"description": "Enable opening workspaces in current window",
"additionalProperties": {
"type": "boolean"
},
"default": false
},
"output.maxChannelHistory": {
"type": "number",
"description": "The maximum number of entries in an output channel.",
"default": 1000
},
"editor.tabSize": {
"type": "number",
"minimum": 1,
"default": 4,
"description": "Configure the tab size in the editor"
},
"editor.lineNumbers": {
"enum": [
"on",
"off"
],
"description": "Control the rendering of line numbers"
},
"editor.renderWhitespace": {
"enum": [
"none",
"boundary",
"all"
],
"description": "Control the rendering of whitespaces in the editor"
},
"editor.autoSave": {
"enum": [
"on",
"off"
],
"default": "on",
"description": "Configure whether the editor should be auto saved"
},
"editor.autoSaveDelay": {
"type": "number",
"default": 500,
"description": "Configure the auto save delay in milliseconds"
},
"editor.rulers": {
"type": "array",
"default": [],
"description": "Render vertical lines at the specified columns."
},
"editor.wordSeparators": {
"type": "string",
"default": "`~!@#$%^&*()-=+[{]}\\|;:'\",.<>/",
"description": "A string containing the word separators used when doing word navigation."
},
"editor.glyphMargin": {
"type": "boolean",
"default": false,
"description": "Enable the rendering of the glyph margin."
},
"editor.roundedSelection": {
"type": "boolean",
"default": true,
"description": "Render the editor selection with rounded borders."
},
"editor.minimap.enabled": {
"type": "boolean",
"default": true,
"description": "Enable or disable the minimap"
},
"editor.minimap.showSlider": {
"type": "string",
"default": "mouseover",
"description": "Controls whether the minimap slider is automatically hidden. Possible values are 'always' and 'mouseover'"
},
"editor.minimap.renderCharacters": {
"type": "boolean",
"default": true,
"description": "Render the actual characters on a line (as opposed to color blocks)"
},
"editor.minimap.maxColumn": {
"type": "number",
"default": 120,
"description": "Limit the width of the minimap to render at most a certain number of columns"
},
"editor.overviewRulerLanes": {
"type": "number",
"default": 2,
"description": "The number of vertical lanes the overview ruler should render."
},
"editor.overviewRulerBorder": {
"type": "boolean",
"default": true,
"description": "Controls if a border should be drawn around the overview ruler."
},
"editor.cursorBlinking": {
"type": "string",
"default": "blink",
"description": "Control the cursor animation style, possible values are 'blink', 'smooth', 'phase', 'expand' and 'solid'."
},
"editor.mouseWheelZoom": {
"type": "boolean",
"default": false,
"description": "Zoom the font in the editor when using the mouse wheel in combination with holding Ctrl."
},
"editor.cursorStyle": {
"type": "string",
"default": "line",
"description": "Control the cursor style, either 'block' or 'line'."
},
"editor.fontLigatures": {
"type": "boolean",
"default": false,
"description": "Enable font ligatures."
},
"editor.hideCursorInOverviewRuler": {
"type": "boolean",
"default": false,
"description": "Should the cursor be hidden in the overview ruler."
},
"editor.scrollBeyondLastLine": {
"type": "boolean",
"default": true,
"description": "Enable that scrolling can go one screen size after the last line."
},
"editor.wordWrap": {
"enum": ['off', 'on', 'wordWrapColumn', 'bounded'
],
"default": "off",
"description": "Control the wrapping of the editor."
},
"editor.wordWrapColumn": {
"type": "number",
"default": 80,
"description": "Control the wrapping of the editor."
},
"editor.wrappingIndent": {
"enum": ['none', 'same', 'indent'
],
"default": "same",
"description": "Control indentation of wrapped lines. Can be: 'none', 'same' or 'indent'."
},
"editor.links": {
"type": "boolean",
"default": true,
"description": "Enable detecting links and making them clickable."
},
"editor.mouseWheelScrollSensitivity": {
"type": "number",
"default": 1,
"description": "A multiplier to be used on the `deltaX` and `deltaY` of mouse wheel scroll events."
},
"editor.multiCursorModifier": {
"enum": ['ctrlCmd', 'alt'
],
"default": "alt",
"description": "The modifier to be used to add multiple cursors with the mouse."
},
"editor.accessibilitySupport": {
"enum": ['auto', 'off', 'on'
],
"default": "auto",
"description": "Configure the editor's accessibility support."
},
"editor.quickSuggestions": {
"type": "boolean",
"default": true,
"description": "Enable quick suggestions (shadow suggestions)"
},
"editor.quickSuggestionsDelay": {
"type": "number",
"default": 500,
"description": "Quick suggestions show delay (in ms)"
},
"editor.parameterHints": {
"type": "boolean",
"default": true,
"description": "Enables parameter hints"
},
"editor.autoClosingBrackets": {
"type": "boolean",
"default": true,
"description": "Enable auto closing brackets."
},
"editor.autoIndent": {
"type": "boolean",
"default": false,
"description": "Enable auto indentation adjustment."
},
"editor.formatOnType": {
"type": "boolean",
"default": false,
"description": "Enable format on type."
},
"editor.formatOnPaste": {
"type": "boolean",
"default": false,
"description": "Enable format on paste."
},
"editor.dragAndDrop": {
"type": "boolean",
"default": false,
"description": "Controls if the editor should allow to move selections via drag and drop."
},
"editor.suggestOnTriggerCharacters": {
"type": "boolean",
"default": true,
"description": "Enable the suggestion box to pop-up on trigger characters."
},
"editor.acceptSuggestionOnEnter": {
"enum": ['on', 'smart', 'off'
],
"default": "on",
"description": "Accept suggestions on ENTER."
},
"editor.acceptSuggestionOnCommitCharacter": {
"type": "boolean",
"default": true,
"description": "Accept suggestions on provider defined characters."
},
"editor.snippetSuggestions": {
"enum": ['top', 'bottom', 'inline', 'none'
],
"default": "inline",
"description": "Enable snippet suggestions."
},
"editor.emptySelectionClipboard": {
"type": "boolean",
"description": "Copying without a selection copies the current line."
},
"editor.wordBasedSuggestions": {
"type": "boolean",
"default": true,
"description": "Enable word based suggestions. Defaults to 'true'"
},
"editor.selectionHighlight": {
"type": "boolean",
"default": true,
"description": "Enable selection highlight."
},
"editor.occurrencesHighlight": {
"type": "boolean",
"default": true,
"description": "Enable semantic occurrences highlight."
},
"editor.codeLens": {
"type": "boolean",
"default": true,
"description": "Show code lens"
},
"editor.folding": {
"type": "boolean",
"default": true,
"description": "Enable code folding"
},
"editor.showFoldingControls": {
"enum": ['always', 'mouseover'
],
"default": "mouseover",
"description": "Controls whether the fold actions in the gutter stay always visible or hide unless the mouse is over the gutter."
},
"editor.matchBrackets": {
"type": "boolean",
"default": true,
"description": "Enable highlighting of matching brackets."
},
"editor.renderControlCharacters": {
"type": "boolean",
"default": false,
"description": "Enable rendering of control characters."
},
"editor.renderIndentGuides": {
"type": "boolean",
"default": true,
"description": "Enable rendering of indent guides."
},
"editor.renderLineHighlight": {
"enum": ['none', 'gutter', 'line', 'all'
],
"default": "line",
"description": "Enable rendering of current line highlight."
},
"editor.useTabStops": {
"type": "boolean",
"description": "Inserting and deleting whitespace follows tab stops."
},
"editor.insertSpaces": {
"type": "boolean",
"default": true,
"description": "Using whitespaces to replace tabs when tabbing."
},
"diffEditor.renderSideBySide": {
"type": "boolean",
"description": "Render the differences in two side-by-side editors.",
"default": true
},
"diffEditor.ignoreTrimWhitespace": {
"type": "boolean",
"description": "Compute the diff by ignoring leading/trailing whitespace.",
"default": true
},
"diffEditor.renderIndicators": {
"type": "boolean",
"description": "Render +/- indicators for added/deleted changes.",
"default": true
},
"diffEditor.followsCaret": {
"type": "boolean",
"description": "Resets the navigator state when the user selects something in the editor.",
"default": true
},
"diffEditor.ignoreCharChanges": {
"type": "boolean",
"description": "Jump from line to line.",
"default": true
},
"diffEditor.alwaysRevealFirst": {
"type": "boolean",
"description": "Reveal first change.",
"default": true
}
}