aboutsummaryrefslogtreecommitdiff
path: root/helix-core/tests/data/indent
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core/tests/data/indent')
-rw-r--r--helix-core/tests/data/indent/cpp.cpp48
l---------helix-core/tests/data/indent/indent.rs1
-rw-r--r--helix-core/tests/data/indent/languages.toml13
3 files changed, 61 insertions, 1 deletions
diff --git a/helix-core/tests/data/indent/cpp.cpp b/helix-core/tests/data/indent/cpp.cpp
new file mode 100644
index 00000000..6e7f3a88
--- /dev/null
+++ b/helix-core/tests/data/indent/cpp.cpp
@@ -0,0 +1,48 @@
+std::vector<std::string>
+fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4,
+ char* parm5, bool parm6);
+
+std::vector<std::string>
+fn_with_many_parameters(int parm1, long parm2, float parm3, double parm4,
+ char* parm5, bool parm6) {
+ auto lambda = []() {
+ return 0;
+ };
+ auto lambda_with_a_really_long_name_that_uses_a_whole_line
+ = [](int some_more_aligned_parameters,
+ std::string parm2) {
+ do_smth();
+ };
+ if (brace_on_same_line) {
+ do_smth();
+ } else if (brace_on_next_line)
+ {
+ do_smth();
+ } else if (another_condition) {
+ do_smth();
+ }
+ else {
+ do_smth();
+ }
+ if (inline_if_statement)
+ do_smth();
+ if (another_inline_if_statement)
+ return [](int parm1, char* parm2) {
+ this_is_a_really_pointless_lambda();
+ };
+
+ switch (var) {
+ case true:
+ return -1;
+ case false:
+ return 42;
+ }
+}
+
+class MyClass : public MyBaseClass {
+public:
+ MyClass();
+ void public_fn();
+private:
+ super_secret_private_fn();
+}
diff --git a/helix-core/tests/data/indent/indent.rs b/helix-core/tests/data/indent/indent.rs
deleted file mode 120000
index 2ac16cf9..00000000
--- a/helix-core/tests/data/indent/indent.rs
+++ /dev/null
@@ -1 +0,0 @@
-../../../src/indent.rs \ No newline at end of file
diff --git a/helix-core/tests/data/indent/languages.toml b/helix-core/tests/data/indent/languages.toml
index 3206f124..fa02e451 100644
--- a/helix-core/tests/data/indent/languages.toml
+++ b/helix-core/tests/data/indent/languages.toml
@@ -11,3 +11,16 @@ indent = { tab-width = 4, unit = " " }
[[grammar]]
name = "rust"
source = { git = "https://github.com/tree-sitter/tree-sitter-rust", rev = "0431a2c60828731f27491ee9fdefe25e250ce9c9" }
+
+[[language]]
+name = "cpp"
+scope = "source.cpp"
+injection-regex = "cpp"
+file-types = ["cc", "hh", "c++", "cpp", "hpp", "h", "ipp", "tpp", "cxx", "hxx", "ixx", "txx", "ino", "C", "H"]
+roots = []
+comment-token = "//"
+indent = { tab-width = 2, unit = " " }
+
+[[grammar]]
+name = "cpp"
+source = { git = "https://github.com/tree-sitter/tree-sitter-cpp", rev = "2d2c4aee8672af4c7c8edff68e7dd4c07e88d2b1" }