VSCode как полноценная IDE для PHP
Из VSCode можно приготовить полноценную среду для работы с PHP, но для этого требуется предварительная установка модулей и настройка.
Модули
42crunch.vscode-openapi # поддержка и просмотр openapi
alefragnani.bookmarks # закладки
amandeepmittal.pug # поддержка шаблонизатора PUG под VUE
animus-coop.vscode-phpstorm-formatter # форматирование кода PHP с помощью PHPSTORM
bmewburn.vscode-intelephense-client # php машина для кода
cweijan.dbclient-jdbc
cweijan.vscode-database-client2
devsense.composer-php-vscode
devsense.intelli-php-vscode
devsense.phptools-vscode
devsense.profiler-php-vscode
gerrnperl.outline-map
hiberbee.hiberbee-vscode-theme # высококонтрастная тема
maattdd.gitless # графическое представление для git
mblode.twig-language # поддержка шаблонизации twig
mechatroner.rainbow-csv # выделение скобок разными цветами
mehedidracula.php-namespace-resolver # поиск и разрешение зависимостей в namespace
mhutchie.git-graph
mikestead.dotenv
ms-azuretools.vscode-containers
phplasma.csv-to-table
redhat.vscode-xml
redhat.vscode-yaml
repreng.csv
ronvanderheijden.phpdoc-generator
satiromarra.code-sftp # работа с сохранением через sftp/ftp на удаленном стейдже
streetsidesoftware.code-spell-checker # система словарей
streetsidesoftware.code-spell-checker-russian # русский словарь
syler.sass-indented
vscode-icons-team.vscode-icons # иконки, нескучный набор
vue.volar # подсветка, форматтер vue (официальный)
xdebug.php-debug # xdebug в VSCode (официальный)
gruntfuggly.todo-tree # подсветка TODO проекта
Пример настроек
{
"editor.largeFileOptimizations": false,
"json.maxItemsComputed": 5000000,
"editor.foldingMaximumRegions": 50000,
"security.workspace.trust.untrustedFiles": "open",
"editor.fontSize": 13,
"security.workspace.trust.startupPrompt": "never",
"security.workspace.trust.banner": "never",
"security.workspace.trust.emptyWindow": false,
"security.workspace.trust.enabled": false,
"git.untrackedChanges": "separate",
"editor.wordSeparators": "`~!@#%^&*()=+[{]}\\|;:,./?'\"-><",
"editor.wordWrap": "on",
"[php]": {
"editor.defaultFormatter": "bmewburn.vscode-intelephense-client"
},
"diffEditor.ignoreTrimWhitespace": false,
"php.format.rules.spaceAfterCast": true,
"php.format.rules.forStatementNewLineBeforeRightParen": true,
"diffEditor.renderSideBySide": false,
"window.confirmBeforeClose": "always",
"editor.trimAutoWhitespace": false,
"phpstormFormatter.ideBinPath": "/opt/PhpStorm-222.3345.135/bin",
"phpstormFormatter.styleGuidePath": "PhpStorm/Formatter/phpstorm-format.xml",
"cSpell.language": "en,ru",
"php.debug.ideKey": "XDEBUG_TRIGGER",
"php.debug.executablePath": "/usr/bin/php8.1",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"workbench.list.smoothScrolling": true,
"editor.smoothScrolling": true,
"gitlens.gitCommands.search.showResultsInSideBar": false,
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"[xml]": {
"editor.defaultFormatter": "redhat.vscode-xml"
},
"editor.minimap.enabled": false,
"outline.showNamespaces": false,
"intelephense.diagnostics.run": "onSave",
"php.suggest.basic": false,
"[sql]": {
"editor.defaultFormatter": "cweijan.vscode-database-client2"
},
"editor.scrollbar.horizontalScrollbarSize": 8,
"editor.scrollbar.verticalScrollbarSize": 12,
"xml.server.vmargs": "-Xmx256M",
"xml.symbols.maxItemsComputed": 5000000,
"gitlens.currentLine.format": "${date} | ${author}",
"gitlens.currentLine.dateFormat": "YYYY.MM.DD",
"gitlens.codeLens.authors.command": false,
"gitlens.hovers.currentLine.over": "line",
"window.openFoldersInNewWindow": "on",
"gitlens.statusBar.tooltipFormat": "${avatar}, ${author}, __${author}__, ${ago}${' via 'pullRequest} _(${date})_ ${message}${commands}${---footnotes}",
"gitlens.blame.format": "${date|10-} ${author|20-}",
"gitlens.blame.dateFormat": "YYYY.MM.DD",
"gitlens.blame.avatars": true,
"gitlens.hovers.enabled": false,
"[yaml]": {
"editor.defaultFormatter": "animus-coop.vscode-phpstorm-formatter"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[css]": {
"editor.defaultFormatter": "vscode.css-language-features"
},
"git.autofetch": true,
"redhat.telemetry.enabled": true,
"debug.console.fontSize": 15,
"window.commandCenter": false,
"window.zoomPerWindow": false,
"[vue]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"git.autofetchPeriod": 300,
"workbench.startupEditor": "none",
"workbench.editor.wrapTabs": true,
"window.density.editorTabHeight": "compact",
"gitlens.views.searchAndCompare.files.layout": "tree",
"diffEditor.hideUnchangedRegions.enabled": true,
"workbench.iconTheme": "vscode-icons",
"github.gitAuthentication": false,
"git.terminalAuthentication": false,
"files.associations": {
"*.curl": "shellscript",
"*.vue": "jade"
},
"database-client.autoSync": true,
"explorer.compactFolders": false,
"outline.showConstants": false,
"terminal.integrated.tabs.defaultIcon": "terminal-cmd",
"terminal.integrated.suggest.enabled": false,
"cSpell.blockCheckingWhenLineLengthGreaterThan": 100000,
"intelephense.environment.phpVersion": "8.3.0",
"intelephense.phpdoc.classTemplate": {
"summary": "$1",
"tags": [
"@package ${1:$SYMBOL_NAMESPACE}"
]
},
"git.blame.statusBarItem.enabled": false,
"cSpell.userWords": [
"asevalar",
"Bitrix",
"evalar",
"Fitomarket",
"IBLOCK"
],
"outline.collapseItems": "alwaysCollapse",
"outline-map.expand": "cursor",
"outline-map.defaultMaxDepth": 2,
"workbench.activityBar.location": "top",
"chat.commandCenter.enabled": false,
"[dockercompose]": {
"editor.insertSpaces": true,
"editor.tabSize": 2,
"editor.autoIndent": "advanced",
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"[github-actions-workflow]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"window.zoomLevel": 1
}
Пример "кеймапа"
[
{
"key": "ctrl+d",
"command": "editor.action.duplicateSelection"
},
{
"key": "ctrl+shift+i",
"command": "editor.action.formatSelection",
"when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+k ctrl+f",
"command": "-editor.action.formatSelection",
"when": "editorHasDocumentSelectionFormattingProvider && editorTextFocus && !editorReadonly"
},
{
"key": "ctrl+shift+o",
"command": "outline.focus"
},
{
"key": "ctrl+shift+o",
"command": "workbench.action.toggleAuxiliaryBar"
},
{
"key": "ctrl+alt+b",
"command": "-workbench.action.toggleAuxiliaryBar"
},
{
"key": "ctrl+shift+i",
"command": "-editor.action.formatDocument.none",
"when": "editorTextFocus && !editorHasDocumentFormattingProvider && !editorReadonly"
},
{
"key": "shift+alt+i",
"command": "editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "ctrl+shift+i",
"command": "-editor.action.formatDocument",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && !editorReadonly && !inCompositeEditor"
},
{
"key": "ctrl+shift+i",
"command": "-notebook.formatCell",
"when": "editorHasDocumentFormattingProvider && editorTextFocus && inCompositeEditor && notebookEditable && !editorReadonly && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "ctrl+shift+i",
"command": "-notebook.format",
"when": "notebookEditable && !editorTextFocus && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "f11",
"command": "-extension.node-debug.startWithStopOnEntry",
"when": "!inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'node' || !inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'pwa-extensionHost' || !inDebugMode && activeViewlet == 'workbench.view.debug' && debugConfigurationType == 'pwa-node'"
},
{
"key": "f11",
"command": "-extension.php-debug.startWithStopOnEntry",
"when": "!inDebugMode && debugConfigurationType == 'php'"
},
{
"key": "f11",
"command": "-workbench.action.debug.stepInto",
"when": "debugState != 'inactive'"
},
{
"key": "ctrl+alt+p",
"command": "postman-for-vscode.sidebar-panel.focus"
},
{
"key": "ctrl+enter",
"command": "httpie-client.request"
},
{
"key": "ctrl+shift+[",
"command": "editor.foldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+0",
"command": "-editor.foldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+]",
"command": "editor.unfoldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+k ctrl+j",
"command": "-editor.unfoldAll",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+]",
"command": "editor.unfold",
"when": "editorTextFocus && foldingEnabled"
},
{
"key": "ctrl+shift+]",
"command": "-editor.unfold",
"when": "editorTextFocus && foldingEnabled"
}
]