-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed name suggestion for dialog rename
Fixes #1719 Also, introduced tests for element descriptions Fixes #1555 See also: #1731 (cherry picked from commit bfe1530)
- Loading branch information
Showing
23 changed files
with
316 additions
and
35 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
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,108 @@ | ||
/* | ||
* Copyright 2015-2017 Alexandr Evstigneev | ||
* | ||
* Licensed 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 editor; | ||
|
||
import base.PerlLightTestCase; | ||
import org.jetbrains.annotations.NotNull; | ||
|
||
public class PerlDescriptionProviderTest extends PerlLightTestCase { | ||
@Override | ||
protected String getTestDataPath() { | ||
return "testData/descriptionProvider/perl"; | ||
} | ||
|
||
|
||
public void testLocalScalar() { | ||
doTest("my $variable<caret>_name;"); | ||
} | ||
|
||
public void testLocalArray() { | ||
doTest("my @variable<caret>_name;"); | ||
} | ||
|
||
public void testLocalHash() { | ||
doTest("my %variable<caret>_name;"); | ||
} | ||
|
||
public void testGlobalScalar() { | ||
doTest("package Foo::Bar; our $variable<caret>_name;"); | ||
} | ||
|
||
public void testGlobalArray() { | ||
doTest("package Foo::Bar; our @variable<caret>_name;"); | ||
} | ||
|
||
public void testGlobalHash() { | ||
doTest("package Foo::Bar; our %variable<caret>_name;"); | ||
} | ||
|
||
public void testMojoHelper() { | ||
doTest("$self->helper(helper_<caret>name=>sub{});"); | ||
} | ||
|
||
public void testAttribute() { | ||
doTest("has attr_n<caret>ame => {};"); | ||
} | ||
|
||
public void testAccessor() { | ||
doTest("__PACKAGE__->follow_best_practices;__PACKAGE__->mk_accessors('accessor<caret>_name');"); | ||
} | ||
|
||
public void testException() { | ||
doTest("use Exception::Class 'Sept<caret>ion1';"); | ||
} | ||
|
||
public void testMethod() { | ||
doTest("method method<caret>_name{}"); | ||
} | ||
|
||
public void testSubDeclaration() { | ||
doTest("sub sub_<caret>name;"); | ||
} | ||
|
||
public void testHeredocMarker() { | ||
doTest(); | ||
} | ||
|
||
public void testFunction() { | ||
doTest("func func_n<caret>ame{}"); | ||
} | ||
|
||
public void testConstant() { | ||
doTest("use constant CONS<caret>T_NAME => 42;"); | ||
} | ||
|
||
public void testSubDefinition() { | ||
doTest("sub sub_n<caret>ame{}"); | ||
} | ||
|
||
public void testNamespace() { | ||
doTest("package Foo::Ba<caret>zzz;"); | ||
} | ||
|
||
public void testTypeglob() { | ||
doTest("*typ<caret>eglob_name = \\$var"); | ||
} | ||
|
||
private void doTest() { | ||
doElementDescriptionTest(); | ||
} | ||
|
||
private void doTest(@NotNull String content) { | ||
doElementDescriptionTest(content); | ||
} | ||
} |
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,8 @@ | ||
UsageViewShortNameLocation: accessor_name | ||
UsageViewLongNameLocation: accessor 'accessor_name' | ||
UsageViewTypeLocation: accessor | ||
UsageViewNodeTextLocation: accessor_name | ||
NonCodeSearchDescriptionLocation: accessor_name | ||
DeleteNameDescriptionLocation: accessor_name | ||
DeleteTypeDescriptionLocation: accessor | ||
DeleteTypeDescriptionLocation: accessors |
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,8 @@ | ||
UsageViewShortNameLocation: attr_name | ||
UsageViewLongNameLocation: method 'attr_name' | ||
UsageViewTypeLocation: method | ||
UsageViewNodeTextLocation: attr_name | ||
NonCodeSearchDescriptionLocation: attr_name | ||
DeleteNameDescriptionLocation: attr_name | ||
DeleteTypeDescriptionLocation: method | ||
DeleteTypeDescriptionLocation: methods |
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,8 @@ | ||
UsageViewShortNameLocation: CONST_NAME | ||
UsageViewLongNameLocation: constant 'CONST_NAME' | ||
UsageViewTypeLocation: constant | ||
UsageViewNodeTextLocation: CONST_NAME | ||
NonCodeSearchDescriptionLocation: CONST_NAME | ||
DeleteNameDescriptionLocation: CONST_NAME | ||
DeleteTypeDescriptionLocation: constant | ||
DeleteTypeDescriptionLocation: constants |
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,8 @@ | ||
UsageViewShortNameLocation: Seption1 | ||
UsageViewLongNameLocation: exception 'Seption1' | ||
UsageViewTypeLocation: exception | ||
UsageViewNodeTextLocation: Seption1 | ||
NonCodeSearchDescriptionLocation: Seption1 | ||
DeleteNameDescriptionLocation: Seption1 | ||
DeleteTypeDescriptionLocation: exception | ||
DeleteTypeDescriptionLocation: exceptions |
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,8 @@ | ||
UsageViewShortNameLocation: func_name | ||
UsageViewLongNameLocation: function 'func_name' | ||
UsageViewTypeLocation: function | ||
UsageViewNodeTextLocation: func_name | ||
NonCodeSearchDescriptionLocation: func_name | ||
DeleteNameDescriptionLocation: func_name | ||
DeleteTypeDescriptionLocation: function | ||
DeleteTypeDescriptionLocation: functions |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: array 'variable_name' | ||
UsageViewTypeLocation: array | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: array | ||
DeleteTypeDescriptionLocation: arrays |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: hash 'variable_name' | ||
UsageViewTypeLocation: hash | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: hash | ||
DeleteTypeDescriptionLocation: hashes |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: scalar 'variable_name' | ||
UsageViewTypeLocation: scalar | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: scalar | ||
DeleteTypeDescriptionLocation: scalars |
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,3 @@ | ||
<<E<caret>OM | ||
test | ||
EOM |
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,8 @@ | ||
UsageViewShortNameLocation: EOM | ||
UsageViewLongNameLocation: heredoc marker 'EOM' | ||
UsageViewTypeLocation: heredoc marker | ||
UsageViewNodeTextLocation: EOM | ||
NonCodeSearchDescriptionLocation: EOM | ||
DeleteNameDescriptionLocation: EOM | ||
DeleteTypeDescriptionLocation: heredoc marker | ||
DeleteTypeDescriptionLocation: heredoc markers |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: array 'variable_name' | ||
UsageViewTypeLocation: array | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: array | ||
DeleteTypeDescriptionLocation: arrays |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: hash 'variable_name' | ||
UsageViewTypeLocation: hash | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: hash | ||
DeleteTypeDescriptionLocation: hashes |
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,8 @@ | ||
UsageViewShortNameLocation: variable_name | ||
UsageViewLongNameLocation: scalar 'variable_name' | ||
UsageViewTypeLocation: scalar | ||
UsageViewNodeTextLocation: variable_name | ||
NonCodeSearchDescriptionLocation: variable_name | ||
DeleteNameDescriptionLocation: variable_name | ||
DeleteTypeDescriptionLocation: scalar | ||
DeleteTypeDescriptionLocation: scalars |
Oops, something went wrong.