Skip to content

Commit 284b8f6

Browse files
author
Vitaliy Boyko
committed
Covered Require js completion and reference
1 parent 7b8eaf0 commit 284b8f6

File tree

23 files changed

+282
-75
lines changed

23 files changed

+282
-75
lines changed

src/com/magento/idea/magento2plugin/magento/packages/Package.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
public class Package {
88
public static String PACKAGES_ROOT = "app/code";
9+
public static String LIB_WEB_ROOT = "lib/web";
910
public static String APP = "app";
1011
public static String VENDOR = "vendor";
1112
public static String MODULE_BASE_AREA_DIR = "etc";

src/com/magento/idea/magento2plugin/stubs/indexes/js/MagentoLibJsIndex.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
import com.intellij.util.indexing.*;
1010
import com.intellij.util.io.EnumeratorStringDescriptor;
1111
import com.intellij.util.io.KeyDescriptor;
12+
import com.magento.idea.magento2plugin.magento.packages.File;
13+
import com.magento.idea.magento2plugin.magento.packages.Package;
14+
import com.magento.idea.magento2plugin.project.Settings;
1215
import org.jetbrains.annotations.NotNull;
1316

1417
import java.util.HashMap;
@@ -29,7 +32,8 @@ public ID<String, Void> getName() {
2932
public DataIndexer<String, Void, FileContent> getIndexer() {
3033
return inputData -> {
3134
Map<String, Void> map = new HashMap<>();
32-
String libPath = inputData.getProject().getBasePath() + "/lib/web/";
35+
String libPath = Settings.getMagentoPath(inputData.getProject()) +
36+
File.separator + Package.LIB_WEB_ROOT + File.separator;
3337
VirtualFile file = inputData.getFile();
3438

3539
if (!file.getPath().contains(libPath)){
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<form xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Ui:etc/ui_configuration.xsd">
4+
<fieldset name="general" >
5+
<field name="test_field" component="testF<caret>">
6+
</field>
7+
</fieldset>
8+
</form>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
var config = {
2+
map: {
3+
'*': {
4+
testFile: 'Foo_Bar/js/file',
5+
}
6+
},
7+
paths: {
8+
'testFile2': 'Foo_Bar/js/file2'
9+
}
10+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define([
2+
'lib'
3+
], function(lib) {
4+
'use strict';
5+
6+
return {
7+
}
8+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define([
2+
'lib'
3+
], function(lib) {
4+
'use strict';
5+
6+
return {
7+
}
8+
});
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
var test = 1;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define([
2+
'Foo_Bar/js/file<caret>'
3+
], function(test) {
4+
'use strict';
5+
6+
return {
7+
}
8+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define([
2+
'testjs<caret>'
3+
], function(test) {
4+
'use strict';
5+
6+
return {
7+
}
8+
});
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
define([
2+
'testFile<caret>'
3+
], function(test) {
4+
'use strict';
5+
6+
return {
7+
}
8+
});

0 commit comments

Comments
 (0)