Aptana 3 ScriptDoc - @Return 在代码辅助中不起作用

发布于 2024-12-02 13:17:45 字数 648 浏览 3 评论 0原文

我发现这个问题已经得到解答,但它并没有解决我的问题: Aptana Scriptdoc 未显示在代码辅助中

PHP 相当于他们的示例...

/**
 * Gets the current foo
 * @param {String} $fooId The unique identifier for the foo.
 * @return {Object} Returns the current foo. 
 */
public function getFoo($fooId) {
    return $bar[$fooId];
}

但是,提供的文档如下所示(包括额外的结束大括号):

getFoo($fooId)
Gets the current foo

@param String $fooId The unique identifier for the foo.
@return Object}
Resolved return types: Object}

请让我知道我做错了什么。

谢谢!

I found this question that had been answered, but it didn't solve my problem:
Aptana Scriptdoc doesn't show up in Code Assist

Using the PHP equivalent of their example...

/**
 * Gets the current foo
 * @param {String} $fooId The unique identifier for the foo.
 * @return {Object} Returns the current foo. 
 */
public function getFoo($fooId) {
    return $bar[$fooId];
}

However, the documenation provided looks like this (extra ending braces included):

getFoo($fooId)
Gets the current foo

@param String $fooId The unique identifier for the foo.
@return Object}
Resolved return types: Object}

Please let me know what I'm doing wrong.

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

各空 2024-12-09 13:17:45

@return 类型不应该用大括号括起来。

您的文档应如下所示:

/**
 * Gets the current foo
 * @param String $fooId The unique identifier for the foo.
 * @return Object Returns the current foo. 
 */
public function getFoo($fooId) {
    return $bar[$fooId];
}

返回类型的解析遵循 PHPDoc @return 规则

这也意味着您可以拥有混合返回类型,这将为您提供来自多种类型的代码辅助建议。

例如:

/**
 * @return MyClass|PDO doc doc doc 
 */

干杯

The @return type should not be wrapped with curly brackets.

Your doc should look like this:

/**
 * Gets the current foo
 * @param String $fooId The unique identifier for the foo.
 * @return Object Returns the current foo. 
 */
public function getFoo($fooId) {
    return $bar[$fooId];
}

The parsing of the return type follows the PHPDoc @return rules.

This also means you can have a mixed return type, which will give you code-assist suggestions from multiple types.

For example:

/**
 * @return MyClass|PDO doc doc doc 
 */

Cheers

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文