@player-tools/json-language-service 0.6.1-next.4 → 0.7.0-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +10 -20
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.legacy-esm.js +10 -20
- package/dist/index.mjs +10 -20
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/cjs/index.cjs
CHANGED
|
@@ -774,12 +774,9 @@ var isInView = (node) => {
|
|
|
774
774
|
var checkTypesForAssetWrapper = (nodes) => {
|
|
775
775
|
for (let i = 0; i < nodes.length; i++) {
|
|
776
776
|
const node = nodes[i];
|
|
777
|
-
if (node.type === "ref" && node.ref.includes("AssetWrapper"))
|
|
778
|
-
|
|
779
|
-
if (node.type === "
|
|
780
|
-
return checkTypesForAssetWrapper(node.or);
|
|
781
|
-
if (node.type === "and")
|
|
782
|
-
return checkTypesForAssetWrapper(node.and);
|
|
777
|
+
if (node.type === "ref" && node.ref.includes("AssetWrapper")) return true;
|
|
778
|
+
if (node.type === "or") return checkTypesForAssetWrapper(node.or);
|
|
779
|
+
if (node.type === "and") return checkTypesForAssetWrapper(node.and);
|
|
783
780
|
}
|
|
784
781
|
return false;
|
|
785
782
|
};
|
|
@@ -798,8 +795,7 @@ var AssetWrapperArrayPlugin = class {
|
|
|
798
795
|
return;
|
|
799
796
|
}
|
|
800
797
|
const xlrInfo = service.XLRService.getTypeInfoAtPosition(arrayNode);
|
|
801
|
-
if (!xlrInfo)
|
|
802
|
-
return;
|
|
798
|
+
if (!xlrInfo) return;
|
|
803
799
|
const isAssetWrapper = checkTypesForAssetWrapper(xlrInfo.nodes);
|
|
804
800
|
const parentNode = arrayNode.parent;
|
|
805
801
|
if (parentNode?.type !== "property") {
|
|
@@ -913,12 +909,9 @@ function getBindingInfo(ctx) {
|
|
|
913
909
|
var checkTypesForBinding = (nodes) => {
|
|
914
910
|
for (let i = 0; i < nodes.length; i++) {
|
|
915
911
|
const node = nodes[i];
|
|
916
|
-
if (node.type === "string" && node.name === "Binding")
|
|
917
|
-
|
|
918
|
-
if (node.type === "
|
|
919
|
-
return checkTypesForBinding(node.or);
|
|
920
|
-
if (node.type === "and")
|
|
921
|
-
return checkTypesForBinding(node.and);
|
|
912
|
+
if (node.type === "string" && node.name === "Binding") return true;
|
|
913
|
+
if (node.type === "or") return checkTypesForBinding(node.or);
|
|
914
|
+
if (node.type === "and") return checkTypesForBinding(node.and);
|
|
922
915
|
}
|
|
923
916
|
return false;
|
|
924
917
|
};
|
|
@@ -2020,15 +2013,12 @@ var XLRService = class {
|
|
|
2020
2013
|
return void 0;
|
|
2021
2014
|
}
|
|
2022
2015
|
getTypeInfoAtPosition(node) {
|
|
2023
|
-
if (!node)
|
|
2024
|
-
return;
|
|
2016
|
+
if (!node) return;
|
|
2025
2017
|
const pointer = node;
|
|
2026
2018
|
const xlrInfo = this.walker(pointer, []);
|
|
2027
|
-
if (!xlrInfo)
|
|
2028
|
-
return;
|
|
2019
|
+
if (!xlrInfo) return;
|
|
2029
2020
|
const activeNode = this.XLRSDK.getType(xlrInfo.name);
|
|
2030
|
-
if (!activeNode)
|
|
2031
|
-
return;
|
|
2021
|
+
if (!activeNode) return;
|
|
2032
2022
|
let nearestObjectTypes = [activeNode];
|
|
2033
2023
|
let pointers = [];
|
|
2034
2024
|
if (activeNode.type === "and") {
|