forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NETBEANS-1861] Recognize @method static for documenting static methods
Example: ``` /** * Example class. * * @method testVoid(Test $test) test comment * @method int testType(Test $test) test comment * @method static staticTestVoid(Test $test) test comment * @method static int staticTestType(Test $param1, $param2) test comment * @method static ?int staticTestNullable(?string $param, int $param2) test comment * @method static ?Example getDefault() Description */ class Example { public function test() { self::staticTestVoid($test); self::staticTestType($param1, $param2); self::staticTestNullable($param1, $param2); self::getDefault(); } } ``` - Fix DeclarationFinderImpl and PHPDocCommentParser - Fix MarkOccurences and GoToDeclaration features - Add unit tests for CC, MarkOccurences, GoToDeclaration, Navigator, CommentExtractor, ASTPHP5Parser, and PHPDocCommentParser
- Loading branch information
Showing
64 changed files
with
1,589 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
php/php.editor/src/org/netbeans/modules/php/editor/model/nodes/ASTNodeInfoUtils.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.netbeans.modules.php.editor.model.nodes; | ||
|
||
import org.netbeans.modules.php.editor.model.nodes.ASTNodeInfo.Kind; | ||
import static org.netbeans.modules.php.editor.model.nodes.ASTNodeInfo.Kind.METHOD; | ||
import static org.netbeans.modules.php.editor.model.nodes.ASTNodeInfo.Kind.STATIC_METHOD; | ||
|
||
public final class ASTNodeInfoUtils { | ||
|
||
private ASTNodeInfoUtils() { | ||
} | ||
|
||
/** | ||
* Check whether the kind is METHOD or STATIC_METHOD. | ||
* | ||
* @param kind the kind | ||
* @return {@code true} if this is METHOD or STATIC_METHOD, {@code false} | ||
* otherwise | ||
*/ | ||
public static boolean isMethod(Kind kind) { | ||
return kind == METHOD || kind == STATIC_METHOD; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
...goldenfiles/org/netbeans/modules/php/editor/csl/NavigatorTest/structure/magicMethods.pass
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|-Example [1215, 1317] : ESCAPED{Example} | ||
|--testVoid [852, 860] : ESCAPED{testVoid}ESCAPED{(}<font color="#999999">ESCAPED{Test}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> | ||
|--testType [902, 910] : ESCAPED{testType}ESCAPED{(}<font color="#999999">ESCAPED{Test}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> | ||
|--staticTestVoid [955, 969] : ESCAPED{staticTestVoid}ESCAPED{(}<font color="#999999">ESCAPED{Test}ESCAPED{ }</font>ESCAPED{$test}ESCAPED{)}<font color="#999999">:ESCAPED{void}</font> | ||
|--staticTestType [1017, 1031] : ESCAPED{staticTestType}ESCAPED{(}<font color="#999999">ESCAPED{Test}ESCAPED{ }</font>ESCAPED{$param1}ESCAPED{, }ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> | ||
|--staticTestNullable [1092, 1110] : ESCAPED{staticTestNullable}ESCAPED{(}<font color="#999999">ESCAPED{?}ESCAPED{string}ESCAPED{ }</font>ESCAPED{$param}ESCAPED{, }<font color="#999999">ESCAPED{int}ESCAPED{ }</font>ESCAPED{$param2}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{int}</font> | ||
|--getDefault [1180, 1190] : ESCAPED{getDefault}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{?}ESCAPED{\Example}</font> | ||
|--test [1246, 1260] : ESCAPED{test}ESCAPED{(}ESCAPED{)} | ||
|--staticTest [1289, 1314] : ESCAPED{staticTest}ESCAPED{(}ESCAPED{)}<font color="#999999">:ESCAPED{int}</font> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.