Skip to content

Commit fa75aab

Browse files
committed
bug fixes for view and config string inputs autocomplete
1 parent ebde8b8 commit fa75aab

File tree

7 files changed

+24
-20
lines changed

7 files changed

+24
-20
lines changed

.github/workflows/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## What's changed
44

5-
Update executable tool via docker for laravel commands.
5+
Bug fixes for `view` and `config` method string param autocomplete, CTRL + Click
66

77
**Windows**
88

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
## [1.0.0.13]
4+
5+
Bug fixes for `view` and `config` method string param autocomplete, CTRL + Click
6+
37
## [1.0.0.12]
48

59
Update executable tool via docker for laravel commands.

manifest.mf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ Manifest-Version: 1.0
22
AutoUpdate-Show-In-Client: true
33
OpenIDE-Module: org.netbeans.modules.php.laravel
44
OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/php/laravel/resources/Bundle.properties
5-
OpenIDE-Module-Specification-Version: 1.0.0.12
5+
OpenIDE-Module-Specification-Version: 1.0.0.13
66

src/org/netbeans/modules/php/laravel/editor/HyperlinkProviderImpl.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22

33
import java.io.IOException;
44
import java.util.ArrayList;
5-
import java.util.Arrays;
65
import java.util.EnumSet;
7-
import java.util.List;
86
import java.util.Map;
97
import java.util.Set;
108
import javax.swing.text.Document;
119
import javax.swing.text.JTextComponent;
12-
import javax.swing.tree.MutableTreeNode;
1310
import org.netbeans.api.editor.*;
1411
import org.netbeans.api.editor.mimelookup.MimeRegistration;
1512
import org.netbeans.lib.editor.hyperlink.spi.HyperlinkProviderExt;
@@ -25,11 +22,9 @@
2522
import org.netbeans.modules.php.laravel.astnodes.ArrayFileVisitor.ConfigNamespace;
2623
import org.netbeans.modules.php.laravel.utils.PathUtils;
2724
import org.netbeans.modules.php.laravel.project.ProjectUtils;
28-
import org.netbeans.modules.php.laravel.utils.LaravelUtils;
2925
import org.netbeans.modules.php.laravel.utils.StringUtils;
3026
import org.openide.filesystems.FileObject;
3127
import org.openide.loaders.DataObject;
32-
import org.openide.text.DataEditorSupport;
3328
import org.openide.text.Line;
3429
import org.openide.text.NbDocument;
3530
import org.openide.util.Exceptions;
@@ -114,9 +109,11 @@ public int[] getHyperlinkSpan(Document doc, int offset, HyperlinkType type) {
114109
PhpModule module;
115110
//tooltip text
116111
switch (methodName) {
117-
case "view":
118-
case "make":
119-
case "render":
112+
case "view": // NOI18N
113+
case "make": // NOI18N
114+
case "render": // NOI18N
115+
case "send": // NOI18N
116+
case "loadView": // NOI18N
120117
module = ProjectUtils.getPhpModule(doc);
121118
FileObject dir = module.getSourceDirectory();
122119
if (dir != null) {
@@ -129,16 +126,15 @@ public int[] getHyperlinkSpan(Document doc, int offset, HyperlinkType type) {
129126
goToOffset = 0;
130127
}
131128
return new int[]{startOffset, startOffset + currentToken.length()};
132-
case "config":
129+
case "config": // NOI18N
133130
module = ProjectUtils.getPhpModule(doc);
134131
if (module == null) {
135132
break;
136133
}
137134
String[] queryConfigNamespace = identifiableText.split("\\.");
138135

139-
// ConfigurationFiles confFiles = ConfigurationFiles.getInstance(module);
136+
ConfigurationFiles confFiles = (ConfigurationFiles) LaravelPhpFrameworkProvider.getInstance().getConfigurationFiles2(module);
140137

141-
ConfigurationFiles confFiles = null;
142138
if (confFiles == null) {
143139
break;
144140
}
@@ -201,6 +197,8 @@ public void performClickAction(Document doc, int offset, HyperlinkType type) {
201197
case "view":
202198
case "make":
203199
case "render":
200+
case "send":
201+
case "loadView":
204202
case "config":
205203
if (goToFile != null) {
206204
openDocument(goToFile, goToOffset);

src/org/netbeans/modules/php/laravel/editor/completion/LaravelCompletionProvider.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Licensed to the Apache Software Foundation (ASF)
1818
import org.netbeans.modules.php.api.util.FileUtils;
1919
import org.netbeans.modules.php.editor.lexer.PHPTokenId;
2020
import org.netbeans.modules.php.laravel.ConfigurationFiles;
21+
import org.netbeans.modules.php.laravel.LaravelPhpFrameworkProvider;
2122
import org.netbeans.modules.php.laravel.editor.EditorUtils;
2223
import org.netbeans.modules.php.laravel.editor.ResourceUtilities;
2324
import org.netbeans.modules.php.laravel.project.ProjectUtils;
@@ -41,7 +42,7 @@ public class LaravelCompletionProvider implements CompletionProvider {
4142

4243
private String methodName;
4344

44-
public static String[] QUERY_METHODS = new String[]{"config", "view", "make", "render"};
45+
public static String[] QUERY_METHODS = new String[]{"config", "view", "make", "render", "send", "loadView"}; // NOI18N
4546

4647
@Override
4748
public CompletionTask createTask(int queryType, JTextComponent component) {
@@ -60,13 +61,15 @@ public CompletionTask createTask(int queryType, JTextComponent component) {
6061
if (reference != null) {
6162
AsyncCompletionQuery completionQuery;
6263

63-
switch (methodName) {
64+
switch (methodName) {
6465
case "config": // NOI18N
6566
completionQuery = new ConfigurationCompletionQuery(module);
6667
break;
6768
case "view": // NOI18N
6869
case "make": // NOI18N
6970
case "render": // NOI18N
71+
case "send": // NOI18N
72+
case "loadView": // NOI18N
7073
completionQuery = new ViewCompletionQuery(module);
7174
break;
7275
default:
@@ -156,8 +159,7 @@ protected void query(CompletionResultSet resultSet, Document doc, int caretOffse
156159
if (query == null) {
157160
return;
158161
}
159-
// ConfigurationFiles confFiles = ConfigurationFiles.getInstance(module);
160-
ConfigurationFiles confFiles = null;
162+
ConfigurationFiles confFiles = (ConfigurationFiles) LaravelPhpFrameworkProvider.getInstance().getConfigurationFiles2(module);
161163
if (confFiles != null) {
162164
confFiles.extractConfigurationMapping(false);
163165
String[] queryConfigNamespace = query.split("\\.");

src/org/netbeans/modules/php/laravel/utils/PathUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ public static List<FileObject> getParentChildrenFromPrefixPath(FileObject viewDi
9494
if (unixPath.endsWith(SLASH)) {
9595
//add children
9696

97-
list.addAll(Arrays.asList(viewDir.getChildren()));
98-
9997
if (relativeViewRoot != null) {
10098
list.addAll(Arrays.asList(relativeViewRoot.getChildren()));
99+
} else {
100+
list.addAll(Arrays.asList(viewDir.getChildren()));
101101
}
102102
} else {
103103
//filter by filename in relative context

src/org/netbeans/modules/php/laravel/utils/StringUtils.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*/
1010
public class StringUtils {
1111
public static final String SG_QUOTE = "'"; // NOI18N
12-
public static final String ESCAPED_DB_QUOTE = "\\\""; // NOI18N
12+
public static final String ESCAPED_DB_QUOTE = "\""; // NOI18N
1313
public static String implode(Collection<String> items, String delimiter) {
1414
Parameters.notNull("items", items);
1515
Parameters.notNull("delimiter", delimiter);

0 commit comments

Comments
 (0)