我是第一次使用 Atom 编辑器来处理我的 PHP 代码。 Atom 可以自动完成 PHP 的内置函数。是否可以让编辑器自动完成我编写在单独文件中的自定义函数?

函数.php

<?php
function printSomething() {
   echo "Hello World";
}

索引.php
<?php
require_once "function.php";
printSomething(); // autocompleted by Atom editor while typing

提前致谢。

最佳答案

%userprofile%.atom 中有一个名为snippets.cson 的文本文件。在那里你可以添加一个片段。

更多相关信息:http://flight-manual.atom.io/using-atom/sections/snippets/

但是您需要考虑以后也可以在其他文件上使用它。否则,您需要复制和粘贴。

关于php - 在 PHP 的 Atom 编辑器中启用自动完成或智能感知,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/35207107/

10-12 01:04
查看更多