2 Answers
To get the list of all files with errors and warnings use Code
| Inspect Code. It’s possible to specify what inspection profile to use, which directories to scan. Custom Scope provides a flexible way to include/exclude certain directories or files from the inspection results.
answered Oct 3, 2012 at 17:32
CrazyCoderCrazyCoder
390k172 gold badges990 silver badges906 bronze badges
Slightly off-topic, but may be helpful. If you need to jump through all the errors in a file (for example, CSS file), open up the file and and hit the F2
button on the keyboard. Repeat it to cycle through all the errors. To navigate back to the previous error, hit Shift + F2
answered Mar 30, 2017 at 8:45
DevnerDevner
6,85511 gold badges63 silver badges104 bronze badges
The Problems tool window displays problems that PhpStorm detects in your project using several tabs.
You can select any problem in the window and press F4 or double-click it to jump to the corresponding line in the editor.
When the design-time code inspection is enabled, this tab lists all code issues found in the current file. The list is updated as you switch between files in the editor.
Toolbar
Item |
Tooltip and shortcut |
Description |
---|---|---|
|
View Options |
Filter out code issues by their severity and configure their sorting. When no grouping or sorting options are selected, the issues are listed in the order they appear in the file. |
|
Show Quick-Fixes Alt+Enter |
Show quick-fixes available for the selected problem. |
|
Open Editor Preview |
Open the preview pane to view the selected issue in its source context right in the Problems window. Note that this preview is a normal editor where you can change the code and apply available quick-fixes. |
Item |
Shortcut |
Description |
---|---|---|
Show Quick-Fixes |
Alt+Enter |
Show quick-fixes available for the selected problem. |
Copy Problem Description |
Control+C |
Copy the problem description to the clipboard. |
Jump to Source |
F4 |
Open the code containing the problem in the editor. |
Show Error Details |
Open error details in a separate dialog. |
Toolbar
Item |
Tooltip and shortcut |
Description |
---|---|---|
|
View Options |
Filter out code issues by their severity and configure their sorting. When no grouping or sorting options are selected, the issues are listed in the order they appear in the file. |
|
Show Quick-Fixes Alt+Enter |
Show quick-fixes available for the selected problem. |
|
Open Editor Preview |
Open the preview pane to view the selected issue in its source context right in the Problems window. Note that this preview is a normal editor where you can change the code and apply available quick-fixes. |
|
Expand All |
Expand all nodes. |
|
Collapse All |
Collapse all nodes. |
Item |
Shortcut |
Description |
---|---|---|
Copy Problem Description |
Control+C |
Copy the problem description to the clipboard. |
Jump to Source |
F4 |
Open the code containing the problem in the editor. |
Show Error Details |
Open error details in a separate dialog. |
This tab displays code problems detected with Qodana. Qodana allows you run inspections locally including your IDE, and as a part of CI/CD pipelines.
Toolbar
Item |
Tooltip and shortcut |
Description |
---|---|---|
|
Log in to Qodana |
Log in to Qodana Cloud. This action is a prerequisite for linking your project with Qodana Cloud-based reports. Alternatively, you can do it from the main menu: . For more information, refer to Qodana Cloud. |
|
Logged in to Qodana |
You are logged in to Qodana Cloud. You can link your project with Qodana Cloud. |
|
Link Project with Cloud |
Link your project and upload the report to Qodana Cloud. Alternatively, you can do it from the main menu: . For more information, refer to Open report from Qodana Cloud. |
|
Linked with Cloud |
Your project is linked with Qodana Cloud. By clicking this button, you can open the inspection report in the cloud or unlink your project from Qodana Cloud. |
|
Refresh Cloud Report |
Refresh the current cloud report. |
|
View Options |
Filter out code issues by their severity and configure their sorting. When no grouping or sorting options are selected, the issues are listed in the order they appear in the file. |
|
Open Editor Preview |
Open the preview pane to view the selected issue in its source context right in the Problems window. Note that this preview is a normal editor where you can change the code and apply available quick-fixes. |
|
Expand All Control+NumPad-+ |
Expand all nodes. |
|
Collapse All Control+NumPad-- |
Collapse all nodes. |
|
Show Qodana in Browser |
Open the results of the analysis in your default browser. An interactive report opens allowing you to examine the problems in detail and navigate between the report and the IDE. |
Item |
Shortcut |
Description |
---|---|---|
Show Quick-Fixes |
Alt+Enter |
Show quick-fixes available for the selected problem. |
Jump to Source |
F4 |
Open the code with the problem in the editor. |
Show Error Details |
Learn more in formation about the detected problem in a popup. |
|
qodana.yaml |
Modify the qodana.yaml configuration file by excluding from the analysis certain files, folders, or inspections. |
Toolbar
Item |
Shortcut |
Description |
---|---|---|
|
Control+F5 |
Run the inspection and show the results on the same tab. |
|
Control+Alt+ArrowUp |
Navigate to the previous problem. |
|
Control+Alt+ArrowDown |
Navigate to the next problem. |
|
Alt+Enter |
Resolve the problem for the selected inspection item by choosing one of the available quick fixes from the list. |
|
Change the settings for the selected inspection or group of inspections in the Errors dialog. |
|
|
Group or filter found problems according to the selected option:
|
|
|
Control+NumPad-+ |
Expand all nodes. |
|
Control+NumPad-- |
Collapse all nodes. |
|
Export the inspection results into XML , Sarif, or HTML format. |
Item |
Shortcut |
Description |
---|---|---|
Jump to Source |
F4 |
Open the file that contains the selected problem in the editor and place the caret at the beginning of the corresponding code fragment. |
Exclude |
Delete |
Exclude the selected items from further examination. Excluded nodes are shown strikethrough. If the filter toggle |
Include |
Insert |
Include previously excluded items in the list of results. All nested elements are included too. |
|
Alt+Enter |
Select one of the suggested solutions. |
Suppress problem |
Suppress the inspection for the selected problem or the selected class. |
|
Edit Settings |
Change the settings for the selected inspection or group of inspections in the Errors dialog. |
|
Disable inspection |
Disable alerts for the selected inspection in the active tab of results. If the filter toggle |
|
Run inspection on |
Rerun the selected inspection and display the results on a new tab. |
Inspection report
The inspection report is shown in the right pane of the results tab when an inspection node is selected in the left pane. The report may include the following:
-
Problem resolution: A button for each of the available solutions. Clicking a button invokes the corresponding fix. If no buttons are present, you have to fix the problem yourself.
-
Suppress: Click this button to reveal the list of inspection suppress options.
-
Problem synopsis: A brief description of the problem.
-
Disable inspection: Disable alerts for the selected inspection in the active tab of results. If the filter toggle
is on, the nodes for disabled inspections are hidden.
-
Run inspection on: Rerun the selected inspection and display the results on a new tab.
Last modified: 07 September 2023
2 Answers
To get the list of all files with errors and warnings use Code
| Inspect Code. It’s possible to specify what inspection profile to use, which directories to scan. Custom Scope provides a flexible way to include/exclude certain directories or files from the inspection results.
answered Oct 3, 2012 at 17:32
CrazyCoderCrazyCoder
390k172 gold badges990 silver badges906 bronze badges
Slightly off-topic, but may be helpful. If you need to jump through all the errors in a file (for example, CSS file), open up the file and and hit the F2
button on the keyboard. Repeat it to cycle through all the errors. To navigate back to the previous error, hit Shift + F2
answered Mar 30, 2017 at 8:45
DevnerDevner
6,85511 gold badges63 silver badges104 bronze badges
Сообщение от insideone
По идее это ошибка синтаксиса.
Нет, все работает, PHP на это ни как не ругается. Я лично никакой ошибки синтаксиса там не вижу. Это простая вставка в строку значения переменной, которое обрамляется экранированными скобками. Кстати, если вытянуть все в одну строчку — PHPStorm перестает ругаться. Похоже на его баг.
Сообщение от insideone
Внутри строки которая задается через ‘ можно писать любые символы, не экранируя, кроме ‘ — этот символ надо экранировать
Любые символы кроме скобки И слеша ПЕРЕД скобкой — его тоже надо экранировать, если он является символом.
Сообщение от insideone
Правильно писать так: ‘\\’
Если необходимо получить строку со слешем (один слеш экранирует второй и тот не экранирует скобку):
PHP | ||
|
Результат:
* результат 1 символ — слеш. Парсер при сохранении почему-то его вырезает из цитаты. Вот так и тут на форуме нашелся баг.
Мне же нужна лишь скобка.
Сообщение от insideone
И ещё пример, если надо написать \A\B\C\
То в строке это будет выглядеть так:
‘\A\B\C\\’
Тогда как в строке через » так:
«\\A\\B»
С чего это вдруг?
PHP | ||
|
Результат:
string(6) «\A\B\C» string(6) «\A\B\C»
Добавлено через 4 минуты
Сообщение от ua30
Это простая вставка в строку значения переменной, которое обрамляется экранированными скобками.
Т.е. есть переменная $var = ‘qwerty’; а мне нужна строка ABC ‘qwerty’ DEF, я делаю $new_var = ‘ABC \» . $var . ‘\’ DEF’; — вот что по сути происходит…
Очень полезная команда: CTRL + SHIFT + A / Shift + CMD + A (Fine Action) — поиск любого действия в редакторе, другими словами когда вы не знаете где нужная вам команда, но можете сформулировать ключевые слова для этого действия, используйте данное сочетание клавиш.
1) Ctrl / CMD + наведение курсора на интересующую функцию/переменную — показ подробной информации про данную функцию, а если удерживая Ctrl/CMD кликнуть на интересующий нас метод, то нас перекинет на его определение.
2) Ctrl + / / CMD + / (Comment/uncomment with line comment) — закомментировать участок кода с помощью двойного слеша.
3) Ctrl + Shift + / / CMD + Alt + / (Comment/uncomment with block comment) — закомментировать участок кода с помощью комментария вида «/* */»
4) Ctrl + Shift + Backspace / CMD + Shift + Backspace (Last Edition Location) — вернуться к предыдущему месту редактирования, работает так же, даже если до этого вы редактировали другой файл.
5) Ctrl + Alt + L / CMD + Alt + L (Reformat Code) — форматирование кода, актуально как для отдельного файла, так и для всех файлов проекта. В Ubuntu это сочетание клавиш по-умолчанию вызывает блокировку экрана, поэтому нужно будет в настройках либо изменить клавиши, либо изменить сочетание для блокировки экрана (я предпочел вообще отключить данную команду в своей системе).
6) Ctrl + Space / Alt + Space (Basic) — вызов всплывающего окна с подсказками по коду.
7) Alt + Enter (Show Intention Actions) — если PHPStorm обнаруживает ошибки или находит какие-то советы, которые позволяют оптимизировать или упростить код, то он выделяет этот участок подчеркиванием и всплывающим значком лампочки (при наведении на проблемный участок), данное сочетание клавиш позволяет применить рекомендацию системы.
CTRL + N / CMD + O (Go to class) — быстрый поиск по именам классов, очень полезно когда у вас большой и сложный проект с множеством классов, которые вы хорошо знаете.
9) Ctrl + Shift + N / CMD + Shift + O (Go to file) — быстрый поиск по названиям файлов, если в проекте много файлов с одинаковыми именами (прим: index.php), то можно набирать вместе с относительным путем до файла, так же прилично экономит время и нервы.
10) CTRL + W / Alt + Стрелка вверх (Select Word at Caret) — выделение логических блоков кода, при повторном нажатии область выделения\блока увеличивается (прим: Переменная -> Метод -> Класс).
11) Двойное нажатие Shift — поиск везде (классы, файлы и т.д.), т.е. как сочетание пунктов 6 и 7.
Источники: https://donkovtcev.ru/notes/phpstorm-popular-hotkeys.html
Подсказки
Ctrl+P — Показать подсказку по параметрам метода или функции. (Parameter Info)
Ctrl+Shift+Enter — Дополнение языковых конструкций (if, switch, for, foreach)
Ctrl+Shift+I — Показать реализацию метода/функции, применяемые стили HTML класса, etc.. (Quick Definition)
Форматирование
Ctrl+D — Дублировать строку под курсором.
Ctrl+Shift+D
Ctrl+Y — Удалить строку под курсором.
Ctrl+Shift+J — Объединить выделенные строки в одну (multiline to single line). Это упрощает форматирование массивов и HTML тегов.
Ctrl+Alt+R — Отформатировать код.
Ctrl+Shift+↑↓ — Меняет строки местами, перемещает текущую строку вверх/вниз.
Ctrl+Alt+J — Обернуть HTML тегом выделенный текст или текущую строку.
Ctrl+Shift+J — может не работать, если итоговая строка будет длиннее допустимых 80-160 символов. Настроить допустимую ширину экрана/колонок, Settings » Editor » Code Style, Hard wrap at: 120.
Навигация
Ctrl+B — Открыть файл реализации класса по выделенному имени класса. То же, что и Ctrl+Click.
Ctrl+J — Окно Live Template шаблонов.
Alt+↑
Alt+↓ — Перемещение между методами класса — предыдущий метод, следующий метод
Ctrl+F12 — Окно со списком методов класса (сигнатура класса)
Ctrl+E — Окно с последними измененными файлами
Ctrl+Shift+N — Быстрый поиск и открытие файла (выделите часть имени файла или класса и нажмите сочетание клавиш).
Ctrl+Alt+Shift+N — Быстрый поиск и переход к символу (классу, методу, переменной, константе). Поиск также работает по первым символам CamelCase имени. Например по caca будет найдено CamelCase.
Ctrl+-/+ — Свернуть/развернуть (collapse/expand) блок под курсором
Ctrl+Shift+-/+ — Свернуть/развернуть (collapse/expand) все
Ctrl+Alt+-/+ — Свернуть/развернуть (collapse/expand) все комментарии (это кастомный хоткей)
Alt+Enter — Это универсальный контекстный помощник. Отображает контекстное меню с доступными действиями, в зависимости от того где находится курсор. Тут и:
- Импорт класса под курсором в секцию use;
- Обновление блока комментариев по сигнатуре метода;
- Добавление методов интерфейса, которые необходимо реализовать;
- Замена кавычек для строк;
Ctrl+W или Alt+Shift+↑ — Последовательное выделение области под кареткой. (Select Word at Caret). Я добавил еще и хоткей Alt+A — он сподручней.
Alt+1 — Показать/скрыть панель дерева файлов проекта (Project Tool Window)
Alt+2 — Я переопределил этот хоткей на панель структуры класса (Structure Tool Window)
Alt+3 — Показать/скрыть панель с результатами последнего поиска (Find Tool Window)
Alt+4 — Я заремапил этот хоткей на панель консоли (Terminal Tool Window). По умолчанию на этой клавише находится Run Tool Window, а панель терминала вызывалась по Alt+-.
Ctrl+Shift+X — Панель Command Tools Console. Консоль командных инструментов как-то Composer, Symfony 2 (app/console), Laravel (artisan), etc.. Есть поддержка дополнения кода.
Shift+Escape — Скрыть текущую активную панель (Hide Active Tool Window). Я добавил на этот экшн просто клавишу Escape.
Ctrl+Tab — Переключение между 2-мя последними вкладками редактора.
Закладки (Bookmark)
Ctrl+F11 или F11 — Поставить закладку.
Ctrl+Shift+F11 — Поставить закладку с указанием мнемоники (идентификатора, номера закладки)
Shift+F11 — Показать закладки
Кодинг и рефакторинг
Shift+F6 — Переименовать переменную (или теги HTML элемента) везде, где она используется.
Ctrl+Alt+V — Извлечь (вынести) выделенный код в переменную.
Ctrl+Alt+M — Извлечь (вынести) выделенный код в метод
F6 — Перенести static методы в другой класс вместе с обновлением всех участков кода, в которых эти методы вызываются.
Alt+F7 — Найти в проекте все (явные) места, в которых используется класс, метод, свойство, ф-ция (под курсором).
Ctrl+Shift+O-M — Список magic или родительских методов для переопределения (Override Methods). Переопределил с Ctrl+O.
Отладка
Shift+F7 — Выбрать функцию/метод для следующего «Step into»
Окна
F12 — Переключить полноэкранный режим (Toggle Full Screen Mode). Переопределил Jump to Last Tool Window.
Ctrl+Shift+P — Быстрый поиск действий (Find Action). Забрал эту комбинацию у действия Expression Type (Show type of the selected expression). Кто знает зачем это действие?
Ctrl+O — Открыть файл или проект. Забрал комбинацию у Override Methods.
Источник: https://onedev.net/post/25