String selectedText = caretModel.getCurrentCaret().getSelectedText() Įven though this action is the same for both editor and console windows, accessing the selected text works the same way. Manual configuration of PHPStan settings in the corresponding inspection options. Automatic detection of PHPStan settings from composer.json. Ability to run via remote interpreters such as Docker, WSL, and others. To get the text to search for, we’ll use the Editor API to retrieve highlighted text on the screen: Editor editor = e.getRequiredData(CommonDataKeys.EDITOR) ĬaretModel caretModel = editor.getCaretModel() On-the-fly file highlighting and ability to batch-run inspections. String languageTag = psiFile.map(PsiFile::getLanguage) But your composer.json did not contain that requirement so far. In this case, we use the PSI to determine the programming language of a file: Optional psiFile = Optional.ofNullable(e.getData(LangDataKeys.PSI_FILE)) The given hint comes from PhpStorm, not from composer itself: your IDE has detected that your code uses a method (or in this case: the ZipArchive class) that is only available when the ZIP extension is enabled. This API parses all the files in a project and provides a programmatic way to inspect them. To get the language tag, we’ll use the Program Structure Interface (PSI).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |