Skip to content

Commit 156efb3

Browse files
KonerDevrenovate[bot]Rosemoenullij
authored
chore: update soraX (#8)
* fix(deps): update dependency org.robolectric:robolectric to v4.16.1 * Update DefaultCompletionLayout.java Fix ANR caused by infinite loop in DefaultCompletionLayout Added iteration limits to prevent infinite loops in ensureListPositionVisible() that could block the main thread and cause ANR crashes. * refact(editor): expose `variableResolver` for custom variable resolver registration (close #801) * chore(editor): refer to inlay hint type names in inlay hint renderers * fix(editor): add max text length for accessibility node info Refer to newest `TextView` implementation. This settles OOM problem when the content is too large. (Xed-Editor/Xed-Editor#1132) * build(app): migrate signing config to environment variables * remove old keystore file * use newly-generated keystore from repo secrets * use `signing.properties` for local dev environment * update app version format in CI builds * build(app): move signing config vars to job-level env * docs(textmate): update README.md for TextMate * fix(editor): `SymbolInputView` always overrides the background defined in XML * refact(app): migrate to Material 3 * use Material 3 themes and widgets (partially) * always enable edge-to-edge * fix padding for bottom insets * activity no longer consumes `uiMode` configuration changes * fix(editor): non-null param is declared nullable in `SpanExternalRenderer` * fix(editor): text style in line info panel can be affected by content text * fix(app): inconsistent inlay hint position in demo * docs: update screenshots in project README * fix: fix `ConcurrentModificationException` and expose language server wrappers * feat: improve LSP server lifecycle and error handling * "Restart server" option has been added to LSP test activity, allowing for manual restarting of a language server * The `ServerStatus` enum has been converted to a sealed interface, providing more detailed state information, including the reason for shutdown (e.g., `MANUAL`, `RESTART`, `CRASH`, `TIMEOUT`). * LSP events (like `Hover`, `CodeAction`, `Completion`, etc.) now report exceptions to the server wrapper (Added `onEventException` to the `EventHandler.EventListener`) * Big refactor of the `LanguageServerWrapper` class to improve readability and maintainability * Removed nullable `requestManager` checks in various events. * Code Refinements: Renamed `CodeActionEventEvent` to `CodeActionEvent` for consistency. * chore(deps): update plugin publish to v0.36.0 * chore(deps): update gradle/actions action to v5 * chore(deps): update agp to v9.0.1 * fix(editor-lsp): improve editor lifecycle * refactor(editor-lsp): move exception handling to separate method * fix: stopping server does no longer disconnect all servers * fix(deps): update dependency org.jruby.jcodings:jcodings to v1.0.64 * fix: fix unnecessary stop of language server wrapper by tracking connected editors correctly * feat: add disable-feature option to server definition (Closes #802) * fix: fix hover window not showing (Closes #796) * fix(deps): update dependency org.jruby.joni:joni to v2.2.7 * fix: possible null reference in `EditorRenderer#applySelectedTextRange` Tracking issue: Xed-Editor/Xed-Editor#1156 * feat(deps): update Kotlin to v2.3.10 * fix(deps): update dependency org.eclipse.lsp4j:org.eclipse.lsp4j to v1 * fix(editor): fix `IndexOutOfBoundsException` on completion * fix(editor): leading whitespace is sometimes wrongly hidden * refact(editor): store text in byte array instead of char array to cut general memory usage * each character is stored as a byte in Latin1 form by default * upgrade to UTF-16 byte data when required * expected to cut roughly half memory usage in general case * test(editor): add test for `ContentLine` * perf(editor): avoid copying when create `String` in Latin1 implementation * feat(editor): add experimental shallow copying in `AsyncIncrementalAnalyzeManager` * enabling shallow copy should be able to cut the memory usage in general case * shallow copy is tested formly tested in `ContentShallowCopyTest` * fix(editor): missing support for multiline code block with more than three backquotes (close #814) * feat(app): add sample for paged editing for long files * this does not take language analysis into consideration, but simply split the file with Unicode character considered * extra storage space required for sliced file content * docs: fix license badge * fix(lsp): app crash when `textDocument/inlayHint` or `textDocument/documentColor` request is failed (#813) * feat(lsp): partially support API changes in LSP4J v1.0 (LSP v3.18.0) * Markdown in diagnostics is considered plain text. This requires editor core to introduce Markdown support * Snippet edit is degraded to normal text edit for now * fix(ci): `branches-ignore` field for renovate is wrong * chore(deps): update actions/upload-artifact action to v7 --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Rosemoe <2073412493@qq.com> Co-authored-by: Elliott Mac. <115413825+nullij@users.noreply.github.com>
1 parent 69c35eb commit 156efb3

41 files changed

Lines changed: 1308 additions & 228 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/gradle.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Android CI
33
on:
44
push:
55
branches-ignore:
6-
- 'renovate-*'
6+
- 'renovate/*'
77
paths-ignore:
88
- '**.md'
99
- '**.txt'
@@ -40,7 +40,7 @@ jobs:
4040
distribution: 'temurin'
4141

4242
- name: Setup Gradle
43-
uses: gradle/actions/setup-gradle@v3
43+
uses: gradle/actions/setup-gradle@v5
4444

4545
- name: Grant Permissions for Gradle
4646
run: chmod +x gradlew
@@ -60,7 +60,7 @@ jobs:
6060
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MVN_SIGNING_KEY_PASSWORD }}
6161

6262
- name: Upload artifact
63-
uses: actions/upload-artifact@v6
63+
uses: actions/upload-artifact@v7
6464
if: ${{ !github.head_ref }}
6565
with:
6666
name: apk-debug

README.es.md

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

33
![Banner](/images/editor_banner.jpg)
44
----
5-
[![CI](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml)
6-
[![GitHub license](https://img.shields.io/github/license/Rosemoe/CodeEditor)](https://github.com/Rosemoe/CodeEditor/blob/main/LICENSE)
5+
[![CI](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml)
6+
![GitHub License](https://img.shields.io/github/license/Rosemoe/sora-editor?link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE&link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE)
77
[![Maven Central](https://img.shields.io/maven-central/v/io.github.rosemoe/editor.svg?label=Maven%20Central)]((https://search.maven.org/search?q=io.github.rosemoe%20editor))
88
[![Telegram](https://img.shields.io/badge/Join-Telegram-blue)](https://t.me/rosemoe_code_editor)
99
[![QQ](https://img.shields.io/badge/Join-QQ_Group-ff69b4)](https://jq.qq.com/?_wv=1027&k=n68uxQws)

README.jp.md

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

33
![Banner](/images/editor_banner.jpg)
44
----
5-
[![CI](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml)
6-
[![GitHub license](https://img.shields.io/github/license/Rosemoe/CodeEditor)](https://github.com/Rosemoe/CodeEditor/blob/main/LICENSE)
5+
[![CI](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml)
6+
![GitHub License](https://img.shields.io/github/license/Rosemoe/sora-editor?link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE&link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE)
77
[![Maven Central](https://img.shields.io/maven-central/v/io.github.rosemoe/editor.svg?label=Maven%20Central)]((https://search.maven.org/search?q=io.github.rosemoe%20editor))
88
[![Telegram](https://img.shields.io/badge/Join-Telegram-blue)](https://t.me/rosemoe_code_editor)
99
[![QQ](https://img.shields.io/badge/Join-QQ_Group-ff69b4)](https://jq.qq.com/?_wv=1027&k=n68uxQws)

README.zh-cn.md

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

33
![Banner](/images/editor_banner.jpg)
44
----
5-
[![CI](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/CodeEditor/actions/workflows/gradle.yml)
6-
[![GitHub license](https://img.shields.io/github/license/Rosemoe/CodeEditor)](https://github.com/Rosemoe/CodeEditor/blob/main/LICENSE)
5+
[![CI](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Rosemoe/sora-editor/actions/workflows/gradle.yml)
6+
![GitHub License](https://img.shields.io/github/license/Rosemoe/sora-editor?link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE&link=https%3A%2F%2Fgithub.com%2FRosemoe%2Fsora-editor%2Fblob%2Fmain%2FLICENSE)
77
[![Maven Central](https://img.shields.io/maven-central/v/io.github.rosemoe/editor.svg?label=Maven%20Central)]((https://search.maven.org/search?q=io.github.rosemoe%20editor))
88
[![Telegram](https://img.shields.io/badge/Join-Telegram-blue)](https://t.me/rosemoe_code_editor)
99
[![QQ](https://img.shields.io/badge/Join-QQ_Group-ff69b4)](https://jq.qq.com/?_wv=1027&k=n68uxQws)

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ dependencies {
122122

123123
debugImplementation(libs.leakcanary)
124124
testImplementation(libs.junit)
125+
testImplementation(libs.tests.google.truth)
125126
androidTestImplementation(libs.androidx.test.junit)
126127
androidTestImplementation(libs.androidx.test.espresso)
127128
}

app/src/main/AndroidManifest.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
android:shell="true"
5050
tools:targetApi="q" />
5151

52+
<activity
53+
android:name=".tests.paged.PagedEditActivity"
54+
android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"
55+
android:exported="false"
56+
android:windowSoftInputMode="adjustResize" />
5257
<activity
5358
android:name=".tests.TestActivity"
5459
android:configChanges="orientation|keyboardHidden|screenSize|keyboard|navigation"
Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +0,0 @@
1-
/*
2-
* sora-editor - the awesome code editor for Android
3-
* https://github.com/Rosemoe/sora-editor
4-
* Copyright (C) 2020-2025 Rosemoe
5-
*
6-
* This library is free software; you can redistribute it and/or
7-
* modify it under the terms of the GNU Lesser General Public
8-
* License as published by the Free Software Foundation; either
9-
* version 2.1 of the License, or (at your option) any later version.
10-
*
11-
* This library is distributed in the hope that it will be useful,
12-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14-
* Lesser General Public License for more details.
15-
*
16-
* You should have received a copy of the GNU Lesser General Public
17-
* License along with this library; if not, write to the Free Software
18-
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19-
* USA
20-
*
21-
* Please contact Rosemoe by email 2073412493@qq.com if you need
22-
* additional information or have any questions
23-
*/
24-
package io.github.rosemoe.sora.app;
25-
26-
import android.os.Bundle;
27-
import android.view.MenuItem;
28-
29-
import androidx.annotation.NonNull;
30-
import androidx.annotation.Nullable;
31-
import androidx.appcompat.app.AppCompatActivity;
32-
33-
import io.github.rosemoe.sora.app.databinding.ActivityEditorBinding;
34-
import io.github.rosemoe.sora.widget.CodeEditor;
35-
36-
public class BaseEditorActivity extends AppCompatActivity {
37-
38-
protected ActivityEditorBinding binding;
39-
40-
protected CodeEditor editor;
41-
42-
@Override
43-
protected void onCreate(@Nullable Bundle savedInstanceState) {
44-
super.onCreate(savedInstanceState);
45-
binding = ActivityEditorBinding.inflate(getLayoutInflater());
46-
editor = binding.editor;
47-
48-
setContentView(binding.getRoot());
49-
setSupportActionBar(binding.activityToolbar);
50-
UtilsKt.applyEdgeToEdge(this, binding.toolbarContainer, binding.getRoot());
51-
52-
var supportActionBar = getSupportActionBar();
53-
if (supportActionBar != null) {
54-
supportActionBar.setDisplayHomeAsUpEnabled(true);
55-
}
56-
}
57-
58-
@Override
59-
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
60-
if (item.getItemId() == android.R.id.home) {
61-
finish();
62-
return true;
63-
}
64-
return super.onOptionsItemSelected(item);
65-
}
66-
67-
}
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* sora-editor - the awesome code editor for Android
3+
* https://github.com/Rosemoe/sora-editor
4+
* Copyright (C) 2020-2025 Rosemoe
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library; if not, write to the Free Software
18+
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
19+
* USA
20+
*
21+
* Please contact Rosemoe by email 2073412493@qq.com if you need
22+
* additional information or have any questions
23+
*/
24+
package io.github.rosemoe.sora.app
25+
26+
import android.os.Bundle
27+
import android.view.MenuItem
28+
import androidx.appcompat.app.AppCompatActivity
29+
import io.github.rosemoe.sora.app.databinding.ActivityEditorBinding
30+
import io.github.rosemoe.sora.widget.CodeEditor
31+
32+
open class BaseEditorActivity : AppCompatActivity() {
33+
protected lateinit var binding: ActivityEditorBinding
34+
35+
protected lateinit var editor: CodeEditor
36+
37+
override fun onCreate(savedInstanceState: Bundle?) {
38+
super.onCreate(savedInstanceState)
39+
binding = ActivityEditorBinding.inflate(layoutInflater)
40+
editor = binding.editor
41+
42+
setContentView(binding.root)
43+
setSupportActionBar(binding.activityToolbar)
44+
applyEdgeToEdge(this, binding.toolbarContainer, binding.root)
45+
46+
supportActionBar?.setDisplayHomeAsUpEnabled(true)
47+
}
48+
49+
override fun onOptionsItemSelected(item: MenuItem): Boolean {
50+
if (item.itemId == android.R.id.home) {
51+
finish()
52+
return true
53+
}
54+
return super.onOptionsItemSelected(item)
55+
}
56+
57+
}

app/src/main/java/io/github/rosemoe/sora/app/MainActivity.kt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
package io.github.rosemoe.sora.app
2525

2626
import android.content.DialogInterface
27-
import android.content.res.Configuration
2827
import android.graphics.Typeface
2928
import android.net.Uri
3029
import android.os.Build
@@ -53,6 +52,7 @@ import io.github.rosemoe.sora.app.databinding.ActivityMainBinding
5352
import io.github.rosemoe.sora.app.lsp.LspTestActivity
5453
import io.github.rosemoe.sora.app.lsp.LspTestJavaActivity
5554
import io.github.rosemoe.sora.app.tests.TestActivity
55+
import io.github.rosemoe.sora.app.tests.paged.PagedEditActivity
5656
import io.github.rosemoe.sora.event.ContentChangeEvent
5757
import io.github.rosemoe.sora.event.EditorKeyEvent
5858
import io.github.rosemoe.sora.event.InlayHintClickEvent
@@ -66,6 +66,7 @@ import io.github.rosemoe.sora.graphics.inlayHint.TextInlayHintRenderer
6666
import io.github.rosemoe.sora.lang.EmptyLanguage
6767
import io.github.rosemoe.sora.lang.JavaLanguageSpec
6868
import io.github.rosemoe.sora.lang.TsLanguageJava
69+
import io.github.rosemoe.sora.lang.analysis.AsyncIncrementalAnalyzeManager
6970
import io.github.rosemoe.sora.lang.diagnostic.DiagnosticRegion
7071
import io.github.rosemoe.sora.lang.diagnostic.DiagnosticsContainer
7172
import io.github.rosemoe.sora.lang.styling.color.ConstColor
@@ -128,6 +129,7 @@ class MainActivity : AppCompatActivity() {
128129
// Load tree-sitter libraries
129130
System.loadLibrary("android-tree-sitter")
130131
System.loadLibrary("tree-sitter-java")
132+
AsyncIncrementalAnalyzeManager.setUseShallowCopyByDefault(true)
131133
}
132134

133135
private const val TAG = "MainActivity"
@@ -683,6 +685,7 @@ class MainActivity : AppCompatActivity() {
683685
val editor = binding.editor
684686
when (id) {
685687
R.id.open_test_activity -> startActivity<TestActivity>()
688+
R.id.open_paged_edit -> startActivity<PagedEditActivity>()
686689
R.id.open_lsp_activity -> {
687690
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
688691
MaterialAlertDialogBuilder(this)

0 commit comments

Comments
 (0)