fix(editor): various improvements related to tree sitter code analysis

- Integrate the 'language-treesitter' module from sora-editor into the IDE itself for better control and customization of the tree sitter analysis.

- Invalidate line span generator when tree is edited - This is required because TSTree instances are not thread-safe and the spans generator tries to query the tree after it is edited.
 This results in SEGV_MAPERR errors in native code because the TSNodes are invalidatd after TSTree.edit() calls and the cursor tries to query those invalidated nodes.

- Recycle and reuse TS* instances - When analyzing the source code using Tree Sitter, a huge number of objects are created and deleted. This results in an increased of times the garbage
 collector is invoked.
This commit is contained in:
Akash Yadav
2023-10-15 17:55:11 +05:30
parent 971fc605ff
commit d5910c6fc0
52 changed files with 3132 additions and 1202 deletions
+12
View File
@@ -147,6 +147,18 @@
<module name="AndroidIDE.testing.tooling-api.test" target="11" />
<module name="AndroidIDE.testing.unit.test" target="11" />
<module name="AndroidIDE.treesitter.test" target="1.7" />
<module name="ATS.android-tree-sitter" target="17" />
<module name="ATS.app" target="17" />
<module name="ATS.tree-sitter-aidl" target="17" />
<module name="ATS.tree-sitter-java" target="17" />
<module name="ATS.tree-sitter-json" target="17" />
<module name="ATS.tree-sitter-kotlin" target="17" />
<module name="ATS.tree-sitter-log" target="17" />
<module name="ATS.tree-sitter-python" target="17" />
<module name="ATS.tree-sitter-xml" target="17" />
<module name="build-logic.ats" target="17" />
<module name="build-logic.ats.main" target="17" />
<module name="build-logic.ats.test" target="17" />
<module name="composite-builds.plugins" target="17" />
<module name="composite-builds.plugins.main" target="17" />
<module name="composite-builds.plugins.test" target="17" />
+12 -5
View File
@@ -1,10 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="deploymentTargetDropDown">
<value>
<entry key="app">
<State />
</entry>
</value>
<targetSelectedWithDropDown>
<Target>
<type value="QUICK_BOOT_TARGET" />
<deviceKey>
<Key>
<type value="VIRTUAL_DEVICE_PATH" />
<value value="$USER_HOME$/.android/avd/Resizable_Experimental_API_33.avd" />
</Key>
</deviceKey>
</Target>
</targetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2023-10-14T04:10:20.140892617Z" />
</component>
</project>