Skip to content

Conversation

@KJ7LNW
Copy link
Contributor

@KJ7LNW KJ7LNW commented Apr 26, 2025

Context

This PR looks big, but it can't break much. Basically it adds <list_code_definition_names> support for all tree-sitter supported languages.

Additionally, it standardizes tree-sitter test implementations across all supported languages and adds comprehensive test coverage w/ tree-sitter queries for new languages including:

  • Elixir
  • Embedded Template
  • OCaml
  • Scala
  • Solidity
  • SystemRDL
  • TLA+
  • TOML
  • Vue
  • Zig

Implementation

Key improvements:

  • Standardized test structure and naming across all languages
  • Moved test samples to dedicated fixtures directory
  • Implemented consistent line number pattern matching
  • Added comprehensive test coverage for supported structures
  • Maintained 1:1 mapping between queries, tests and samples
  • Documented unsupported features in TODO sections
  • Enhanced Java query patterns for better structure capture
  • Improved MIN_COMPONENT_LINES implementation with getter/setter

How to Test

  1. Run tree-sitter tests for any supported language
  2. Verify test structure follows standardized pattern
  3. Check that fixtures are properly loaded
  4. Confirm line number matching works consistently
  5. Validate query patterns capture expected structures

Languages

inspectCpp.test.ts

    3--8 | void multiline_function_prototype(
    2--178 | // Function declaration test - showing prototype over 4 lines
    11--21 | void function_with_implementation(
    11--14 | void function_with_implementation(
    24--30 | struct four_field_struct
    33--40 | class base_class_definition
    37--37 |     virtual ~base_class_definition() = default;
    34--40 | {
    43--49 | union four_member_union
    52--58 | enum class scoped_enumeration : uint8_t
    61--66 | typedef std::vector<
    2--179 | // Function declaration test - showing prototype over 4 lines
    69--75 | namespace deeply_nested_namespace
    70--75 | {
    71--74 |     namespace inner
    73--73 |         void nested_function();
    72--74 |     {
    78--92 | template<
    83--92 | class template_class_definition
    95--104 | #define MULTI_LINE_MACRO(x, y) \\
    106--111 | static const std::map<
    109--111 | > global_variable_definition = {
    114--125 | class constructor_test
    117--121 |     constructor_test(
    115--125 | {
    117--120 |     constructor_test(
    128--135 | class destructor_test
    131--134 |     ~destructor_test()
    129--135 | {
    131--131 |     ~destructor_test()
    138--159 | class operator_test
    141--149 |     bool operator==(
    139--159 | {
    141--143 |     bool operator==(
    151--156 |     bool operator<(
    151--153 |     bool operator<(
    162--169 | class friendship_class
    165--165 |     friend class friend_class;
    163--169 | {
    166--168 |     friend void friend_function(
    172--178 | class using_declaration_test :
    176--176 |     using base_class_definition::virtual_method;
    174--178 | {

inspectCSharp.test.ts

    2--390 | // Using directives test - at least 4 lines long
    9--9 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    9--22 | [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method)]
    13--13 |     public string Category { get; }
    14--14 |     public int Priority { get; }
    25--357 | namespace TestNamespaceDefinition
    28--34 |     public interface ITestInterfaceDefinition
    31--31 |         void TestInterfaceMethod(string message);
    32--32 |         string TestInterfaceFormatMethod(string message, TestEnumDefinition level);
    33--33 |         int TestInterfaceCalculateMethod(int x, int y);
    37--44 |     public enum TestEnumDefinition
    47--149 |     public class TestClassDefinition : ITestInterfaceDefinition
    54--58 |         public string TestPropertyDefinition
    60--64 |         public TestEnumDefinition TestPropertyWithAccessor
    67--71 |         public string TestPropertyWithInit
    74--78 |         public required string TestRequiredProperty
    82--94 |         public event EventHandler<TestEventArgsDefinition> TestEventDefinition
    97--101 |         public delegate void TestDelegateDefinition(
    113--121 |         [TestAttributeDefinition("Interface", 2)]
    126--127 |         public string TestInterfaceFormatMethod(string message, TestEnumDefinition level) =>
    132--133 |         public static int TestStaticMethodDefinition() =>
    136--140 |         public int TestInterfaceCalculateMethod(int x, int y)
    143--148 |         public T TestGenericMethodDefinition<T>(string message) where T : class
    143--143 |         public T TestGenericMethodDefinition<T>(string message) where T : class
    152--163 |     public class TestEventArgsDefinition : EventArgs
    155--155 |         public string Message { get; }
    166--186 |     public struct TestStructDefinition
    182--185 |         public override string ToString()
    189--199 |     public record TestRecordDefinition(string Message, TestEnumDefinition Level, DateTime Timestamp)
    192--192 |         public string FormattedTimestamp => Timestamp.ToString("yyyy-MM-dd HH:mm:ss");
    195--198 |         public string TestRecordMethodDefinition()
    202--212 |     public partial class TestPartialClassDefinition
    207--211 |         public string TestPartialMethod1(string key)
    215--226 |     public partial class TestPartialClassDefinition
    220--225 |         public void TestPartialMethod2(string key, string value)
    229--242 |     public static class TestStaticClassDefinition
    232--235 |         public static void TestExtensionMethod1(this ITestInterfaceDefinition logger, string message)
    238--241 |         public static void TestExtensionMethod2(this ITestInterfaceDefinition logger, Exception ex)
    245--264 |     public class TestGenericClassDefinition<T> where T : class, new()
    245--245 |     public class TestGenericClassDefinition<T> where T : class, new()
    249--252 |         public void TestGenericClassMethod1(T item)
    254--257 |         public List<T> TestGenericClassMethod2()
    259--263 |         public T TestGenericMethodWithConstraint<TId>(TId id) where TId : IEquatable<TId>
    259--259 |         public T TestGenericMethodWithConstraint<TId>(TId id) where TId : IEquatable<TId>
    267--286 |     public class TestOuterClassDefinition
    277--285 |         public class TestNestedClassDefinition
    281--284 |             public void TestNestedMethod()
    289--313 |     public class TestAsyncClassDefinition
    291--300 |         public async Task TestAsyncMethodDefinition(string data)
    302--306 |         private async Task<string> TestAsyncPrivateMethod1(string data)
    308--312 |         private async Task TestAsyncPrivateMethod2(string result)
    316--323 |     public abstract class TestAbstractClassDefinition
    319--319 |         public abstract string TestAbstractProperty { get; }
    322--322 |         public abstract double TestAbstractMethod();
    326--339 |     public class TestDerivedClass1 : TestAbstractClassDefinition
    328--328 |         public double TestProperty1 { get; set; }
    331--331 |         public override string TestAbstractProperty => "Derived1";
    338--338 |         public override double TestAbstractMethod() => Math.PI * TestProperty1 * TestProperty1;
    341--356 |     public class TestDerivedClass2 : TestAbstractClassDefinition
    343--343 |         public double TestProperty2 { get; set; }
    344--344 |         public double TestProperty3 { get; set; }
    347--347 |         public override string TestAbstractProperty => "Derived2";
    355--355 |         public override double TestAbstractMethod() => TestProperty2 * TestProperty3;
    360--372 | namespace TestFileScopedNamespaceDefinition
    363--371 |     public class TestFileScopedClassDefinition
    367--370 |         public void TestFileScopedMethod()
    374--388 |     public class TestLinqExpressionDefinition
    378--387 |         public IEnumerable<int> TestLinqMethod()
    381--384 |             var result = from num in _numbers

inspectCSS.test.ts

    4--4 |   --test-variable-definition-primary: #3498db;
    5--5 |   --test-variable-definition-secondary: #2ecc71;
    6--6 |   --test-variable-definition-accent: #e74c3c;
    7--7 |   --test-variable-definition-text: #333333;
    14--14 | @import './test-import-definition-variables.css';
    18--18 |   .test-media-query-definition-container {
    19--19 |     padding: 20px;
    20--20 |     margin: 10px;
    25--34 | @keyframes test-keyframe-definition-fade {
    27--27 |     opacity: 0;
    28--28 |     transform: translateY(-10px);
    31--31 |     opacity: 1;
    32--32 |     transform: translateY(0);
    37--37 | .test-animation-definition {
    38--38 |   animation-name: test-keyframe-definition-fade;
    39--39 |   animation-duration: 1s;
    40--40 |   animation-timing-function: ease-in-out;
    41--41 |   animation-fill-mode: forwards;
    45--45 | .test-function-definition {
    46--51 |   background-color: rgba(
    52--55 |   transform: translate(
    59--59 | .test-mixin-definition {
    60--60 |   --button-padding: 10px 15px;
    61--61 |   --button-border-radius: 4px;
    62--62 |   --button-font-weight: bold;
    63--63 |   --button-transition: all 0.3s ease;
    67--67 | .test-ruleset-definition {
    68--68 |   color: var(--test-variable-definition-text);
    69--69 |   font-family: 'Open Sans', sans-serif;
    70--70 |   font-size: 16px;
    71--71 |   line-height: 1.5;
    75--75 | .test-selector-definition:hover,
    76--76 | .test-selector-definition:focus,
    79--79 |   color: var(--test-variable-definition-accent);
    83--83 | .test-nested-ruleset-definition {
    84--84 |   display: flex;
    85--85 |   flex-direction: column;
    88--88 |     margin-bottom: 10px;
    89--89 |     padding: 15px;
    93--93 |     color: blue;
    94--94 |     font-weight: bold;

inspectC.test.ts

    (translation_unit (comment) (comment) (preproc_ifdef name: (identifier) (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg)) alternative: (preproc_else (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg)))) (comment) (preproc_if condition: (preproc_defined (identifier)) (preproc_if condition: (binary_expression left: (identifier) right: (number_literal)) (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg)) alternative: (preproc_else (preproc_def name: (identifier) value: (preproc_arg)) (preproc_def name: (identifier) value: (preproc_arg))))) (comment) (preproc_def name: (identifier) value: (preproc_arg) (comment)) (ERROR (identifier) (preproc_arg) (comment)) (comment) (preproc_def name: (identifier) value: (preproc_arg) (comment) (MISSING "preproc_include_token2")) (ERROR (binary_expression left: (number_literal) (comment) right: (number_literal)) (comment)) (comment) (preproc_ifdef name: (identifier) (preproc_if condition: (binary_expression left: (binary_expression left: (preproc_defined (identifier)) right: (preproc_defined (identifier))) right: (parenthesized_expression (binary_expression left: (identifier) right: (number_literal)))) (preproc_def name: (identifier)))) (comment) (preproc_function_def name: (identifier) parameters: (preproc_params (identifier) (identifier)) value: (preproc_arg)) (preproc_function_def name: (identifier) parameters: (preproc_params (identifier) (identifier)) value: (preproc_arg)) (comment) (preproc_ifdef name: (identifier) (preproc_function_def name: (identifier) parameters: (preproc_params (identifier) (identifier)) value: (preproc_arg)) alternative: (preproc_else (preproc_function_def name: (identifier) parameters: (preproc_params (identifier) (identifier)) value: (preproc_arg)))) (comment) (comment) (declaration (storage_class_specifier) (type_qualifier) type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (parenthesized_expression (binary_expression left: (binary_expression left: (number_literal) right: (number_literal)) (comment) right: (number_literal)) (comment)))) (declaration (storage_class_specifier) (type_qualifier) type: (primitive_type) declarator: (init_declarator declarator: (pointer_declarator (type_qualifier) declarator: (array_declarator declarator: (identifier))) value: (initializer_list (identifier) (comment) (identifier) (comment) (string_literal (string_content)) (comment) (string_literal (string_content)) (comment)))) (comment) (declaration (storage_class_specifier) type: (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment))) declarator: (init_declarator declarator: (identifier) value: (initializer_list (initializer_pair designator: (field_designator (field_identifier)) value: (number_literal)) (initializer_pair designator: (field_designator (field_identifier)) value: (string_literal (string_content))) (initializer_pair designator: (field_designator (field_identifier)) value: (number_literal)) (initializer_pair designator: (field_designator (field_identifier)) value: (number_literal))))) (comment) (comment) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier))))) (comment) (comment) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type)) (comment)))) (comment) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (abstract_pointer_declarator))))) (parameter_declaration type: (primitive_type) declarator: (identifier))))) (comment) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (variadic_parameter)))) (ERROR (pointer_expression argument: (identifier)) (identifier)) (declaration type: (type_identifier) declarator: (identifier) (MISSING ";")) (expression_statement (update_expression argument: (binary_expression left: (binary_expression left: (binary_expression left: (binary_expression left: (identifier) (ERROR (UNEXPECTED '@') (identifier) (identifier) (identifier) (identifier) (identifier)) right: (identifier)) (ERROR (UNEXPECTED '@') (primitive_type) (identifier)) right: (call_expression function: (identifier) arguments: (argument_list (ERROR (number_literal) (identifier)) (identifier)))) right: (MISSING identifier)) (ERROR (identifier)) right: (call_expression function: (identifier) arguments: (argument_list (ERROR (identifier) (identifier)) (binary_expression left: (identifier) right: (identifier))))) operator: (MISSING "--"))) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (type_identifier))) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (abstract_pointer_declarator)) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (abstract_pointer_declarator))))) (declaration (storage_class_specifier) type: (type_identifier) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier))))) (comment) (declaration type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (variadic_parameter)))) (comment) (comment) (comment) (union_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (field_identifier))) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment))) (comment) (union_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (struct_specifier body: (field_declaration_list (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))))) declarator: (field_identifier)) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)))) (comment) (comment) (comment) (union_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (field_identifier))) (comment) (field_declaration type: (sized_type_specifier) declarator: (field_identifier)) (comment))) (comment) (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (struct_specifier body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))))) declarator: (field_identifier)))) (comment) (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier) (bitfield_clause (number_literal))))) (comment) (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (field_identifier))) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier)))))) (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (field_declaration type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (field_identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier))))))) (comment) (comment) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (identifier))) (return_statement (identifier)))) (comment) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (array_declarator declarator: (identifier) size: (number_literal))) (parameter_declaration type: (primitive_type) declarator: (array_declarator declarator: (array_declarator declarator: (identifier) size: (number_literal)) size: (number_literal))) (parameter_declaration type: (primitive_type) declarator: (identifier)))) body: (compound_statement (for_statement initializer: (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (number_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression argument: (identifier)) body: (compound_statement (expression_statement (assignment_expression left: (subscript_expression argument: (identifier) index: (identifier)) right: (number_literal))))))) (comment) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (pointer_declarator declarator: (identifier)))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))))) body: (compound_statement (if_statement condition: (parenthesized_expression (identifier)) consequence: (compound_statement (expression_statement (assignment_expression left: (pointer_expression argument: (identifier)) right: (number_literal))))))) (comment) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (identifier)) (variadic_parameter))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (number_literal))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (comment) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (pointer_declarator declarator: (identifier)))) (parameter_declaration type: (struct_specifier name: (type_identifier)) declarator: (pointer_declarator declarator: (identifier))) (parameter_declaration type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (abstract_pointer_declarator))))))) body: (compound_statement (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (compound_statement (expression_statement (assignment_expression left: (field_expression argument: (identifier) field: (field_identifier)) right: (pointer_expression argument: (identifier)))))))) (comment) (preproc_include path: (system_lib_string)) (function_definition type: (primitive_type) declarator: (function_declarator declarator: (identifier) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (variadic_parameter))) body: (compound_statement (declaration type: (type_identifier) declarator: (identifier)) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier)))) (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (number_literal))) (for_statement initializer: (declaration type: (primitive_type) declarator: (init_declarator declarator: (identifier) value: (number_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression argument: (identifier)) body: (compound_statement (expression_statement (assignment_expression left: (identifier) right: (call_expression function: (identifier) arguments: (argument_list (identifier) (identifier))))))) (expression_statement (call_expression function: (identifier) arguments: (argument_list (identifier)))) (return_statement (identifier)))) (comment) (comment) (comment) (enum_specifier name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (number_literal)) (comment) (enumerator name: (identifier)) (comment) (enumerator name: (identifier)) (comment) (enumerator name: (identifier)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment))) (comment) (enum_specifier name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)))) (comment) (enum_specifier name: (type_identifier) body: (enumerator_list (enumerator name: (identifier)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment) (enumerator name: (identifier)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment))) (enum_specifier name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (number_literal)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment) (enumerator name: (identifier) value: (number_literal)) (comment))) (comment) (comment) (type_definition type: (struct_specifier body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (comment))) declarator: (type_identifier)) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (type_identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (comment) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (identifier)) (comment)))) (comment) (type_definition type: (sized_type_specifier) declarator: (type_identifier)) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (array_declarator declarator: (type_identifier) size: (number_literal)))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier)))))) (expression_statement (assignment_expression left: (identifier) right: (number_literal)) (comment) (ERROR)) (comment) (enum_specifier name: (type_identifier) body: (enumerator_list (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)) (enumerator name: (identifier) value: (number_literal)))) (comment) (comment) (type_definition type: (struct_specifier body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (comment))) declarator: (type_identifier)) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (type_identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (comment) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (identifier)) (comment)))) (comment) (type_definition type: (sized_type_specifier) declarator: (type_identifier)) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (array_declarator declarator: (type_identifier) size: (number_literal)))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (identifier)) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier)))))) (comment) (comment) (type_definition type: (struct_specifier body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (array_declarator declarator: (field_identifier) size: (number_literal))) (comment) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (comment) (field_declaration type: (primitive_type) declarator: (field_identifier)) (comment))) declarator: (type_identifier)) (comment) (comment) (type_definition type: (primitive_type) declarator: (function_declarator declarator: (parenthesized_declarator (pointer_declarator declarator: (type_identifier))) parameters: (parameter_list (parameter_declaration type: (primitive_type) declarator: (identifier)) (comment) (parameter_declaration (type_qualifier) type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (primitive_type) declarator: (pointer_declarator declarator: (identifier))) (comment) (parameter_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (identifier)) (comment) (parameter_declaration type: (primitive_type) declarator: (identifier)) (comment)))) (comment) (comment) (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (struct_specifier body: (field_declaration_list (field_declaration type: (union_specifier body: (field_declaration_list (field_declaration type: (struct_specifier body: (field_declaration_list (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier))))) (field_declaration type: (sized_type_specifier type: (primitive_type)) declarator: (field_identifier)))))))))) (comment) (struct_specifier name: (type_identifier) body: (field_declaration_list (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (macro_type_specifier name: (identifier) (ERROR (number_literal)) type: (type_descriptor type: (primitive_type)) (MISSING ")")) declarator: (field_identifier)) (field_declaration type: (primitive_type) declarator: (field_identifier)) (field_declaration type: (macro_type_specifier name: (identifier) (ERROR (number_literal)) type: (type_descriptor type: (primitive_type)) (MISSING ")")) declarator: (field_identifier)))))
    6--7 |     #define TEST_PATH_SEPARATOR "\\"
    5--13 | #ifdef _WIN32
    7--8 |     #define TEST_LINE_ENDING "\r\n"
    8--9 |     #define TEST_OS "windows"
    10--11 |     #define TEST_PATH_SEPARATOR "/"
    9--13 | #else
    11--12 |     #define TEST_LINE_ENDING "\n"
    12--13 |     #define TEST_OS "unix"
    18--19 |         #define TEST_VERBOSE_LOG 1
    17--23 |     #if TEST_DEBUG_LEVEL >= 2
    19--20 |         #define TEST_TRACE_ENABLED 1
    21--22 |         #define TEST_VERBOSE_LOG 0
    20--23 |     #else
    22--23 |         #define TEST_TRACE_ENABLED 0
    27--28 | #define MAX_SIZE 1024        /* Basic size constant */
    2--453 | // ===== PREPROCESSOR DEFINITIONS =====
    32--33 | #define TIMEOUT_MS ( \
    43--44 |         #define TEST_ENABLE_ADVANCED_FEATURES
    40--44 |     #if defined(TEST_FEATURE_ADVANCED) && \
    48--53 | #define TEST_MIN(a,b) ( \
    54--59 | #define TEST_MAX(a,b) ( \
    62--71 |     #define TEST_DEBUG_LOG(level, msg, ...) do { \
    61--73 | #ifdef TEST_ENABLE_LOGGING
    72--73 |     #define TEST_DEBUG_LOG(level, msg, ...) do {} while(0)
    71--73 | #else
    78--81 | static const int MAGIC_NUMBER = (
    83--88 | static const char* const BUILD_INFO[] = {
    91--101 | static struct config_struct {
    91--96 | static struct config_struct {
    96--101 | } DEFAULT_CONFIG = {
    106--111 | void multiline_prototype(
    119--121 | void void_param_prototype(
    125--128 | void function_pointer_prototype(
    131--135 | int variadic_prototype(
    137--137 |  * Validates the provided configuration structure
    145--145 | extern TEST_COMPARE_FUNC test_get_comparator(int type);
    148--148 | int test_format_message(const char* format, ...);
    157--163 | union multitype_data_union {
    166--173 | union bitfield_union {
    182--189 | union basic_types_struct {
    192--201 | struct nested_struct {
    204--209 | struct bitfield_struct {
    212--217 | struct callback_struct {
    221--226 | int basic_multitype_function(
    227--227 |     int result = param1;
    226--229 | ) {
    232--237 | void array_param_function(
    238--238 |     for (int i = 0; i < size; i++) {
    238--240 |     for (int i = 0; i < size; i++) {
    244--249 | void pointer_param_function(
    256--260 | int variadic_impl_function(
    261--261 |     va_list args;
    260--266 | ) {
    263--263 |     int sum = 0;
    269--274 | void test_pointer_function(
    272--272 |     struct TestBasicStruct* test_ptr3,
    282--286 | int test_variadic_function(
    287--287 |     va_list args;
    286--295 | ) {
    289--289 |     int sum = 0;
    290--290 |     for (int i = 0; i < test_count; i++) {
    290--292 |     for (int i = 0; i < test_count; i++) {
    304--310 | enum sequential_value_enum {
    313--318 | enum explicit_value_enum {
    321--326 | enum mixed_value_enum {
    327--332 | enum TestBasicEnum {
    337--343 | typedef struct {
    354--354 | typedef unsigned long long timestamp_typedef;
    366--371 | enum TestValuedEnum {
    376--382 | typedef struct {
    393--393 | typedef unsigned long long timestamp_typedef;
    407--414 | typedef struct {
    432--445 | struct anonymous_union_struct {
    448--453 | struct aligned_struct {

inspectElisp.test.ts

    3--10 | (defun test-function
    13--21 | (defmacro test-macro
    32--35 | (defcustom test-custom 'default
    38--41 | (defface test-face
    44--49 | (defadvice test-advice (around test-advice-function)
    52--55 | (defgroup test-group nil

inspectElixir.test.ts

    3--7 | @moduledoc """
    1--116 | 
    10--15 | defmodule TestBehaviourDefinition do
    11--14 |   @callback test_behaviour_callback(
    18--103 | defmodule TestModuleDefinition do
    19--19 |   @behaviour TestBehaviourDefinition
    22--26 |   @test_attribute_definition [
    29--34 |   defstruct [
    37--41 |   defguard test_guard_definition(value)
    44--50 |   defmacro test_macro_definition(opts) do
    53--61 |   defimpl String.Chars,
    55--60 |     def to_string(%TestModuleDefinition{
    54--61 |     for: TestModuleDefinition do
    64--68 |   def test_function_definition(
    70--76 |   def test_function_definition(
    79--84 |   def test_pipeline_definition(input) do
    87--92 |   def test_comprehension_definition(list) do
    88--91 |     for item <- list,
    95--102 |   def test_sigil_definition do
    96--101 |     ~s"""
    106--116 | defmodule TestModuleDefinitionTest do
    109--115 |   test "test_definition",

inspectEmbeddedTemplate.test.ts

    2--4 | <%# Multi-line comment block explaining 
    1--88 | 
    6--6 | <%# Function definition block %>
    7--10 | <% def complex_helper(param1, param2)
    12--12 | <%# Class definition block %>
    13--21 | <% class TemplateHelper
    23--23 | <%# Module definition block %>
    24--32 | <% module TemplateUtils
    34--34 | <%# Control structure with nested blocks %>
    36--36 |   <% if user.authenticated? %>
    39--39 |     <% user.posts.each do |post| %>
    46--46 |         <% if post.has_comments? %>
    48--48 |             <% post.comments.each do |comment| %>
    52--52 |             <% end %>
    54--54 |         <% end %>
    56--56 |     <% end %>
    57--57 |   <% else %>
    59--59 |   <% end %>
    62--62 | <%# Helper method definition %>
    63--64 | <% def render_navigation(items)
    68--69 |      <% end
    71--71 | <%# Complex layout structure %>
    72--72 | <% content_for :header do %>
    80--80 | <% end %>
    82--82 | <%# Yield block with fallback %>
    83--83 | <% content_for :main do %>
    87--87 | <% end %>

inspectGo.test.ts

    3--3 | package main
    6--6 |     "fmt"
    7--7 |     "sync"
    8--8 |     "time"
    13--13 |     TestConstDefinition1 = "test1"
    14--14 |     TestConstDefinition2 = "test2"
    15--15 |     TestConstDefinition3 = "test3"
    16--16 |     TestConstDefinition4 = 42
    21--21 |     TestVarDefinition1 string = "var1"
    22--22 |     TestVarDefinition2 int    = 42
    23--23 |     TestVarDefinition3 bool   = true
    24--24 |     TestVarDefinition4 []int  = []int{1, 2, 3}
    28--34 | type TestInterfaceDefinition interface {
    37--42 | type TestStructDefinition struct {
    45--50 | type TestTypeDefinition struct {
    48--48 |     ch   chan string
    49--49 |     done chan struct{}
    53--59 | func TestFunctionDefinition(
    62--70 | func (t *TestStructDefinition) TestMethodDefinition(
    73--84 | func TestChannelDefinition(
    74--74 |     input chan string,
    75--75 |     output chan<- int,
    76--76 |     done <-chan struct{},
    77--84 | ) {
    87--95 | func TestGoroutineDefinition() {
    88--88 |     ch := make(chan string)
    89--89 |     done := make(chan struct{})
    98--104 | func TestDeferDefinition() {
    107--120 | func TestSelectDefinition(
    108--108 |     ch1, ch2 <-chan string,
    109--109 |     done chan struct{},
    110--120 | ) {
    123--125 | func createFile() interface{} {

inspectHtml.test.ts

    1--88 | <!DOCTYPE html>
    1--1 | <!DOCTYPE html>
    2--88 | <html lang="en">
    2--2 | <html lang="en">
    3--9 | <head>
    3--3 | <head>
    4--5 |     <meta charset="UTF-8">
    4--4 |     <meta charset="UTF-8">
    5--8 |     <meta name="viewport" 
    5--7 |     <meta name="viewport" 
    5--5 |     <meta name="viewport" 
    6--7 |           content="width=device-width, 
    8--8 |     <title>HTML Sample</title>
    10--87 | <body>
    10--10 | <body>
    12--15 |     <!-- Multi-line comment structure
    17--22 |     <div class="test-element"
    17--20 |     <div class="test-element"
    17--17 |     <div class="test-element"
    18--18 |          id="element-test"
    19--19 |          data-test="true"
    20--20 |          aria-label="Test element">
    21--21 |         <h1>Element Test</h1>
    24--30 |     <div class="test-attribute"
    24--28 |     <div class="test-attribute"
    24--24 |     <div class="test-attribute"
    25--25 |          id="attribute-test"
    26--26 |          data-custom="test"
    27--27 |          aria-hidden="true"
    28--28 |          role="presentation">
    29--29 |         Testing attributes
    32--37 |     <script type="text/javascript">
    32--32 |     <script type="text/javascript">
    39--45 |     <style type="text/css">
    39--39 |     <style type="text/css">
    47--52 |     <div class="test-text">
    47--47 |     <div class="test-text">
    48--51 |         This is a text node
    54--59 |     <div class="test-fragment">
    54--54 |     <div class="test-fragment">
    55--55 |         <p>Fragment test</p>
    56--56 |         <span>Multiple elements</span>
    57--57 |         <em>In a fragment</em>
    58--58 |         <strong>Structure</strong>
    61--66 |     <img src="test.jpg"
    61--64 |     <img src="test.jpg"
    61--61 |     <img src="test.jpg"
    62--62 |          alt="Test void element"
    63--63 |          class="test-void"
    64--64 |          loading="lazy">
    66--66 |     <br class="test-self-closing" />
    68--75 |     <div class="test-raw-text">
    68--68 |     <div class="test-raw-text">
    69--74 |         <pre>
    69--69 |         <pre>
    70--73 |             Raw text content
    77--85 |     <div class="test-nested">
    77--77 |     <div class="test-nested">
    78--84 |         <div class="level-1">
    78--78 |         <div class="level-1">
    79--83 |             <div class="level-2">
    79--79 |             <div class="level-2">
    80--82 |                 <div class="level-3">
    80--80 |                 <div class="level-3">
    81--81 |                     Deeply nested content

inspectJavaScript.test.ts

    8--15 | function testFunctionDefinition(
    2--164 | // Import statements test - inherently single-line, exempt from 4-line requirement
    18--26 | async function testAsyncFunctionDefinition(
    29--37 | function* testGeneratorFunctionDefinition(
    40--47 | const testArrowFunctionDefinition = (
    50--92 | class TestClassDefinition {
    64--69 |     testMethodDefinition(
    72--77 |     static testStaticMethodDefinition(
    80--84 |     get testGetterDefinition() {
    86--91 |     set testSetterDefinition(
    95--109 | const testObjectLiteralDefinition = {
    99--103 |     methodInObject(
    105--108 |     get computedProperty() {
    112--125 | const testJsxElementDefinition = (
    128--136 | function testDecoratorDefinition(
    139--160 | @testDecoratorDefinition
    150--159 |     @testDecoratorDefinition
    140--160 | class TestDecoratedClassDefinition {
    154--154 |         options = {}

inspectJava.test.ts

    2--2 | // Module declaration test - at least 4 lines long
    2--192 | // Module declaration test - at least 4 lines long
    3--7 | module test.module.definition {
    2--193 | // Module declaration test - at least 4 lines long
    8--8 | package test.package.definition;
    10--10 | import java.util.List;
    11--11 | import java.util.Map;
    12--12 | import java.util.function.Function;
    13--13 | import java.time.LocalDateTime;
    15--15 | // Annotation declaration test - at least 4 lines long
    16--27 | @Target({
    29--29 | // Interface declaration test - at least 4 lines long
    30--44 | public interface TestInterfaceDefinition<T extends Comparable<T>> {
    30--30 | public interface TestInterfaceDefinition<T extends Comparable<T>> {
    31--31 |     // Interface method declarations
    32--35 |     void testInterfaceMethod(
    37--37 |     // Default method in interface - 4+ lines
    38--43 |     default String testInterfaceDefaultMethod(
    46--46 | // Enum declaration test - at least 4 lines long
    47--63 | public enum TestEnumDefinition {
    53--53 |     private final int level;
    51--62 |     ERROR(3, "Error Level");
    54--54 |     private final String description;
    56--62 |     TestEnumDefinition(
    65--65 | // Class declaration test with generic type and implementation
    66--119 | @TestAnnotationDefinition(
    71--71 | public class TestClassDefinition<T extends Comparable<T>>
    74--74 |     // Field declarations - expanded to 4+ lines with annotations
    72--119 |         implements TestInterfaceDefinition<T> {
    75--79 |     @TestAnnotationDefinition(
    79--79 |     private final String prefix;
    80--80 |     private static int instanceCount = 0;
    82--82 |     // Constructor - at least 4 lines long
    83--90 |     public TestClassDefinition(
    92--92 |     // Method implementation - at least 4 lines long
    93--99 |     @Override
    101--101 |     // Generic method test - at least 4 lines long
    102--108 |     public <R extends Comparable<R>> R testGenericMethodDefinition(
    102--102 |     public <R extends Comparable<R>> R testGenericMethodDefinition(
    110--110 |     // Lambda expression test - at least 4 lines long
    111--118 |     private final Function<String, Integer> testLambdaDefinition = (
    121--121 | // Record declaration test - at least 4 lines long
    122--143 | public record TestRecordDefinition(
    128--128 |     // Compact constructor
    127--143 | ) {
    134--134 |     // Method in record - 4+ lines
    135--142 |     public String formatMessage() {
    145--145 | // Abstract class test - at least 4 lines long
    146--160 | public abstract class TestAbstractClassDefinition<T> {
    146--146 | public abstract class TestAbstractClassDefinition<T> {
    147--147 |     protected final T data;
    149--153 |     protected TestAbstractClassDefinition(
    155--155 |     // Abstract method
    156--159 |     public abstract String testAbstractMethod(
    162--162 | // Inner class test - at least 4 lines long
    163--192 | public class TestOuterClassDefinition {
    164--164 |     private int value;
    166--180 |     public class TestInnerClassDefinition {
    167--167 |         private String innerField;
    169--173 |         public TestInnerClassDefinition(
    175--179 |         public void testInnerMethod() {
    182--182 |     // Static nested class - 4+ lines
    183--191 |     public static class TestStaticNestedClassDefinition {
    184--184 |         private final String nestedField;
    186--190 |         public TestStaticNestedClassDefinition(

inspectJson.test.ts

    1--108 | {
    3--9 |   "basic_value_types": {
    4--4 |     "string_value": "This is a string with escapes: \n\t\"",
    5--5 |     "integer_value": 1000000,
    6--6 |     "float_value": 42.5,
    7--7 |     "boolean_value": true,
    8--8 |     "null_value": null
    12--24 |   "nested_object_structure": {
    13--23 |     "level1": {
    14--22 |       "level2": {
    15--21 |         "level3": {
    16--16 |           "string_key": "nested_string_value",
    17--17 |           "number_key": 12345,
    18--20 |           "object_key": {
    19--19 |             "inner_key": "inner_value"
    27--42 |   "array_structures": {
    28--34 |     "string_array": [
    35--41 |     "mixed_type_array": [
    40--40 |       { "object_key": "object_value" }
    45--62 |   "object_array": [
    46--53 |     {
    47--47 |       "object_id": 1,
    48--51 |       "object_data": {
    49--49 |         "timestamp": "2024-01-01",
    50--50 |         "updated_at": "2024-01-02"
    52--52 |       "object_state": "active"
    54--61 |     {
    55--55 |       "object_id": 2,
    56--59 |       "object_data": {
    57--57 |         "timestamp": "2024-01-03",
    58--58 |         "updated_at": "2024-01-04"
    60--60 |       "object_state": "inactive"
    65--86 |   "mixed_nesting_structure": {
    66--85 |     "config": {
    67--84 |       "items": [
    68--75 |         {
    69--69 |           "item_name": "item1",
    70--70 |           "item_enabled": true,
    71--74 |           "item_settings": {
    72--72 |             "options": ["opt1", "opt2"],
    73--73 |             "timeout_sec": 3600
    76--83 |         {
    77--77 |           "item_name": "item2",
    78--78 |           "item_enabled": false,
    79--82 |           "item_settings": {
    80--80 |             "options": ["opt3", "opt4"],
    81--81 |             "timeout_sec": 7200
    89--98 |   "all_value_types": {
    90--90 |     "string_key": "string_value",
    91--91 |     "number_key": 123.45,
    92--92 |     "boolean_key": true,
    93--93 |     "null_key": null,
    94--94 |     "array_key": [1, 2, 3],
    95--97 |     "object_key": {
    96--96 |       "nested_key": "nested_value"
    101--107 |   "string_special_content": {
    102--102 |     "newlines": "Line 1\nLine 2\tTabbed\rCarriage Return",
    103--103 |     "unicode": "Unicode chars: 世界",
    104--104 |     "quoted": "Text with \"quoted content\"",
    105--105 |     "windows_path": "C:\\Program Files\\App",
    106--106 |     "url_path": "http://example.com/path/to/resource"

inspectKotlin.test.ts

    13--27 | abstract class TestAbstractClassDefinition {
    2--402 | // Package declaration test - at least 4 lines long
    15--15 |     abstract val abstractPropertyDefinition: String
    18--18 |     abstract fun abstractMethodDefinition(): String
    21--26 |     open fun concreteMethodDefinition(
    30--46 | interface TestInterfaceDefinition {
    32--32 |     val interfacePropertyDefinition: String
    35--38 |     fun requiredMethodDefinition(
    41--45 |     fun defaultMethodDefinition(
    49--67 | enum class TestEnumClassDefinition(
    49--52 | enum class TestEnumClassDefinition(
    54--56 |         override fun describeEnumDefinition(): String {
    53--57 |     FIRST_ENUM(1, "First") {
    59--61 |         override fun describeEnumDefinition(): String {
    58--62 |     SECOND_ENUM(2, "Second") {
    64--64 |     abstract fun describeEnumDefinition(): String
    52--67 | ) {
    66--66 |     fun getEnumValueDefinition(): Int = enumValue
    70--73 | typealias TestTypeAliasDefinition<T> = (
    76--85 | @Target(
    81--85 | annotation class TestAnnotationClassDefinition(
    88--117 | @TestAnnotationClassDefinition("constructor-test")
    89--92 | class TestConstructorDefinition(
    93--93 |     private var constructorField1: String? = null
    92--117 | ) {
    94--94 |     private var constructorField2: Int = 0
    97--104 |     constructor(
    107--116 |     constructor(
    120--149 | class TestPropertyDefinition {
    122--122 |     var propertyWithPrivateSetter: Int = 0
    130--130 |     var propertyWithCustomAccessors: String = ""
    137--137 |     private var _propertyWithBackingField: String = "inactive"
    138--138 |     var propertyWithBackingField: String
    145--148 |     var delegatedPropertyDefinition: Int by Delegates.observable(0) {
    145--145 |     var delegatedPropertyDefinition: Int by Delegates.observable(0) {
    152--184 | class TestOuterClassDefinition(
    152--155 | class TestOuterClassDefinition(
    156--156 |     private val outerPropertyDefinition: String = "outer"
    155--184 | ) {
    159--165 |     inner class TestInnerClassDefinition(
    159--161 |     inner class TestInnerClassDefinition(
    162--164 |         fun innerMethodDefinition(): String {
    161--165 |     ) {
    168--174 |     class TestNestedClassDefinition(
    168--170 |     class TestNestedClassDefinition(
    171--173 |         fun nestedMethodDefinition(): String {
    170--174 |     ) {
    177--183 |     companion object TestCompanionDefinition {
    178--178 |         const val COMPANION_CONSTANT = "constant"
    180--182 |         fun companionMethodDefinition(): String {
    187--201 | data class TestDataClassDefinition<T, R>(
    187--192 | data class TestDataClassDefinition<T, R>(
    194--196 |     fun dataClassMethodDefinition(): R {
    192--201 | ) where T : Any, R : Any {
    198--200 |     fun dataClassListMethodDefinition(): List<R> {
    204--211 | fun String.testExtensionFunctionDefinition(
    209--209 |     val modified = "$extensionParam1$this$extensionParam2"
    209--210 |     val modified = "$extensionParam1$this$extensionParam2"
    214--219 | infix fun Int.testInfixFunctionDefinition(
    217--217 |     val multiplier = if (infixParam > 0) 2 else 1
    217--218 |     val multiplier = if (infixParam > 0) 2 else 1
    222--241 | class TestFlowClassDefinition {
    223--223 |     private val _stateFlowDefinition = MutableStateFlow<String>("")
    224--224 |     val stateFlowDefinition: StateFlow<String> = _stateFlowDefinition.asStateFlow()
    226--234 |     fun testFlowCollectionDefinition(
    236--240 |     fun updateStateFlowDefinition(
    244--270 | class TestCoroutineClassDefinition {
    245--247 |     private val coroutineScope = CoroutineScope(
    245--245 |     private val coroutineScope = CoroutineScope(
    249--261 |     suspend fun testSuspendFunctionDefinition(
    263--269 |     private suspend fun processSuspendItemDefinition(
    273--289 | sealed interface TestSealedInterfaceDefinition<T> {
    274--274 |     val interfaceMetadata: Map<String, Any>
    276--279 |     data class SealedSuccess<T>(
    281--284 |     data class SealedError<T>(
    286--288 |     class SealedLoading<T>(
    292--310 | object TestObjectDefinition {
    293--295 |     private var objectCount: Int by lazy {
    293--293 |     private var objectCount: Int by lazy {
    297--299 |     private fun calculateObjectCountDefinition(): Int {
    301--305 |     val objectDelegatedString by lazy {
    301--301 |     val objectDelegatedString by lazy {
    302--302 |         val prefix = "Computed"
    302--304 |         val prefix = "Computed"
    303--303 |         val value = objectCount * 2
    307--309 |     fun getObjectCountDefinition(): Int {
    313--335 | data class TestOperatorDefinition(
    313--316 | data class TestOperatorDefinition(
    317--325 |     operator fun plus(
    316--335 | ) {
    320--320 |         val otherName = other.operatorName
    320--324 |         val otherName = other.operatorName
    327--334 |     operator fun invoke(
    338--344 | fun TestOperatorDefinition.testHigherOrderFunctionDefinition(
    347--364 | suspend fun testSuspendFlowFunctionDefinition(
    352--352 |     var count = 0
    352--363 |     var count = 0
    354--359 |         val message = buildString {
    354--362 |         val message = buildString {
    354--354 |         val message = buildString {
    367--390 | sealed class TestSealedClassDefinition {
    368--368 |     abstract val sealedProperty: String
    370--373 |     data class SealedSubclassOneDefinition(
    375--381 |     class SealedSubclassTwoDefinition(
    375--377 |     class SealedSubclassTwoDefinition(
    378--380 |         fun subclassMethod(): String {
    377--381 |     ) : TestSealedClassDefinition() {
    383--389 |     object SealedSubclassThreeDefinition : TestSealedClassDefinition() {
    384--384 |         override val sealedProperty: String = "Object Subclass"
    386--388 |         fun objectMethod(): String {
    393--402 | fun TestSealedClassDefinition.testReceiverFunctionDefinition(

inspectLua.test.ts

    3--10 | function test_function(
    2--137 | -- Function declaration test - at least 4 lines long
    13--21 | local function test_local_function(
    18--18 |     local result = param1 * param2 * param3
    18--20 |     local result = param1 * param2 * param3
    24--34 | local test_table_with_methods = {
    24--24 | local test_table_with_methods = {
    37--43 | local test_table = {
    37--37 | local test_table = {
    46--51 | local test_array_table = {
    46--46 | local test_array_table = {
    54--54 | local test_if_statement_var = 10
    57--57 |     test_if_statement_var = test_if_statement_var + 1
    56--57 |     print("Greater than 5")
    60--60 |     test_if_statement_var = test_if_statement_var - 1
    59--60 |     print("Less than 5")
    63--63 |     test_if_statement_var = 5
    62--63 |     print("Equal to 5")
    83--83 | local test_while_loop_counter = 0
    86--86 |     test_while_loop_counter = test_while_loop_counter + 1
    85--89 |     print("Counter:", test_while_loop_counter)
    93--93 | local test_repeat_until_counter = 10
    96--96 |     test_repeat_until_counter = test_repeat_until_counter - 1
    95--99 |     print("Counting down:", test_repeat_until_counter)
    104--104 |     local test_do_block_var = "local to do block"
    104--107 |     local test_do_block_var = "local to do block"
    111--114 | test_variable_declaration = 
    111--111 | test_variable_declaration = 
    117--120 | local test_local_variable = 
    117--117 | local test_local_variable = 
    123--123 | local test_require = require("module_name")
    126--126 | local test_module = {}
    128--133 | function test_module.test_module_function(
    128--128 | function test_module.test_module_function(
    3--10 | function test_function(
    2--137 | -- Function declaration test - at least 4 lines long
    13--21 | local function test_local_function(
    18--18 |     local result = param1 * param2 * param3
    18--20 |     local result = param1 * param2 * param3
    24--34 | local test_table_with_methods = {
    24--24 | local test_table_with_methods = {
    37--43 | local test_table = {
    37--37 | local test_table = {
    46--51 | local test_array_table = {
    46--46 | local test_array_table = {
    54--54 | local test_if_statement_var = 10
    57--57 |     test_if_statement_var = test_if_statement_var + 1
    56--57 |     print("Greater than 5")
    60--60 |     test_if_statement_var = test_if_statement_var - 1
    59--60 |     print("Less than 5")
    63--63 |     test_if_statement_var = 5
    62--63 |     print("Equal to 5")
    83--83 | local test_while_loop_counter = 0
    86--86 |     test_while_loop_counter = test_while_loop_counter + 1
    85--89 |     print("Counter:", test_while_loop_counter)
    93--93 | local test_repeat_until_counter = 10
    96--96 |     test_repeat_until_counter = test_repeat_until_counter - 1
    95--99 |     print("Counting down:", test_repeat_until_counter)
    104--104 |     local test_do_block_var = "local to do block"
    104--107 |     local test_do_block_var = "local to do block"
    111--114 | test_variable_declaration = 
    111--111 | test_variable_declaration = 
    117--120 | local test_local_variable = 
    117--117 | local test_local_variable = 
    123--123 | local test_require = require("module_name")
    126--126 | local test_module = {}
    128--133 | function test_module.test_module_function(
    128--128 | function test_module.test_module_function(

inspectOCaml.test.ts

    3--13 | module StringSet : sig
    2--65 | (* Module with signature *)
    4--4 |   type t
    3--8 | module StringSet : sig
    9--9 |   type t = string list
    8--13 | end = struct
    10--10 |   let empty = []
    11--11 |   let add x s = x :: s
    12--12 |   let mem = List.mem
    16--23 | module OrderedMap (Key: sig
    17--17 |   type t
    16--19 | module OrderedMap (Key: sig
    20--20 |   type 'a t = (Key.t * 'a) list
    19--23 | end) = struct
    21--21 |   let empty = []
    22--22 |   let add k v map = (k, v) :: map
    26--29 | type shape =
    32--37 | type person = {
    40--43 | let rec process_list = function
    46--49 | let calculate_area ~width ~height ?(margin=0) ?(padding=0) () =
    47--47 |   let total_width = width + (2 * margin) + (2 * padding) in
    47--49 |   let total_width = width + (2 * margin) + (2 * padding) in
    48--48 |   let total_height = height + (2 * margin) + (2 * padding) in
    48--49 |   let total_height = height + (2 * margin) + (2 * padding) in
    52--57 | class virtual ['a] container = object (self)
    54--54 |   method virtual add : 'a -> unit
    55--55 |   method get_items = items
    56--56 |   method clear = items <- []
    60--65 | let make_counter initial = object
    62--62 |   method increment = count <- count + 1
    63--63 |   method decrement = count <- count - 1
    64--64 |   method get_count = count

inspectPhp.test.ts

    1--335 | <?php
    5--8 | namespace StandardNamespaceDefinition\\Core\\Testing {
    7--7 |     const NAMESPACE_VERSION = '1.0.0';
    19--19 | use StandardNamespaceDefinition\\Enums\\StandardEnumDefinition;
    20--20 | use StandardNamespaceDefinition\\Attributes\\StandardAttributeDefinition;
    23--36 | #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
    23--23 | #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_METHOD)]
    26--35 |     public function __construct(
    25--36 | {
    27--27 |         private string $description,
    26--30 |     public function __construct(
    28--28 |         private int $priority = 0,
    29--29 |         private array $tags = []
    39--70 | #[StandardAttributeDefinition(
    39--43 | #[StandardAttributeDefinition(
    47--47 |     private string $standardPrivateProperty;
    45--70 | {
    48--48 |     protected int $standardProtectedProperty;
    49--49 |     public ?array $standardNullableProperty;
    52--59 |     public function __construct(
    53--53 |         private readonly string $standardPromotedProperty,
    52--56 |     public function __construct(
    54--54 |         protected int $standardPromotedProtected = 0,
    55--55 |         public array $standardPromotedPublic = []
    62--69 |     public function standardMethodDefinition(
    73--96 | interface StandardInterfaceDefinition
    76--79 |     public function standardInterfaceMethodWithClass(
    74--96 | {
    82--85 |     public function standardInterfaceMethodNullable(
    88--90 |     public function standardInterfaceMethodVoid(
    93--95 |     public function standardInterfaceMethodMixed(
    99--118 | trait StandardTraitDefinition
    102--102 |     private string $standardTraitProperty = '';
    100--118 | {
    103--103 |     protected array $standardTraitConfig = [];
    106--114 |     protected function standardTraitMethod(
    117--117 |     abstract protected function standardTraitAbstractMethod(): void;
    121--152 | enum StandardEnumDefinition: string
    130--138 |     public function standardEnumMethod(): array
    122--152 | {
    132--137 |         return match($this) {
    141--151 |     public static function standardEnumFromString(
    144--150 |         return match($permission) {
    155--200 | #[StandardAttributeDefinition(
    155--159 | #[StandardAttributeDefinition(
    163--163 |     protected const STANDARD_STATUS_ACTIVE = 'active';
    161--200 | {
    164--164 |     protected const STANDARD_STATUS_INACTIVE = 'inactive';
    167--167 |     private static string $standardStaticProperty = '';
    170--177 |     public function __construct(
    171--171 |         private string $standardPromotedProperty,
    170--174 |     public function __construct(
    172--172 |         protected readonly int $standardReadonlyProperty,
    173--173 |         public array $standardConfig = []
    180--183 |     abstract public function standardAbstractMethod(
    186--191 |     public static function standardStaticMethod(
    194--199 |     protected function validateConfig(): void
    203--239 | #[StandardAttributeDefinition(
    203--207 | #[StandardAttributeDefinition(
    211--220 |     public function standardAbstractMethod(
    209--239 | {
    223--228 |     public function standardUnionTypesMethod(
    231--238 |     public function standardIntersectionTypesMethod(
    242--265 | $standardAnonymousClass = new class(
    247--255 |     public function __construct(
    246--265 | {
    248--248 |         private string $standardId,
    247--250 |     public function __construct(
    249--249 |         private array $standardConfig
    257--264 |     public function standardAnonymousMethod(): string
    268--283 | function standardGlobalFunction(
    286--291 | $standardArrowFunction = fn(
    294--311 | $standardHeredocContent = <<<HTML
    314--335 | $standardNowdocContent = <<<'SQL'

inspectPython.test.ts

    8--16 | @class_decorator_one
    2--144 | # NOTE: Some Python constructs are inherently single-line and exempt from the 4-line requirement:
    10--16 | class MultiLineDecoratedClass:
    15--16 |     def __init__(self, value: int):
    11--16 |     """
    15--15 |     def __init__(self, value: int):
    19--30 | class MethodContainer:
    22--30 |     def multi_line_method(
    20--30 |     """Class containing method definitions"""
    24--24 |         param1: str,
    22--27 |     def multi_line_method(
    25--25 |         param2: int,
    26--26 |         param3: list[str]
    33--43 | @function_decorator_one
    35--43 | async def multi_line_async_function(
    36--36 |     param1: str,
    35--39 | async def multi_line_async_function(
    37--37 |     param2: int,
    38--38 |     param3: list[str]
    46--55 | def multi_line_generator(
    47--47 |     start: int,
    46--50 | def multi_line_generator(
    48--48 |     end: int,
    58--63 | multi_line_lambda = (
    66--72 | multi_line_comprehension = [
    75--82 | with (
    85--97 | try:
    100--106 | from typing import (
    109--115 | def scope_demonstration():
    112--115 |     def inner_function():
    110--115 |     global global_var_one
    118--133 | def multi_line_pattern_match(value: dict):
    118--118 | def multi_line_pattern_match(value: dict):
    137--144 | multi_line_type_annotation: dict[

inspectRuby.test.ts

    2--2 | # Standard class definition test - at least 4 lines
    2--576 | # Standard class definition test - at least 4 lines
    3--37 | class StandardClassDefinition
    4--4 |   # Class-level constant with descriptive initialization
    5--10 |   STANDARD_CONFIG = {
    5--36 |   STANDARD_CONFIG = {
    6--6 |     name: "StandardClass",
    7--7 |     version: "1.0.0",
    8--8 |     description: "Test standard class definition",
    9--9 |     features: ["basic", "advanced", "expert"]
    12--12 |   # Instance method to demonstrate class functionality
    13--18 |   def standard_instance_method
    20--20 |   # Class method to demonstrate singleton method definition
    21--26 |   def self.standard_class_method
    28--28 |   # Nested class definition test
    29--36 |   class NestedClassDefinition
    30--35 |     def nested_instance_method
    39--39 | # Method definition variations test
    40--91 | class MethodDefinitionTypes
    41--41 |   # Standard instance method test
    42--47 |   def standard_instance_method(data, format: :json)
    42--90 |   def standard_instance_method(data, format: :json)
    42--42 |   def standard_instance_method(data, format: :json)
    49--49 |   # Class method test
    50--55 |   def self.class_method_example(config)
    57--57 |   # Singleton method test
    58--65 |   class << self
    59--64 |     def singleton_method_example
    67--67 |   # Method with rescue and ensure test
    68--81 |   def exception_handling_method
    72--75 |   rescue StandardError => e
    69--80 |     setup_resources
    76--80 |   ensure
    83--83 |   # Method alias test
    84--89 |   def original_method_name
    90--90 |   alias_method :aliased_method_name, :original_method_name
    93--93 | # Module definition test - demonstrating standard and nested modules
    94--118 | module StandardModuleDefinition
    95--100 |   def self.module_class_method
    95--117 |   def self.module_class_method
    102--107 |   def standard_module_method
    109--109 |   # Nested module test
    110--117 |   module NestedModuleDefinition
    111--116 |     def self.nested_module_method
    120--120 | # Module with nested components test
    121--153 | module ModuleWithComponents
    122--122 |   # Class methods module test
    123--130 |   module ClassMethods
    123--152 |   module ClassMethods
    124--129 |     def class_level_operation
    132--132 |   # Instance methods module test
    133--140 |   module InstanceMethods
    134--139 |     def instance_level_operation
    142--142 |   # Module inclusion hook test
    143--152 |   def self.included(base)
    144--144 |     base.extend(ClassMethods)
    144--151 |     base.extend(ClassMethods)
    145--145 |     base.include(InstanceMethods)
    146--151 |     base.class_eval do
    155--155 | # Mixin patterns test - demonstrating include, extend, and prepend
    156--163 | module MixinTestModule
    157--162 |   def mixin_operation
    165--165 | # Class demonstrating mixin usage
    166--166 | # Mixin test module with comprehensive functionality
    167--174 | module MixinTestModule
    168--173 |   def shared_mixin_method
    176--176 | # Class demonstrating mixin usage - at least 4 lines per mixin type
    177--206 | class MixinImplementation
    178--178 |   # Include test with method implementation
    179--179 |   include MixinTestModule
    179--205 |   include MixinTestModule
    180--185 |   def included_method
    187--187 |   # Extend test with class method implementation
    188--188 |   extend MixinTestModule
    189--196 |   class << self
    190--195 |     def extended_method
    198--198 |   # Prepend test with method implementation
    199--199 |   prepend MixinTestModule
    200--205 |   def prepended_method
    208--208 | # Block syntax test - demonstrating do/end and brace blocks
    209--245 | class BlockSyntaxExamples
    210--210 |   # Block with do/end syntax test
    211--218 |   def method_with_do_end_block
    211--244 |   def method_with_do_end_block
    212--217 |     result = [1, 2, 3, 4].map do |number|
    220--220 |   # Block with brace syntax test
    221--228 |   def method_with_brace_block
    222--227 |     result = [1, 2, 3, 4].select { |number|
    230--230 |   # Lambda definition test
    231--236 |   STANDARD_LAMBDA = lambda { |input|
    238--238 |   # Proc definition test
    239--244 |   STANDARD_PROC = Proc.new do |data|
    247--247 | # Attribute accessor test
    248--282 | class AttributeAccessorExamples
    249--249 |   # Reader attributes test
    250--253 |   attr_reader :standard_reader,
    250--281 |   attr_reader :standard_reader,
    250--250 |   attr_reader :standard_reader,
    251--251 |              :computed_reader,
    252--252 |              :cached_reader,
    253--253 |              :formatted_reader
    255--255 |   # Writer attributes test
    256--259 |   attr_writer :standard_writer,
    256--256 |   attr_writer :standard_writer,
    257--257 |              :validated_writer,
    258--258 |              :normalized_writer,
    259--259 |              :formatted_writer
    261--261 |   # Full accessor attributes test
    262--265 |   attr_accessor :standard_accessor,
    262--262 |   attr_accessor :standard_accessor,
    263--263 |                 :validated_accessor,
    264--264 |                 :normalized_accessor,
    265--265 |                 :formatted_accessor
    267--272 |   def initialize
    276--281 |   def initialize_readers
    277--277 |     @standard_reader = "Standard Read Value"
    278--278 |     @computed_reader = calculate_reader_value
    279--279 |     @cached_reader = fetch_cached_value
    280--280 |     @formatted_reader = format_reader_value
    284--284 | # Pattern matching test
    286--286 |   # Case/in pattern matching test
    287--305 |   def process_data_pattern(input)
    287--576 |   def process_data_pattern(input)
    288--304 |     case input
    289--293 |     in { type: "record", id: Integer => record_id, data: { name: String => name } }
    289--289 |     in { type: "record", id: Integer => record_id, data: { name: String => name } }
    294--298 |     in { type: "collection", items: Array => items } if items.size > 0
    294--294 |     in { type: "collection", items: Array => items } if items.size > 0
    307--307 | # Rails-style class macro test
    308--331 | class RailsStyleMacroExample < ApplicationRecord
    309--309 |   # Association macros test
    310--313 |   has_many :test_children,
    310--330 |   has_many :test_children,
    310--310 |   has_many :test_children,
    311--311 |            class_name: 'TestChild',
    312--312 |            foreign_key: 'parent_id',
    313--313 |            dependent: :destroy
    315--318 |   belongs_to :test_parent,
    315--315 |   belongs_to :test_parent,
    316--316 |              class_name: 'TestParent',
    317--317 |              foreign_key: 'parent_id',
    318--318 |              optional: true
    320--320 |   # Validation macros test
    321--324 |   validates :test_field,
    321--321 |   validates :test_field,
    322--322 |             presence: true,
    323--323 |             uniqueness: { case_sensitive: false },
    324--324 |             format: { with: /\A[A-Z0-9_]+\z/ }
    326--326 |   # Callback macros test
    327--327 |   before_validation :normalize_test_data,
    327--330 |   before_validation :normalize_test_data,
    328--328 |                    :validate_test_rules,
    329--329 |                    :check_test_state,
    330--330 |                    :ensure_test_valid
    333--333 | # Exception handling test
    334--359 | class ExceptionHandlingExample
    335--335 |   # Begin/rescue/ensure block test
    336--358 |   def exception_handling_method
    337--357 |     begin
    342--346 |     rescue TestError => e
    347--351 |     rescue StandardError => e
    352--356 |     ensure
    361--361 | # Hash and symbol definition test
    362--392 | class HashAndSymbolExamples
    363--363 |   # Hash syntax variations test
    364--372 |   HASH_EXAMPLES = {
    364--391 |   HASH_EXAMPLES = {
    365--365 |     symbol_key: 'symbol_value',
    366--366 |     'string_key' => 'string_value',
    367--367 |     :old_symbol_key => 'old_style_value',
    368--368 |     nested_hash: {
    368--371 |     nested_hash: {
    369--369 |       key1: 'value1',
    370--370 |       key2: 'value2'
    374--374 |   # Symbol definition variations test
    375--380 |   SYMBOL_EXAMPLES = [
    376--376 |     :standard_symbol,
    382--382 |   # String interpolation test
    383--391 |   def string_interpolation_example(status)
    394--394 | # REGULAR EXPRESSIONS - testing pattern matching
    395--430 | class RegexImplementation
    396--396 |   # Email validation pattern
    397--404 |   EMAIL_PATTERN = %r{
    397--429 |   EMAIL_PATTERN = %r{
    406--406 |   # URL validation pattern
    407--414 |   URL_PATTERN = %r{
    416--429 |   def validate_patterns(input)
    432--432 | # ATTRIBUTE ACCESSORS - testing comprehensive accessor patterns
    433--467 | class ModelAttributeImplementation
    434--434 |   # Reader attributes with validation
    435--438 |   attr_reader :validated_reader_attribute,
    435--466 |   attr_reader :validated_reader_attribute,
    435--435 |   attr_reader :validated_reader_attribute,
    436--436 |              :computed_reader_attribute,
    437--437 |              :cached_reader_attribute,
    438--438 |              :formatted_reader_attribute
    440--440 |   # Writer attributes with preprocessing
    441--444 |   attr_writer :validated_writer_attribute,
    441--441 |   attr_writer :validated_writer_attribute,
    442--442 |              :normalized_writer_attribute,
    443--443 |              :encrypted_writer_attribute,
    444--444 |              :formatted_writer_attribute
    446--446 |   # Full accessors with complex logic
    447--450 |   attr_accessor :managed_accessor_attribute,
    447--447 |   attr_accessor :managed_accessor_attribute,
    448--448 |                :versioned_accessor_attribute,
    449--449 |                :tracked_accessor_attribute,
    450--450 |                :cached_accessor_attribute
    452--457 |   def initialize(config)
    461--466 |   def initialize_reader_attributes(config)
    462--462 |     @validated_reader_attribute = validate_reader_input(config[:reader])
    463--463 |     @computed_reader_attribute = compute_reader_value(config[:compute])
    464--464 |     @cached_reader_attribute = cache_reader_value(config[:cache])
    465--465 |     @formatted_reader_attribute = format_reader_value(config[:format])
    469--469 | # CLASS MACROS - testing Rails-style macro implementations
    470--504 | class RailsModelImplementation < ApplicationRecord
    471--471 |   # Association macros with complex options
    472--476 |   has_many :managed_children,
    472--503 |   has_many :managed_children,
    472--472 |   has_many :managed_children,
    473--473 |            class_name: 'ManagedChild',
    474--474 |            foreign_key: 'parent_identifier',
    475--475 |            dependent: :destroy,
    476--476 |            counter_cache: true
    478--482 |   belongs_to :managed_parent,
    478--478 |   belongs_to :managed_parent,
    479--479 |              class_name: 'ManagedParent',
    480--480 |              foreign_key: 'parent_identifier',
    481--481 |              touch: true,
    482--482 |              optional: true
    484--484 |   # Validation macros with custom rules
    485--489 |   validates :identifier_field,
    485--485 |   validates :identifier_field,
    486--486 |             presence: true,
    487--487 |             uniqueness: { case_sensitive: false },
    488--488 |             format: { with: /\A[A-Z0-9_]+\z/ },
    489--489 |             length: { minimum: 8, maximum: 32 }
    491--491 |   # Callback macros with complex logic
    492--492 |   before_validation :normalize_identifier,
    492--495 |   before_validation :normalize_identifier,
    493--493 |                    :validate_business_rules,
    494--494 |                    :check_dependencies,
    495--495 |                    :ensure_valid_state
    497--497 |   # Scope macros with complex queries
    498--503 |   scope :active_records, -> {
    498--498 |   scope :active_records, -> {
    499--499 |     where(active: true)
    500--500 |       .where.not(deleted_at: nil)
    501--501 |       .order(created_at: :desc)
    502--502 |       .includes(:managed_children)
    506--506 | # EXCEPTION HANDLING - testing comprehensive error management
    507--540 | class ErrorHandlingImplementation
    508--508 |   class BusinessLogicError < StandardError; end
    508--539 |   class BusinessLogicError < StandardError; end
    509--509 |   class ValidationError < StandardError; end
    510--510 |   class ProcessingError < StandardError; end
    512--539 |   def process_with_error_handling(data)
    513--538 |     begin
    518--522 |     rescue BusinessLogicError => e
    523--527 |     rescue ValidationError => e
    528--532 |     rescue ProcessingError => e
    533--537 |     ensure
    542--542 | # METAPROGRAMMING - testing dynamic method generation
    543--576 | class MetaprogrammingImplementation
    544--544 |   # Dynamic method definition with validation
    545--545 |   [:create, :update, :delete, :archive].each do |operation|
    545--559 |   [:create, :update, :delete, :archive].each do |operation|
    546--551 |     define_method("validate_#{operation}") do |record|
    553--558 |     define_method("process_#{operation}") do |record|
    561--561 |   # Method missing implementation with logging
    545--575 |   [:create, :update, :delete, :archive].each do |operation|
    562--571 |   def method_missing(method_name, *args, &block)
    562--562 |   def method_missing(method_name, *args, &block)
    573--575 |   def respond_to_missing?(method_name, include_private = false)

inspectRust.test.ts

    3--12 | fn test_function_definition(
    2--307 | // Function definition tests - standard, async, and const functions
    14--23 | async fn test_async_function_definition(
    25--33 | const fn test_const_function_definition<T: Copy + std::fmt::Debug>(
    28--28 |     prefix: &'static str,
    29--29 |     suffix: &'static str
    37--43 | struct test_struct_definition {
    45--51 | struct test_tuple_struct_definition(
    54--54 | struct test_unit_struct_definition;
    57--82 | enum test_enum_definition {
    85--107 | trait test_trait_definition {
    101--106 |     fn test_default_method(
    110--133 | impl test_struct_definition {
    111--118 |     fn test_implementation_method(
    120--132 |     fn test_static_method(
    136--156 | impl test_trait_definition for test_struct_definition {
    137--143 |     fn test_required_method(
    145--155 |     fn test_generic_method<T: std::fmt::Debug + Clone>(
    159--176 | mod test_module_definition {
    160--160 |     use std::collections::HashMap;
    161--161 |     use std::io::{self, Read, Write};
    162--162 |     use std::time::{Duration, SystemTime};
    163--167 |     use super::{
    169--175 |     pub fn test_module_function(
    179--203 | macro_rules! test_macro_definition {
    206--213 | #[derive(
    214--219 | struct test_proc_macro_struct {
    222--222 | type test_type_alias = fn(i32, &str) -> Result<String, std::io::Error>;
    225--228 | type test_generic_type_alias<T, E> = Result<
    228--228 | > where T: Clone + Send + 'static, E: std::error::Error + 'static;
    231--232 | const TEST_CONSTANT_DEFINITION: f64 =
    234--238 | static TEST_STATIC_DEFINITION: &str =
    241--247 | struct test_lifetime_definition<'short, 'long: 'short> {
    241--241 | struct test_lifetime_definition<'short, 'long: 'short> {
    242--242 |     test_ref1: &'short str,
    243--243 |     test_ref2: &'long str,
    244--244 |     test_ref3: &'short [&'long str],
    245--245 |     test_ref4: std::collections::HashMap<&'short str, &'long str>,
    246--246 |     test_ref5: Box<dyn test_trait_definition + 'long>,
    249--261 | impl<'short, 'long: 'short> test_lifetime_definition<'short, 'long> {
    249--249 | impl<'short, 'long: 'short> test_lifetime_definition<'short, 'long> {
    250--260 |     fn test_lifetime_method<'a, 'b>(
    250--250 |     fn test_lifetime_method<'a, 'b>(
    251--251 |         &'a self,
    252--252 |         input: &'b str,
    253--253 |         data: &'short [&'long str]
    254--254 |     ) -> &'short str
    255--257 |     where
    256--256 |         'b: 'a,
    257--257 |         'short: 'b,
    265--276 | impl test_struct_definition {
    266--275 |     unsafe fn test_unsafe_function(
    279--291 | fn test_where_clause_function<T, U, V>(
    284--287 | where
    286--286 |     U: AsRef<str> + 'static,
    294--307 | fn test_match_expression(
    297--306 |     match value {

inspectScala.test.ts

    2--94 | package com.example.test
    2--2 | package com.example.test
    8--10 | class Container[A, B](val first: A, val second: B) {
    9--9 |   def swap: Container[B, A] = new Container(second, first)
    13--17 | case class TestCaseClass[A, B](
    20--23 | abstract class AbstractBase {
    26--32 | trait TestTrait {
    35--37 | object TestTrait {
    40--43 | case object SingletonValue extends AbstractBase {
    41--41 |   def abstractMethod: String = "implemented"
    42--42 |   val abstractValue: Int = 42
    46--55 | class PatternMatcher {
    47--54 |   def testMatch(value: Any): Int = value match {
    58--62 | implicit class RichString(val str: String) {
    59--61 |   def truncate(maxLength: Int): String =
    65--72 | object Types {
    66--66 |   type StringMap[T] = Map[String, T]
    68--71 |   lazy val heavyComputation: Int = {
    75--83 | class ForComprehension {
    76--82 |   def processItems(items: List[Int]): List[Int] = {
    87--94 | object Variables {
    88--88 |   val immutableValue: Int = 42
    89--89 |   var mutableValue: String = "changeable"
    91--93 |   private lazy val lazyValue: Double = {
    2--94 | package com.example.test
    2--2 | package com.example.test
    8--10 | class Container[A, B](val first: A, val second: B) {
    9--9 |   def swap: Container[B, A] = new Container(second, first)
    13--17 | case class TestCaseClass[A, B](
    20--23 | abstract class AbstractBase {
    26--32 | trait TestTrait {
    35--37 | object TestTrait {
    40--43 | case object SingletonValue extends AbstractBase {
    41--41 |   def abstractMethod: String = "implemented"
    42--42 |   val abstractValue: Int = 42
    46--55 | class PatternMatcher {
    47--54 |   def testMatch(value: Any): Int = value match {
    58--62 | implicit class RichString(val str: String) {
    59--61 |   def truncate(maxLength: Int): String =
    65--72 | object Types {
    66--66 |   type StringMap[T] = Map[String, T]
    68--71 |   lazy val heavyComputation: Int = {
    75--83 | class ForComprehension {
    76--82 |   def processItems(items: List[Int]): List[Int] = {
    87--94 | object Variables {
    88--88 |   val immutableValue: Int = 42
    89--89 |   var mutableValue: String = "changeable"
    91--93 |   private lazy val lazyValue: Double = {

inspectSolidity.test.ts

    5--9 | interface ITestInterface {
    2--102 | // SPDX-License-Identifier: MIT
    6--6 |     function interfaceFunction(uint256 value) external returns (bool);
    7--7 |     event InterfaceEvent(address indexed sender, uint256 value);
    8--8 |     error InterfaceError(string message);
    11--20 | library MathLib {
    12--14 |     function add(uint256 a, uint256 b) internal pure returns (uint256) {
    16--19 |     function subtract(uint256 a, uint256 b) internal pure returns (uint256) {
    22--102 | contract TestContract is ITestInterface {
    23--23 |     using MathLib for uint256;
    25--30 |     struct UserInfo {
    32--37 |     enum UserRole {
    39--39 |     uint256 private immutable totalSupply;
    40--40 |     mapping(address => UserInfo) private users;
    41--41 |     UserRole[] private roles;
    43--47 |     event Transfer(
    49--53 |     error InsufficientBalance(
    55--61 |     modifier onlyAdmin() {
    63--68 |     constructor(uint256 _initialSupply) {
    70--87 |     function transfer(
    89--93 |     function interfaceFunction(
    95--97 |     fallback() external payable {
    99--101 |     receive() external payable {
    5--9 | interface ITestInterface {
    2--102 | // SPDX-License-Identifier: MIT
    6--6 |     function interfaceFunction(uint256 value) external returns (bool);
    7--7 |     event InterfaceEvent(address indexed sender, uint256 value);
    8--8 |     error InterfaceError(string message);
    11--20 | library MathLib {
    12--14 |     function add(uint256 a, uint256 b) internal pure returns (uint256) {
    16--19 |     function subtract(uint256 a, uint256 b) internal pure returns (uint256) {
    22--102 | contract TestContract is ITestInterface {
    23--23 |     using MathLib for uint256;
    25--30 |     struct UserInfo {
    32--37 |     enum UserRole {
    39--39 |     uint256 private immutable totalSupply;
    40--40 |     mapping(address => UserInfo) private users;
    41--41 |     UserRole[] private roles;
    43--47 |     event Transfer(
    49--53 |     error InsufficientBalance(
    55--61 |     modifier onlyAdmin() {
    63--68 |     constructor(uint256 _initialSupply) {
    70--87 |     function transfer(
    89--93 |     function interfaceFunction(
    95--97 |     fallback() external payable {
    99--101 |     receive() external payable {

inspectSwift.test.ts

    5--11 | class StandardClassDefinition {
    2--297 | // MARK: - Class Definitions
    6--6 |     private var standardProperty: String
    8--10 |     func standardMethod() -> String {
    14--22 | final class FinalClassDefinition {
    15--15 |     private let finalProperty: Int
    17--21 |     func finalClassMethod(
    25--34 | open class OpenClassDefinition {
    26--26 |     public var openProperty: Double
    28--33 |     open func openOverridableMethod(
    37--49 | class InheritingClassDefinition: StandardClassDefinition, ProtocolDefinition {
    38--38 |     var protocolRequiredProperty: String = "Required property"
    40--42 |     override func standardMethod() -> String {
    44--48 |     func protocolRequiredMethod(
    54--63 | struct StandardStructDefinition {
    55--55 |     private var standardStructProperty: String
    56--56 |     let readOnlyProperty: Int
    58--62 |     mutating func modifyingMethod(
    66--81 | struct GenericStructDefinition<T: Comparable, U> {
    67--67 |     private var items: [T]
    68--68 |     private var mappings: [T: U]
    70--76 |     init(
    78--80 |     func findMapping(for key: T) -> U? {
    86--92 | protocol ProtocolDefinition {
    87--87 |     var protocolRequiredProperty: String { get set }
    89--91 |     func protocolRequiredMethod(
    95--105 | protocol AssociatedTypeProtocolDefinition {
    98--98 |     var items: [AssociatedItem] { get set }
    100--102 |     func add(
    104--104 |     func remove(at index: Int)
    111--116 |     func classExtensionMethod(
    110--117 | extension StandardClassDefinition {
    121--125 |     func structExtensionMethod(
    120--126 | extension StandardStructDefinition {
    130--135 |     func protocolExtensionMethod(
    129--136 | extension ProtocolDefinition {
    141--149 | class MethodContainer {
    142--148 |     func instanceMethodDefinition(
    152--160 | struct TypeMethodContainer {
    153--159 |     static func typeMethodDefinition(
    165--178 | class StoredPropertyContainer {
    167--167 |     private var privateStoredProperty: String = "Private"
    170--177 |     var storedPropertyWithObserver: Int = 0 {
    181--198 | class ComputedPropertyContainer {
    182--182 |     private var backingStorage: String = ""
    185--192 |     var computedProperty: String {
    195--197 |     var readOnlyComputedProperty: Int {
    203--215 | class DesignatedInitializerContainer {
    204--204 |     let property1: String
    205--205 |     let property2: Int
    208--214 |     init(
    218--237 | class ConvenienceInitializerContainer {
    219--219 |     let property1: String
    220--220 |     let property2: Int
    223--226 |     init(property1: String, property2: Int) {
    229--236 |     convenience init(
    242--255 | class DeinitializerDefinition {
    243--243 |     private var resource: String
    245--248 |     init(resource: String) {
    250--254 |     deinit {
    260--280 | class SubscriptDefinition {
    261--261 |     private var items: [String] = []
    263--279 |     subscript(
    285--297 | class TypeAliasContainer {
    287--287 |     typealias SimpleTypeAlias = String
    290--293 |     typealias DictionaryOfArrays<
    296--296 |     var dictionaryOfArrays: DictionaryOfArrays<String, Int> = [:]

inspectSystemRDL.test.ts

    3--25 | addrmap top_map {
    7--24 |     reg block_ctrl {
    11--16 |         field {
    16--16 |         } enable[1:0];
    18--23 |         field {
    23--23 |         } status;
    28--42 | reg status_reg {
    29--41 |     field {
    35--40 |         enum error_types {
    41--41 |     } errors[3:0];
    45--49 | property my_custom_prop {
    52--52 | parameter DATA_WIDTH {
    58--61 | enum interrupt_type {
    64--85 | reg complex_reg {
    68--72 |     field {
    72--72 |     } ctrl[7:0];
    74--78 |     field {
    78--78 |     } status[15:8];
    80--84 |     field {
    84--84 |     } flags[23:16];
    3--25 | addrmap top_map {
    7--24 |     reg block_ctrl {
    11--16 |         field {
    16--16 |         } enable[1:0];
    18--23 |         field {
    23--23 |         } status;
    28--42 | reg status_reg {
    29--41 |     field {
    35--40 |         enum error_types {
    41--41 |     } errors[3:0];
    45--49 | property my_custom_prop {
    52--52 | parameter DATA_WIDTH {
    58--61 | enum interrupt_type {
    64--85 | reg complex_reg {
    68--72 |     field {
    72--72 |     } ctrl[7:0];
    74--78 |     field {
    78--78 |     } status[15:8];
    80--84 |     field {
    84--84 |     } flags[23:16];

inspectTLAPlus.test.ts

    2--48 | ---- MODULE SimpleModule ----
    5--5 | CONSTANT N
    6--6 | VARIABLE x, y, z
    9--11 | Max(a, b) ==
    14--19 | ComplexOperator(seq) ==
    15--18 |     LET sum == 
    15--19 |     LET sum == 
    22--24 | SimpleFunction[a \in 1..N] ==
    23--23 |     LET square == a * a
    23--24 |     LET square == a * a
    27--33 | ProcessStep ==
    33--33 | vars == <<x, y, z>>
    36--40 | HandleCase(val) ==
    43--46 | Factorial[n \in Nat] ==

inspectTOML.test.ts

    4--11 | [database]
    1--72 | # This is a TOML document with various structures
    5--5 | server = "192.168.1.1"
    4--10 | [database]
    6--6 | ports = [ 8001, 8001, 8002 ]
    7--7 | connection_max = 5000
    8--8 | enabled = true
    11--16 | [servers]
    12--12 | alpha = { ip = "10.0.0.1", role = "frontend" }
    11--15 | [servers]
    13--13 | beta = { ip = "10.0.0.2", role = "backend" }
    16--21 | [owner.personal]
    17--17 | name = "Tom Preston-Werner"
    16--20 | [owner.personal]
    18--18 | dob = 1979-05-27T07:32:00-08:00
    21--26 | [[products]]
    22--22 | name = "Hammer"
    21--24 | [[products]]
    23--23 | sku = 738594937
    24--24 | color = "red"
    26--32 | [[products]]  # Array of tables
    27--27 | name = "Nail"
    26--31 | [[products]]  # Array of tables
    28--28 | sku = 284758393
    29--29 | color = "gray"
    32--58 | [complex_values]
    33--44 | strings = [
    32--57 | [complex_values]
    34--34 |     "basic string",
    35--38 |     '''
    39--39 |     'literal string',
    40--43 |     """
    45--45 | numbers = [ 42, -17, 3.14, 1e10 ]
    46--50 | dates = [
    47--47 |     1979-05-27T07:32:00-08:00,
    48--48 |     1979-05-27,
    49--49 |     07:32:00
    53--53 | "dotted.key.example" = "value"
    54--54 | physical.color = "orange"
    55--55 | physical.shape = "round"
    58--72 | [mixed_content]
    59--59 | title = "Mixed Content Example"
    58--71 | [mixed_content]
    60--64 | description = """
    65--70 | features = [
    66--66 |     "tables",
    67--67 |     "arrays",
    68--68 |     "strings",
    69--69 |     "numbers"
    71--71 | metadata = { created = 2024-01-01, updated = 2024-04-13 }

inspectTsx.test.ts

    3--8 | interface StandardInterfaceProps {
    2--325 | // Type Definitions (interfaces and type aliases) - spans 4+ lines
    10--15 | type StandardTypeAlias = {
    18--27 | interface PropsDefinitionExample {
    30--38 | function StandardFunctionComponent(props: StandardInterfaceProps): JSX.Element {
    35--35 |       {required}: {numeric}
    34--36 |     <div className="standard-component">
    41--55 | export const ArrowFunctionComponent: React.FC<PropsDefinitionExample> = ({
    51--51 |       {requiredString}
    50--53 |     <div>
    52--52 |       {optionalArray.join(', ')}
    58--63 | interface ClassComponentState {
    65--95 | class StandardClassComponent extends React.Component<StandardInterfaceProps, ClassComponentState> {
    65--65 | class StandardClassComponent extends React.Component<StandardInterfaceProps, ClassComponentState> {
    66--75 |   constructor(props: StandardInterfaceProps) {
    77--82 |   handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
    78--81 |     this.setState(prevState => ({
    79--79 |       count: prevState.count + 1,
    84--94 |   render() {
    98--111 | function withLogging<P extends object>(
    102--102 |     React.useEffect(() => {
    102--107 |     React.useEffect(() => {
    103--103 |       console.log('Component rendered with props:', props);
    104--106 |       return () => {
    105--105 |         console.log('Component will unmount');
    109--109 |     return <Component {...props} />;
    119--151 | const JSXElementsExample: React.FC = () => {
    130--135 |       <Input
    121--149 |     <div className="jsx-elements-container">
    133--133 |         onChange={(e) => console.log(e.target.value)}
    136--142 |       <UI.Button
    136--136 |       <UI.Button
    136--140 |       <UI.Button
    139--139 |         onClick={() => alert("Clicked!")}
    142--142 |       </UI.Button>
    143--148 |       <StandardFunctionComponent
    146--146 |         callback={() => {}}
    154--186 | const EventHandlersComponent: React.FC = () => {
    155--159 |   const handleClick = (event: React.MouseEvent<HTMLButtonElement>) => {
    156--156 |     console.log('Button clicked', event.currentTarget);
    157--157 |     event.preventDefault();
    158--158 |     event.stopPropagation();
    161--164 |   const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
    162--162 |     const value = event.target.value;
    163--163 |     console.log('Input value changed:', value);
    166--169 |   const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
    167--167 |     event.preventDefault();
    168--168 |     console.log('Form submitted');
    175--175 |         onChange={handleChange}
    179--179 |         onClick={handleClick}
    189--221 | const HooksStateComponent: React.FC = () => {
    190--190 |   const [count, setCount] = React.useState<number>(0);
    191--191 |   const [user, setUser] = React.useState<{
    191--199 |   const [user, setUser] = React.useState<{
    201--203 |   const incrementCount = () => {
    202--202 |     setCount(prevCount => prevCount + 1);
    205--211 |   const updateUser = () => {
    208--208 |       age: user.age + 1,
    209--209 |       isActive: !user.isActive
    224--266 | const HooksUsageComponent: React.FC<{ id: string }> = ({ id }) => {
    225--225 |   const [data, setData] = React.useState<string[]>([]);
    226--226 |   const counter = React.useRef<number>(0);
    227--227 |   const prevId = React.useRef<string>();
    229--229 |   React.useEffect(() => {
    229--236 |   React.useEffect(() => {
    230--230 |     console.log('Component mounted');
    233--235 |     return () => {
    234--234 |       console.log('Component unmounted');
    238--238 |   React.useEffect(() => {
    238--240 |   React.useEffect(() => {
    239--239 |     prevId.current = id;
    242--242 |   const fetchData = React.useCallback((userId: string) => {
    242--249 |   const fetchData = React.useCallback((userId: string) => {
    243--243 |     counter.current += 1;
    245--247 |     setTimeout(() => {
    251--251 |   const memoizedValue = React.useMemo(() => {
    251--256 |   const memoizedValue = React.useMemo(() => {
    253--253 |       processedData: data.map(item => item.toUpperCase()),
    254--254 |       counter: counter.current
    269--274 | interface GenericComponentProps<T> {
    276--294 | function GenericListComponent<T>({
    284--284 |       {items.map(item => (
    284--291 |       {items.map(item => (
    287--287 |           onClick={() => onItemSelect && onItemSelect(item)}
    297--302 | type UserType = {
    304--325 | const GenericComponentUsage: React.FC = () => {
    312--323 |     <GenericListComponent<UserType>
    311--324 |   return (
    313--313 |       items={users}
    314--314 |       keyExtractor={user => user.id}
    315--321 |       renderItem={user => (
    317--317 |           <strong>{user.name}</strong>
    316--320 |         <div className="user-item">
    322--322 |       onItemSelect={user => console.log('Selected user:', user)}
    3--8 | interface StandardInterfaceProps {
    2--325 | // Type Definitions (interfaces and type aliases) - spans 4+ lines
    10--15 | type StandardTypeAlias = {
    18--27 | interface PropsDefinitionExample {
    30--38 | function StandardFunctionComponent(props: StandardInterfaceProps): JSX.Element {
    35--35 |       {required}: {numeric}
    34--36 |     <div className="standard-component">
    41--55 | export const ArrowFunctionComponent: React.FC<PropsDefinitionExample> = ({
    51--51 |       {requiredString...

inspectTypeScript.test.ts

    8--16 | interface TestInterfaceDefinition {
    2--207 | // Import statements test - inherently single-line, exempt from 4-line requirement
    12--15 |     methodSignature(
    19--26 | type TestTypeDefinition = {
    29--34 | enum TestEnumDefinition {
    37--47 | namespace TestNamespaceDefinition {
    38--40 |     export interface InnerInterface {
    42--46 |     export function innerFunction(
    50--57 | interface TestGenericInterfaceDefinition<T, U> {
    54--56 |     process(
    60--68 | function testTypedFunctionDefinition(
    71--79 | async function testTypedAsyncFunctionDefinition(
    82--87 | function testGenericFunctionDefinition<T, U>(
    90--117 | class TestTypedClassDefinition implements TestInterfaceDefinition {
    93--93 |     static staticField: number = 42;
    95--100 |     constructor(
    103--108 |     methodSignature(
    111--116 |     genericMethod<T>(
    120--135 | abstract class TestAbstractClassDefinition {
    121--124 |     constructor(
    126--128 |     abstract process(
    131--134 |     format(): string {
    142--146 |     callback: (
    150--154 | interface TestJsxPropsDefinition {
    176--180 | function testTypedDecoratorDefinition(
    176--181 | function testTypedDecoratorDefinition(
    182--182 |     descriptor.value = function(...args: any[]) {
    182--183 |     descriptor.value = function(...args: any[]) {
    183--183 |         return original.apply(this, args);
    166--202 |                     <div onClick={() => props.onSelect(item)}>
    191--194 |     constructor(
    197--200 |     testDecoratedMethodDefinition(
    197--201 |     testDecoratedMethodDefinition(
    201--201 |         return param1.repeat(param2);

inspectVue.test.ts

    2--93 | <template>
    2--11 | <template>
    2--92 | <template>
    13--83 | <script>
    85--92 | <style>
    2--93 | <template>
    2--11 | <template>
    2--92 | <template>
    13--83 | <script>
    85--92 | <style>

inspectZig.test.ts

    2--2 | const std = @import("std");
    2--42 | const std = @import("std");
    5--16 | pub const Point = struct {
    9--11 |     pub fn init(x: f32, y: f32) Point {
    13--15 |     pub fn distance(self: Point) f32 {
    19--24 | pub fn main() !void {
    20--20 |     const point = Point.init(3.0, 4.0);
    21--21 |     const dist = point.distance();
    27--32 | const Direction = enum {
    35--35 | var global_point: Point = undefined;
    36--36 | pub const VERSION: u32 = 1;
    39--42 | pub const Vector = struct {

Get in Touch

Discord: KJ7LNW


Important

Standardizes tree-sitter test implementations across multiple languages, enhancing test coverage and consistency.

  • Behavior:
    • Standardizes tree-sitter test implementations across languages including Elixir, OCaml, Scala, Solidity, and more.
    • Adds comprehensive test coverage for new languages.
    • Implements consistent line number pattern matching.
    • Maintains 1:1 mapping between queries, tests, and samples.
  • Test Infrastructure:
    • Moves test samples to fixtures directory.
    • Adds new test files for each language in __tests__ directory.
    • Updates helpers.ts to mock file system and language parser.
  • Query Patterns:
    • Enhances query patterns in queries directory for better structure capture.
    • Updates C#, C, Kotlin, PHP, Ruby, and Swift query files.
  • Misc:
    • Changes esbuild.js to dynamically read WASM files instead of using a hardcoded list.

This description was created by Ellipsis for c21e4199827a711ad2d0ddddf3531f503ba07dea. You can customize this summary. It will automatically update as commits are pushed.

@KJ7LNW KJ7LNW requested review from cte and mrubens as code owners April 26, 2025 03:43
@dosubot dosubot bot added size:XXL This PR changes 1000+ lines, ignoring generated files. enhancement New feature or request labels Apr 26, 2025
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 26, 2025

This pull request includes a significant number of changes across multiple files, totaling 4014 lines added and 688 lines removed. While the changes seem to be related to standardizing tree-sitter test implementations, it might be beneficial to consider splitting the work into smaller, more manageable pull requests. This could improve the review process and ensure each set of changes is thoroughly examined. If there are distinct groups of changes that aren't directly related to one another, please consider separating them into different pull requests. Thank you!

@KJ7LNW KJ7LNW marked this pull request as draft April 26, 2025 03:47
@changeset-bot
Copy link

changeset-bot bot commented Apr 26, 2025

⚠️ No Changeset found

Latest commit: 23d9056

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@KJ7LNW KJ7LNW marked this pull request as ready for review April 26, 2025 03:52
@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 26, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 26, 2025

This pull request is quite large, with changes across multiple languages and test files. It might be beneficial to split it into smaller, more manageable pull requests. Consider splitting the changes by language or test type, such as grouping all C# test changes together, all JavaScript test changes together, etc. This will make it easier to review and ensure each set of changes is thoroughly tested.

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Apr 26, 2025
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 27, 2025

rebased on 3.14.3

@KJ7LNW KJ7LNW marked this pull request as draft April 27, 2025 03:50
Eric Wheeler added 13 commits April 26, 2025 20:52
This commit standardizes the C# Tree-Sitter parser tests to ensure:
- Variable/function names in sample code match the tests
- Each test only verifies specific identifiers relevant to that test
- Test names clearly indicate what they're testing
- No skipped tests remain
- Only one test exists per structure or combination of structures
- All debug output uses debugLog from helpers.ts

The standardization improves maintainability and clarity while preserving
all existing functionality.

Signed-off-by: Eric Wheeler <[email protected]>
This commit standardizes the C Tree-Sitter parser tests to ensure:
- Variable/function names in sample code match the tests (using snake_case)
- Each test only verifies specific identifiers relevant to that test
- Test names clearly indicate what they're testing
- No skipped tests remain - tests for unsupported features are removed
- Only one test exists per structure or combination of structures
- All debug output uses debugLog from helpers.ts

The standardization improves maintainability and clarity while preserving
all existing functionality. Documentation has been added for C language
constructs that are not currently supported by the parser.

Signed-off-by: Eric Wheeler <[email protected]>
Standardized Kotlin Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Removed skipped tests and unused query patterns
- Ensured only one test per structure or combination of structures

Signed-off-by: Eric Wheeler <[email protected]>
Standardized PHP Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Consolidated related tests to ensure only one test per structure
- Ensured all debug output uses debugLog from helpers.ts

Signed-off-by: Eric Wheeler <[email protected]>
Standardized Ruby Tree-Sitter parser to ensure consistent naming and structure:
- Expanded query to support many more Ruby language constructs
- Added comprehensive test file with clear section headers
- Ensured all code sections are at least 4 lines long
- Added tests for each language construct
- Used consistent naming conventions for test identifiers

Signed-off-by: Eric Wheeler <[email protected]>
Standardized Swift Tree-Sitter parser to ensure consistent naming and structure:
- Renamed identifiers to clearly indicate what they're testing
- Ensured all code sections are at least 4 lines long
- Organized query patterns logically with clear comments
- Removed skipped tests and unused query patterns
- Ensured only one test per structure or combination of structures

Signed-off-by: Eric Wheeler <[email protected]>
- Modified esbuild.js to dynamically read and copy all WASM files from tree-sitter-wasms package
- Added error handling and logging for better debugging
- Ensures all language parsers are automatically included without requiring manual updates
Move test mocks to helpers.ts to be shared between test files
Create fixtures directory for shared test data
Move sample TSX content to fixtures/sample-tsx.ts
Update test files to use shared mocks and fixtures

Signed-off-by: Eric Wheeler <[email protected]>
- Remove detailed node inspection to reduce noise
- Keep only essential tree structure output
- Remove duplicate content logging

Signed-off-by: Eric Wheeler <[email protected]>
Move C# sample code to dedicated fixture file and create inspectCSharp test
following the same pattern as other language tests. This improves test
organization and maintainability by:

- Extracting sample C# code to fixtures/sample-c-sharp.ts
- Adding inspectCSharp.test.ts for tree structure inspection
- Updating parseSourceCodeDefinitions.c-sharp.test.ts to use fixture

Signed-off-by: Eric Wheeler <[email protected]>
- Add language parameter to processCaptures for language-specific handling
- Implement selective HTML filtering for jsx/tsx files
- Update all call sites to pass correct language parameter
- Fix type safety by properly passing language strings

Signed-off-by: Eric Wheeler <[email protected]>
Move sample code from parseSourceCodeDefinitions test files into dedicated
fixtures directory for better organization and reuse:

- Created fixtures directory for language samples
- Moved sample code for C#, C, JSON, Kotlin, PHP, Ruby, Rust, and Swift
- Created inspect test files for each language
- Updated original test files to import from fixtures
- Standardized test options across languages
- No behavior changes, all tests passing

Signed-off-by: Eric Wheeler <[email protected]>
Standardize test code structure and naming across all language parsers:
- Rename identifiers to clearly indicate test purpose
- Ensure each code section has descriptive comments
- Group related code sections together
- Maintain language-specific naming conventions
- Keep test structure consistent across languages
- Remove tests for unsupported features

Changes made to:
- C, JSON, Kotlin, PHP, Ruby, Rust, and Swift test files
- Sample code fixtures
- Parser definition tests
- Inspect structure tests

No functional changes - all tests passing with improved maintainability.

Signed-off-by: Eric Wheeler <[email protected]>
Eric Wheeler added 9 commits April 26, 2025 20:55
- Ensure all test structures span at least 4 lines for better parsing
- Create exactly one consolidated test per data structure type
- Use descriptive names that clearly indicate test purpose
- Improve query pattern organization and documentation
- Simplify inspect test files to focus on structure validation
- Implement result caching in test files for better performance
- Remove duplicate and skipped tests
- Follow consistent naming conventions across all languages

Signed-off-by: Eric Wheeler <[email protected]>
- Move minComponentLines parameter to a file-level constant
- Remove parameter passing to processCaptures function
- Update all references to use the global constant
- Remove redundant local constant declaration in parseFile

Signed-off-by: Eric Wheeler <[email protected]>
- Changed MIN_COMPONENT_LINES constant to use getter/setter functions
- Updated references to use getMinComponentLines() function
- Modified test helper to set value to 0 during tests
- This establishes a single source of truth while making testing easier

Signed-off-by: Eric Wheeler <[email protected]>
Standardized tree-sitter test implementations across all supported languages:
- Removed debugLog calls from test files
- Implemented consistent line number pattern matching
- Ensured proper test structure and execution order
- Added comprehensive test coverage for supported structures
- Maintained 1:1 mapping between queries, tests and samples
- Documented unsupported features in TODO sections

Signed-off-by: Eric Wheeler <[email protected]>
Added TODO sections in test files documenting structures that can be parsed
by tree-sitter but currently lack query pattern support:

- Python: f-strings, complex type annotations, pattern matching
- C++: virtual methods, field initializers, base class clauses
- Java: import declarations, field declarations with modifiers
- TSX: React hooks, context providers, event handlers

Added examples and clarifying comments to existing TODO sections.
Enhanced Java query patterns for better structure capture including
lambda expressions, field declarations, and type parameters.

Signed-off-by: Eric Wheeler <[email protected]>
The copyWasmFiles plugin was using an undefined targetDir variable when copying
tree-sitter WASM files. Changed to use the correctly defined distDir variable,
fixing the build process.

Signed-off-by: Eric Wheeler <[email protected]>
Removed unused imports and variables from tree-sitter test files to fix linting errors:
- Removed unused goQuery import from helpers.ts
- Removed unused imports and mockedFs variables from language-specific test files
- Cleaned up test files to only import what they use

Signed-off-by: Eric Wheeler <[email protected]>
@KJ7LNW KJ7LNW marked this pull request as ready for review April 27, 2025 04:17
@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 27, 2025

linted and ready to merge

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 27, 2025

⚠️ This PR is too big for Ellipsis, but support for larger PRs is coming soon. If you want us to prioritize this feature, let us know at [email protected]


Generated with ❤️ by ellipsis.dev

@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 27, 2025

and rebased on 3.14.3

@ellipsis-dev
Copy link
Contributor

ellipsis-dev bot commented Apr 27, 2025

This pull request is quite large, with changes spanning multiple languages and test files. It might be beneficial to split it into smaller, more manageable pull requests. Here are some suggestions on how to split the changes:

  1. Language-specific test files: Consider creating separate pull requests for each language's test files. For example, one pull request for C/C++ test files, another for JavaScript/TypeScript, and so on.

  2. Tree-sitter query updates: The updates to tree-sitter queries for different languages could be grouped into a separate pull request.

  3. Helpers and utilities: Changes to helper functions and utilities, such as those in helpers.ts, could be isolated into their own pull request.

  4. Dynamic file handling: The refactor in esbuild.js for dynamically handling WASM files could be a standalone pull request.

By splitting the pull request, it will be easier to review and integrate the changes, ensuring that each set of modifications is thoroughly examined.

@mrubens mrubens merged commit 8e85a12 into RooCodeInc:main Apr 28, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Apr 28, 2025
@cte
Copy link
Collaborator

cte commented Apr 29, 2025

The listCodeDefinitionNames tool is broken for me (and some other folks have reported it to me as well). I'm going to see if reverting this fixes it.

@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 29, 2025

The listCodeDefinitionNames tool is broken for me (and some other folks have reported it to me as well). I'm going to see if reverting this fixes it.

let me see if I can reproduce it maybe it is a simple fix

@KJ7LNW
Copy link
Contributor Author

KJ7LNW commented Apr 29, 2025

I just told it:

we need to validate list code definitions: run this code definitions on different files and directories to see what happens

and I cannot reproduce the problem: can you provide additional information so I can figure it out?

SmartManoj pushed a commit to SmartManoj/Raa-Code that referenced this pull request May 6, 2025
* Detect Ctrl C input when users terminal a long running terminal command

* Remove terminal-output-truncation.md documentation file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request lgtm This PR has been approved by a maintainer size:XXL This PR changes 1000+ lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants