Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
cd9338d
WIP: Add Span-Inspector
LeonMatthesKDAB Mar 27, 2025
413c826
added expansion of input-code
Apr 15, 2025
00455e4
added span highlighting
Apr 24, 2025
f412e4c
Add highlighting at cursor position
May 15, 2025
386c5fb
Improved errorhandling: show expansion errors in textfield
May 20, 2025
20787bc
Fix target-span determination and incorrect highlighting
Jun 3, 2025
89e8125
Sanitize expanded code in build_html
Jun 5, 2025
1e54b35
refactor: replaced get_span_data() with map
Jun 5, 2025
4b4a197
add loading indicator to span inspector
Jun 10, 2025
fd1c551
Add "{" and "}" to parsing filter
Jun 12, 2025
8b86bb5
span-inspector: make output scrollable, improve theme support, fix re…
Jun 19, 2025
eb779ba
span_inspector: add indication for synthesized tokens
Jun 24, 2025
027ec18
chore: add license headers and fix rustfmt formatting
Jun 24, 2025
3e1cd66
fix: update Cargo.lock to fix test failure with --locked
Jun 24, 2025
4d2d09d
Merge branch 'main' into span-inspector
QuentinLeeWeber Jun 24, 2025
382d5b0
fix: update Cargo.lock to fix test failure with --locked
Jun 24, 2025
61f40bd
fix: cargo test for span-inspector
Jun 26, 2025
1f9acfd
chore(clippy): apply Clippy suggestions to improve code quality
Jun 26, 2025
c9e5422
fix: update Cargo.lock
Jul 1, 2025
791cb56
fix: update Cargo.lock
Jul 1, 2025
98bab78
chore(span-inspector): optimize crate features of cxx-qt-lib
Sep 9, 2025
4276efe
chore: reorder line in Cargo.toml for clarity
Sep 9, 2025
3e7f103
chore(span_inspector): changed uri of qml_module
Sep 9, 2025
f8321b7
chore(span-inspector): removed unnecessary threadspawn
Sep 9, 2025
b9022e6
chore(span-inspector): removed unnecessary mutex for cursor_position
Sep 9, 2025
25e61d7
refactor(span-inspector): moved pretty-please filter into a universal…
Sep 9, 2025
7e562f8
refactor(span-inspector): replaced vec<(bool, bool)> with TokenFlag s…
Sep 9, 2025
b9ea593
feat(span-inspector): ensure only the last spawned thread can write t…
Sep 9, 2025
6a04fed
fix(span-inspector) THREAD_COUNT
Sep 28, 2025
7446561
refactor(span-inspector): thread_count is now a simple u32
Oct 15, 2025
1763544
chore(span-inspector): removed unnecessary use
Oct 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ members = [
"examples/qml_multi_crates/rust/main",
"examples/qml_multi_crates/rust/sub1",
"examples/qml_multi_crates/rust/sub2",
"examples/span-inspector",

"tests/basic_cxx_only/rust",
"tests/basic_cxx_qt/rust",
Expand Down
29 changes: 29 additions & 0 deletions examples/span-inspector/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# SPDX-FileCopyrightText: 2022 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
# SPDX-FileContributor: Leon Matthes <[email protected]>
# SPDX-FileContributor: Quentin Weber <[email protected]>
#
# SPDX-License-Identifier: MIT OR Apache-2.0

[package]
name = "span-inspector"
edition.workspace = true
license.workspace = true
repository.workspace = true
version.workspace = true
rust-version.workspace = true

[dependencies]
cxx.workspace = true
cxx-qt.workspace = true
cxx-qt-lib = { workspace = true, features = ["qt_full"] }
cxx-qt-macro = { workspace = true }
cxx-qt-gen = { workspace = true }
proc-macro2.workspace = true
prettyplease = { version = "0.2", features = ["verbatim"] }
syn.workspace = true

[build-dependencies]
cxx-qt-build = { workspace = true, features = ["link_qt_object_files"] }

[lints]
workspace = true
25 changes: 25 additions & 0 deletions examples/span-inspector/build.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
// SPDX-FileContributor: Leon Matthes <[email protected]>
//
// SPDX-License-Identifier: MIT OR Apache-2.0

use cxx_qt_build::{CxxQtBuilder, QmlModule};

fn main() {
let qml_module: QmlModule<'static, &str, &str> = QmlModule {
uri: "com.kdab.cxx_qt.span_inspector",
rust_files: &["src/inspector.rs"],
qml_files: &["qml/main.qml"],
..Default::default()
};
CxxQtBuilder::new()
// Link Qt's Network library
// - Qt Core is always linked
// - Qt Gui is linked by enabling the qt_gui Cargo feature of cxx-qt-lib.
// - Qt Qml is linked by enabling the qt_qml Cargo feature of cxx-qt-lib.
// - Qt Qml requires linking Qt Network on macOS
.qt_module("Network")
.qt_module("Quick")
.qml_module(qml_module)
.build();
}
63 changes: 63 additions & 0 deletions examples/span-inspector/qml/main.qml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
// SPDX-FileCopyrightText: 2025 Klarälvdalens Datakonsult AB, a KDAB Group company <[email protected]>
// SPDX-FileContributor: Leon Matthes <[email protected]>
//
// SPDX-License-Identifier: MIT OR Apache-2.0

import QtQuick
import QtQuick.Controls
import QtQuick.Window
import QtQuick.Layouts

import com.kdab.cxx_qt.span_inspector 1.0

ApplicationWindow {
id: appWindow
color: palette.window
property color textColor: color.lightness < 128 * "black", "white"
height: 480
title: qsTr("Span Inspector")
visible: true
width: 640

SpanInspector {
id: inspector
}

SplitView {
anchors.fill: parent
Item {
SplitView.preferredWidth: parent.width / 2
TextArea {
id: inputEdit
SplitView.preferredWidth: parent.width / 2
wrapMode: TextArea.Wrap
anchors.fill: parent
clip: true
color: appWindow.textColor
Component.onCompleted: {
inspector.input = textDocument;
inspector.rebuildOutput(cursorPosition);
}

onCursorPositionChanged: {
inspector.rebuildOutput(cursorPosition);
}

onTextChanged: {
inspector.rebuildOutput(cursorPosition);
}
}
}

ScrollView {
SplitView.preferredWidth: parent.width / 2
TextEdit {
clip: true
color: appWindow.textColor
text: "Hello World"
readOnly: true
Component.onCompleted: inspector.output = textDocument
}
}
}
}
Loading
Loading