Skip to content

Comments

Add LS API support for function, type discovery for workspaces#695

Merged
NipunaRanasinghe merged 27 commits intoballerina-platform:mainfrom
dulajdilshan:ls-api-workspace
Feb 18, 2026
Merged

Add LS API support for function, type discovery for workspaces#695
NipunaRanasinghe merged 27 commits intoballerina-platform:mainfrom
dulajdilshan:ls-api-workspace

Conversation

@dulajdilshan
Copy link
Contributor

@dulajdilshan dulajdilshan commented Feb 12, 2026

Purpose

$title

Fixes wso2/product-ballerina-integrator#2364
Fixes wso2/product-ballerina-integrator#2368
Fixes wso2/product-ballerina-integrator#2382

LS API Support for Function and Type Discovery for Workspaces

Overview

This pull request adds Language Server API support for workspace-wide discovery of functions and types, enabling users to discover and reuse components defined across multiple projects within a workspace while maintaining proper visibility controls through public/private access modifiers.

Core Capabilities

1. Workspace-Level Component Discovery

  • Introduced CURRENT_WORKSPACE category to organize components available across the entire workspace alongside the existing CURRENT_INTEGRATION category
  • Enhanced FunctionSearchCommand with workspace-aware node building that gathers and categorizes functions from all workspace projects
  • Enhanced TypeSearchCommand with integrated workspace scanning and support for class symbols alongside type definitions
  • Implemented hierarchical result organization that distinguishes between current project, workspace-wide, imported, and standard library components

2. Public Visibility Qualifier Support

  • Implemented public visibility toggle for functions, types, enums, and data mappers through metadata flags
  • Updated FunctionDefinitionBuilder and DataMapperDefinitionBuilder to conditionally emit public keywords in generated code
  • Modified SourceCodeGenerator to support public visibility for enums and type definitions
  • Improved metadata clarity by updating isPublic descriptions to "Make visible across the workspace"
  • Standardized boolean value representation throughout configuration resources

3. Workspace Project Metadata and Detection

  • Added library project detection mechanism in ProjectInfoBuilder that identifies projects configured as library modules
  • Extended ProjectInfoResponse with isLibrary field to expose project type information to API consumers
  • Enhanced workspace project traversal to properly categorize and differentiate project types

4. Enhanced Code Generation for Public Components

  • Updated ModuleNodeAnalyzer to recognize and process public qualifiers from source syntax
  • Extended form builders to include isPublic property configuration in the model
  • Updated code generation across multiple node types to support conditional visibility modifiers

Testing and Validation

  • Added 5,318 test resource files covering various scenarios and configurations
  • Created multi-package workspace test projects demonstrating real-world project structures
  • Implemented test fixtures showing function and type discovery across workspace boundaries
  • Updated search result configurations to reflect workspace-wide component availability

Implementation Details

  • Refactored symbol processing to handle both function and class symbols uniformly
  • Introduced ScoredType record for consistent type ranking and metadata handling in type searches
  • Added helper methods for workspace node building, filtering, and visibility enforcement
  • Maintained backward compatibility with existing project-scoped search behavior

Outcomes

This enhancement enables better component organization and reuse across multi-project Ballerina workspaces, allowing developers to leverage library and shared components more effectively while maintaining clear visibility boundaries through public visibility modifiers.

@coderabbitai
Copy link

coderabbitai bot commented Feb 12, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request introduces workspace-aware function and type search, public visibility modifiers for components, and library project support. It refactors search commands to handle workspace-level components alongside current integration, updates code generators to emit public qualifiers, and expands test configurations and resources to validate the new functionality.

Changes

Cohort / File(s) Summary
Core Model & Enums
Category.java
Updated CURRENT_INTEGRATION description and added new CURRENT_WORKSPACE enum constant with associated metadata and keywords.
Form & Property Handling
FormBuilder.java, Property.java
Fixed boolean value handling in isPublic property; updated documentation string from "Is this public" to "Make visible across the workspace".
Builder Classes
FunctionDefinitionBuilder.java, DataMapperDefinitionBuilder.java, ModuleNodeAnalyzer.java
Added public visibility handling: chain public property configuration in setMandatoryProperties and emit PUBLIC_KEYWORD in source generation when IS_PUBLIC_KEY is true.
Search Command Refactoring
FunctionSearchCommand.java, TypeSearchCommand.java
Introduced workspace-aware search with new methods (buildWorkspaceNodes, buildProjectNodes, getTypes/getFunctions); added helper predicates for filtering; introduced CURRENT_INTEGRATION_INDICATOR constant and new scoring/metadata handling for workspace projects.
Code Generation
SourceCodeGenerator.java
Added isPublicFlagOn helper method to detect public flags in properties; updated enum and type definition templates to conditionally emit public qualifier.
Response Models
ProjectInfoResponse.java, ProjectInfoBuilder.java
Added isLibrary field and getter/setter to response; added library project detection logic via import scanning (lib.bal for wso2/bi.validator).
Test Resources—JSON Type Configs
json_to_type/config/*.json (~30 files)
Updated generated type declarations to include public modifier; changed boolean values from strings to boolean literals; updated isPublic descriptions.
Test Resources—Search Configs
search/config/functions/*.json, search/config/types/*.json
Updated category metadata (swapped "Current Integration" ↔ "Agent Tools" labels/descriptions); added new "Current Workspace" categories with extended keywords; updated isPublic handling in search results.
Test Resources—Type Manager Configs
types_manager/*/config/*.json (~50 files)
Normalized isPublic values from string to boolean; updated descriptions to "Make visible across the workspace"; added public type declarations in JSON test data.
Test Resources—Node Templates & Function Definitions
node_template/config/*.json, function_definition/config/*.json (~30 files)
Added isPublic property (FLAG type, default false) to function and data mapper node configurations with label "public" and updated description.
Test Resources—Workspace & Source Files
search/source/workspace1/, types/source/graphql/, types_manager/*/source/*.bal
Added new workspace structure with package1 and package2, Ballerina.toml manifests, and public/private function and type definitions; minor documentation typo corrections.
Test Resources—Agent & To-Source Configs
agents_manager/config/*.json, to_source/config/*.json
Added isPublic property to agent tool and data mapper definitions; added public function definitions with proper source generation test cases.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant FunctionSearchCommand
    participant WorkspaceProject
    participant CurrentProject
    participant LibraryBuilder

    Client->>FunctionSearchCommand: search(query)
    activate FunctionSearchCommand
    
    FunctionSearchCommand->>FunctionSearchCommand: buildWorkspaceNodes()
    
    FunctionSearchCommand->>WorkspaceProject: buildProjectNodes(workspace_proj, Category.Builder, Category.Builder)
    activate WorkspaceProject
    WorkspaceProject->>WorkspaceProject: getFunctions(Project)
    WorkspaceProject->>LibraryBuilder: createAvailableNode(FunctionSymbol, visibility, ...)
    LibraryBuilder-->>WorkspaceProject: AvailableNode
    WorkspaceProject-->>FunctionSearchCommand: nodes for CURRENT_WORKSPACE
    deactivate WorkspaceProject
    
    FunctionSearchCommand->>CurrentProject: buildProjectNodes(current_proj, Category.Builder, Category.Builder)
    activate CurrentProject
    CurrentProject->>CurrentProject: getFunctions(Project)
    CurrentProject->>LibraryBuilder: createAvailableNode(FunctionSymbol, true, ...)
    LibraryBuilder-->>CurrentProject: AvailableNode
    CurrentProject-->>FunctionSearchCommand: nodes for CURRENT_INTEGRATION
    deactivate CurrentProject
    
    FunctionSearchCommand->>FunctionSearchCommand: buildLibraryNodes()
    FunctionSearchCommand-->>Client: SearchResponse with CURRENT_WORKSPACE, CURRENT_INTEGRATION, imported functions
    deactivate FunctionSearchCommand
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • KavinduZoysa
  • LakshanWeerasinghe

Poem

🐰 Whiskers twitch with joy today!
Public visibility's here to stay,
Workspaces now dance and sing,
Components wear their public wing,
Search knows every nook and bay!

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete, providing only the purpose section with issue links but missing all other required sections (Goals, Approach, User stories, Release notes, Documentation, etc.). Complete the PR description by filling in all required template sections: Goals, Approach, User stories, Release note, Documentation, Training, Certification, Marketing, Automation tests, Security checks, Samples, Related PRs, Migrations, Test environment, and Learning.
Docstring Coverage ⚠️ Warning Docstring coverage is 12.82% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and accurately describes the main change: adding Language Server API support for function and type discovery across workspaces.
Linked Issues check ✅ Passed The PR successfully implements all three linked issue requirements: workspace-wide function search [#2364], public qualifier support for components [#2368], and workspace-level type discovery [#2382].
Out of Scope Changes check ✅ Passed All changes are scoped to the linked objectives: adding workspace support for function/type search, implementing public visibility modifiers, and enhancing LS APIs. No unrelated changes detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Comment @coderabbitai help to get the list of available commands and usage tips.

@dulajdilshan dulajdilshan marked this pull request as draft February 12, 2026 14:00
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 18

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (6)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_table_type_def.json (1)

92-92: ⚠️ Potential issue | 🟡 Minor

Inconsistent type for isArray FLAG values.

The isPublic properties were correctly updated to use boolean false, but the isArray properties at lines 92, 148, and 288 still use string "false". For consistency across FLAG-type fields, these should also be booleans.

🔧 Proposed fix

At line 92:

-        "value": "false",
+        "value": false,

At line 148:

-              "value": "false",
+              "value": false,

At line 288:

-          "value": "false",
+          "value": false,

Also applies to: 148-148, 288-288

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_graphql_type/config/get_service_class_with_graphql_id_2.json (1)

100-116: ⚠️ Potential issue | 🟡 Minor

Inconsistent value types across FLAG properties need alignment.

The isPublic properties use boolean false (lines 100–116, 251–267), but other FLAG-type properties in this file still use string "false":

  • isArray (line 77)
  • isDistinct (line 128)
  • isIsolated (lines 145, 279)
  • isReadOnly (line 162)
  • isPrivate (line 245)

Update all FLAG properties to use boolean values for consistency, or document why isPublic is handled differently.

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_with_custom_and_xml_annot.json (1)

47-63: ⚠️ Potential issue | 🟡 Minor

Inconsistent value types for FLAG fields.

The isPublic field now correctly uses a boolean value (false), but isArray (line 92) still uses a string value ("false"). Both fields have fieldType: "FLAG" and should use consistent value types.

Consider updating isArray.value to use a boolean as well for consistency.

Also applies to: 81-97

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type2.json (1)

47-63: ⚠️ Potential issue | 🟡 Minor

Inconsistent value types for FLAG fields.

The isPublic.value is now a boolean (false), but isArray.value (line 92) remains a string ("false"). For consistency, all FLAG type fields should use the same value type.

Also applies to: 81-97

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_of_readonly_and_record_type_with_all_readonly_fields2.json (1)

47-63: ⚠️ Potential issue | 🟡 Minor

Inconsistent value types for FLAG fields.

The isPublic.value is now a boolean (false), but other FLAG fields in this file still use string values:

  • isReadOnly.value: "true" (line 92)
  • isArray.value: "false" (line 109)

For consistency, all FLAG type fields should use the same value type (boolean).

Also applies to: 81-97, 98-114

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type4.json (1)

47-63: ⚠️ Potential issue | 🟡 Minor

Inconsistent value types for FLAG fields across all record types.

The isPublic.value fields are correctly updated to boolean false for all three record types (User, UserAddress, City), but the corresponding isArray.value fields remain as string "false":

  • User: lines 58 vs 92
  • UserAddress: lines 415 vs 449
  • City: lines 645 vs 679

For consistency, consider updating all FLAG type fields to use boolean values.

Also applies to: 81-97, 404-420, 438-454, 634-650, 668-684

🤖 Fix all issues with AI agents
In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java`:
- Around line 331-346: The code casts symbol to Documentable unsafely; replace
the unchecked cast with an instanceof pattern match (as used in
buildProjectNodes) to safely bind a Documentable variable when symbol implements
Documentable, e.g., check "if (symbol instanceof Documentable documentable) {
... }" and then obtain documentation via documentable.documentation() to set
description, before computing score and adding to scoredTypes; ensure you still
guard on TypeDefinitionSymbol/ClassSymbol and skip unnamed symbols.
- Around line 175-182: The file imports EnumSymbol but getTypes() only filters
for TypeDefinitionSymbol and ClassSymbol; either remove the unused EnumSymbol
import or include enum discovery by adding `symbol instanceof EnumSymbol` to the
filter in the getTypes() method (the block using
PackageUtil.getCompilation(...).getSemanticModel(...).moduleSymbols().stream()).
Update the import/remove accordingly so the import list matches the actual
filter usage.

In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/utils/SourceCodeGenerator.java`:
- Around line 139-148: generateEnumCodeSnippet currently omits the public
qualifier while generateTypeDefCodeSnippet uses isPublicFlagOn; update
generateEnumCodeSnippet to compute a publicQualifier (e.g., String
publicQualifier = isPublicFlagOn(enumData.properties()) ? "public " : "") and
inject it into the enum string template before the enum name so the emitted code
includes the `public` visibility when applicable; reference the
generateEnumCodeSnippet method, isPublicFlagOn, and
enumData.name()/enumData.properties() when making the change.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/config.json`:
- Around line 10-21: Update the TYPE search config's metadata to use "Types"
terminology: in the object with "label": "Current Integration" update
metadata.description (currently "Functions defined within the current
integration") to reference "Types" and change any metadata.keywords entries
("Function", "Functions") to "Type" or "Types" as appropriate so the description
and keywords consistently reflect this is a TYPE search config.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/default.json`:
- Around line 10-19: The metadata for the TYPE search config incorrectly uses
"Function"/"Functions"; update the "metadata" block for the "Current
Integration" category so the "description" refers to "Types defined within the
current integration" and update the "keywords" array to use "Type" (and any
other plural/singular occurrences of Function/Functions) to reflect this is a
TYPE search; edit the fields named "label", "description", and "keywords" in the
metadata object to make the terminology consistent.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/health.json`:
- Around line 9-20: Update the metadata for the "Current Integration" entry used
in the TYPE search (where "kind": "TYPE") to use "Types" terminology: change the
"description" value from "Functions defined within the current integration" to
something like "Types defined within the current integration" and replace any
"Function"/"Functions" occurrences in the "keywords" array (e.g., "Function")
with "Type"/"Types" so the "metadata" (label, description, keywords)
consistently reflects a TYPE search.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/imported_local_module.json`:
- Around line 10-21: Update the user-facing TYPE config metadata so it
consistently refers to "Types" instead of "Functions": change
metadata.description from "Functions defined within the current integration" to
something like "Types defined within the current integration" and update
metadata.keywords (e.g., replace "Function" with "Type" and any plural forms) so
the label/description/keywords in the JSON (metadata.label,
metadata.description, metadata.keywords) match the TYPE search context.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/imported_time.json`:
- Around line 10-21: Update the metadata in the TYPE search config so it refers
to "Types" not "Functions": change metadata.description from "Functions defined
within the current integration" to "Types defined within the current
integration" and replace "Function" in metadata.keywords with "Type" (the JSON
block containing metadata.label/metadata.description/metadata.keywords is in the
same object whose "kind" is "TYPE"). Ensure the label can remain "Current
Integration" or adjust if needed for consistency.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/submodule_description_match.json`:
- Around line 10-21: The metadata for this TYPE search is incorrectly
referencing functions: update the JSON under metadata for this entry so
metadata.description reads something like "Types defined within the current
integration" and replace/adjust metadata.keywords to use "Type" (and similar
type-related terms) instead of "Function"; ensure this entry's
metadata.description and metadata.keywords align with the search kind "TYPE".

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/submodule_exact_match.json`:
- Around line 10-21: The metadata.description for the TYPE search config
currently reads "Functions defined within the current integration" and should
refer to Types; update metadata.description to something like "Types defined
within the current integration" and adjust metadata.keywords (replace or add
"Type" instead of "Function") so the label "Current Integration" and the empty
items array remain correct and the UI doesn't confuse types with functions.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/submodule_no_match.json`:
- Around line 10-21: The metadata.description incorrectly refers to "Functions"
while the search kind is "TYPE"; update the metadata.description in this JSON
(look for the object with "label": "Current Integration" and "kind": "TYPE") to
read something like "Types defined within the current integration" so the
description matches the TYPE search category.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/submodule_prefix_match.json`:
- Around line 10-21: The metadata block for the "Current Integration" item uses
"Functions" wording but this file is a TYPE search (see "kind": "TYPE"); update
the metadata.description and metadata.keywords to refer to "Types" (e.g., change
"Functions defined within the current integration" to "Types defined within the
current integration" and replace "Function" keyword with "Type") so the label
"Current Integration", description, and keywords consistently reflect TYPE
searches.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/submodule_substring_match.json`:
- Around line 10-21: Update the metadata.description for this TYPE search
configuration so it references "Types" rather than "Functions": locate the JSON
object with "metadata" (keys "label": "Current Integration" and "description")
and change the description value to something like "Types defined within the
current integration" so it accurately reflects that this is a TYPE search.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/create_and_update/config/create_public_record_with_readonly_fields.json`:
- Around line 51-58: The JSON for properties.isArray currently sets "valueType":
"FLAG" but uses a string for "value" ("false"), which can break the loader;
change the "value" for the isArray entry from the string "false" to the boolean
false so the FLAG is represented as a boolean literal (update the
properties.isArray.value field accordingly while keeping
properties.isArray.valueType as "FLAG").

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/create_and_update/config/update_public_record_type.json`:
- Around line 150-165: The union member entries under the nested union for iA
currently have mismatched "name" values ("string" and "int") which should match
their "type" values; update the two objects where "type": "City" and "type":
"UserAddress" so their "name" fields are "City" and "UserAddress" respectively
(i.e., make the "name" property equal to the "type" property for those entries)
to ensure the union renders/validates as City|UserAddress.
- Around line 281-318: The docs for the field that currently read "Union of of
type-refs and a built-in type" must be corrected to "Union of type-refs and a
built-in type" in both the input docs entry and the expected output newText (the
generated comment inside the string for the User record type); locate the FIELD
with name "address" (or the docs string) and the "newText" value under
"test_pack2/types.bal" and remove the duplicated "of" so the user-facing
documentation and the expected patch output match the corrected phrase.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_graphql_type/config/get_service_class3.json`:
- Line 161: The flag fields in this JSON sample are inconsistent: `isPublic`
uses boolean values while other FLAG-type properties (`isPrivate`, `isIsolated`,
`isReadOnly`, `isArray`, `isDistinct`) remain as string values; update those
fields to use boolean true/false consistently (e.g., change `"value": "false"`
to `"value": false`) for `isPrivate`, `isIsolated`, `isReadOnly`, `isArray`, and
`isDistinct` so all FLAG-type properties match the `isPublic` boolean
normalization.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_with_escaped_field_name.json`:
- Line 58: The FLAG fields are using inconsistent types: change the
isArray.value property (currently the string "false") to a boolean false to
match isPublic.value and the fieldType "FLAG"; locate the isArray entry in the
same JSON (field name "isArray", "fieldType": "FLAG") and update its "value"
from the string "false" to the boolean false.
🧹 Nitpick comments (13)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_with_json_annot_in_fields.json (1)

47-97: Inconsistent boolean normalization between FLAG-type properties.

The isPublic.value on line 58 is correctly normalized to a boolean false, but isArray.value on line 92 still uses the string "false". Both properties have "fieldType": "FLAG", so they should use consistent value types.

If this normalization is intentional for FLAG properties, consider applying the same change to isArray:

♻️ Proposed fix for consistency
       "isArray": {
         "metadata": {
           "label": "Is array type",
           "description": "Is this type an array or list value"
         },
         "types": [
           {
             "fieldType": "FLAG",
             "selected": true
           }
         ],
-        "value": "false",
+        "value": false,
         "optional": true,
         "editable": true,
         "advanced": true,
         "hidden": false
       },
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_object_type_of_readonly_and_object_type.json (1)

92-92: Consider updating other FLAG fields for consistency.

The isPublic fields are now correctly using boolean values, but other FLAG type fields in this file still use string representations:

  • Line 92: isReadOnly uses "value": "true"
  • Line 109: isIsolated uses "value": "false"
  • Line 167: isPrivate uses "value": "false"
  • Line 201: isIsolated uses "value": "false"

For consistency and to avoid potential type coercion issues, consider updating these fields to use actual booleans as well.

♻️ Proposed fix for consistency
       "isReadOnly": {
         ...
-        "value": "true",
+        "value": true,
         ...
       },
       "isIsolated": {
         ...
-        "value": "false",
+        "value": false,
         ...
       },
       ...
       "isPrivate": {
         ...
-        "value": "false",
+        "value": false,
         ...
       },
       ...
       "isIsolated": {
         ...
-        "value": "false",
+        "value": false,
         ...
       }

Also applies to: 109-109, 167-167, 201-201

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_with_readonly_fields.json (1)

58-92: Keep FLAG value types consistent.
Line 58 now uses a boolean, but Line 92 still has "false" as a string for another FLAG. If FLAG values are being normalized to booleans, consider aligning isArray.value to avoid mixed typing in the same config.

♻️ Suggested tweak
-        "value": "false",
+        "value": false,
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_of_readonly_and_record_type_with_all_readonly_fields1.json (1)

58-58: Consider normalizing other FLAG values to booleans for consistency.

isPublic now uses a boolean, while isReadOnly/isArray still use string literals. If FLAG consumers expect booleans, mixed typing can lead to inconsistent parsing. Consider normalizing the remaining FLAG values in this fixture.

♻️ Suggested normalization
-        "value": "true",
+        "value": true,
...
-        "value": "false",
+        "value": false,
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_array_type_def.json (1)

58-58: Consider aligning all FLAG-type properties to use boolean values.

The isPublic field is correctly changed to use a boolean false, but other FLAG-type properties like isArray (line 92) still use string values ("true"). For consistency, consider converting all FLAG fields to proper JSON booleans in this test fixture.

If this is intentional or out of scope for this PR, feel free to skip.

Also applies to: 92-92

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_with_reference_type_with_same_package_with_suffix.json (1)

47-63: Normalize remaining boolean flags in this fixture.

Now that isPublic.value is a JSON boolean, the isArray.value fields in this same file are still string literals. To avoid mixed types in the test fixture (and potential schema drift), consider converting those to booleans too (Line 92, Line 246, Line 337).

♻️ Suggested updates for remaining `isArray` flags
@@
-        "value": "false",
+        "value": false,
@@
-          "value": "false",
+          "value": false,
@@
-          "value": "false",
+          "value": false,
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_union_type1.json (1)

58-58: Correct boolean conversion for isPublic fields.

The conversion of isPublic.value from string literals to boolean literals is appropriate and aligns with the PR's goal of adding public visibility support.

However, note there's an inconsistency: other FLAG-type properties in this file (e.g., isArray at line 92, isReadOnly at line 530) still use string values like "false" and "true". Consider normalizing all FLAG fields to boolean for consistency in a follow-up.

,

Also applies to: 205-205, 327-327, 496-496, 766-766, 968-968

flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/model/FormBuilder.java (1)

1074-1091: Inconsistent handling of FLAG values across similar methods.

The isPublic method now passes the boolean value directly (line 1083), but other similar FLAG methods still use String.valueOf(value):

  • isPrivate (line 1102)
  • isIsolated (line 1121)
  • isReadOnly (line 1140)
  • isDistinct (line 1159)

For consistency, consider updating all FLAG-type methods to use the same value handling approach.

Example fix for consistency
 public FormBuilder<T> isPrivate(boolean value, boolean optional, boolean editable, boolean advanced) {
     propertyBuilder
             .metadata()
             .label(Property.IS_PRIVATE_LABEL)
             .description(Property.IS_PRIVATE_DOC)
             .stepOut()
             .editable(editable)
             .optional(optional)
             .advanced(advanced)
-            .value(String.valueOf(value))
+            .value(value)
             .type()
                 .fieldType(Property.ValueType.FLAG)
                 .selected(true)
                 .stepOut()
             .editable();
     addProperty(Property.IS_PRIVATE_KEY);
     return this;
 }

Apply similar changes to isIsolated, isReadOnly, and isDistinct methods.

flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/model/node/FunctionDefinitionBuilder.java (1)

79-86: Confirm library default visibility override.
This sets the isPublic default to false for all templates. The PR objective says library components should be public by default—please verify the library flow overrides this, or consider parameterizing the default.

flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_public_record_type.json (1)

1-335: Normalize FLAG values to booleans for consistency.
This fixture mixes boolean literals (e.g., isPublic) with string "true"/"false" for other FLAG fields (isArray, isReadOnly). Please verify the consumer accepts both, or normalize to booleans to avoid parsing mismatches.

flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/FunctionSearchCommand.java (1)

197-226: Avoid package-name collisions when skipping the current project.
The skip check compares only packageName. If a workspace can include different projects sharing the same package name, those could be skipped unintentionally—consider comparing project source root or a project id instead.

flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java (1)

373-377: Formatting issue: inconsistent indentation on ScoredType record.

The record definition has extra indentation that doesn't match the rest of the class.

♻️ Fix indentation
-        /**
-         * Helper record to store type definition and class symbols along with their relevance scores for ranking.
-         */
-        private record ScoredType(Symbol symbol, String typeName, String description, int score) {
+    /**
+     * Helper record to store type definition and class symbols along with their relevance scores for ranking.
+     */
+    private record ScoredType(Symbol symbol, String typeName, String description, int score) {
     }
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/types_manager/get_type/config/get_record_type_of_readonly_and_record_type.json (1)

58-58: Inconsistent value types for FLAG fields.

The isPublic.value is a boolean false, but isReadOnly.value (line 92) and isArray.value (line 109) are strings "true" and "false" respectively. All three properties have fieldType: "FLAG" and should use consistent value types.

@dulajdilshan dulajdilshan marked this pull request as ready for review February 17, 2026 04:08
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🧹 Nitpick comments (2)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal (1)

34-42: Minor: findMax doesn't handle empty arrays.

Accessing values[0] on an empty array will cause a runtime panic. While this is acceptable for a test fixture, consider adding a guard if this code might be referenced as an example.

💡 Optional fix
 public function findMax(int[] values) returns int {
+    if values.length() == 0 {
+        return 0; // or panic/return error
+    }
     int max = values[0];
     foreach var val in values {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal`
around lines 34 - 42, The function findMax reads values[0] without guarding
against an empty array; add an early check in findMax to handle empty inputs
(e.g., if values is empty, either throw a descriptive error or return a sensible
default) before accessing values[0], using the array-length/isEmpty check
appropriate for the codebase, and if you choose to return an error adjust the
function signature to return an error union accordingly.
flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java (1)

377-386: Unused symbol field in ScoredType record and formatting issue.

  1. Indentation: The Javadoc and record have inconsistent indentation (extra leading spaces).

  2. Unused field: The symbol field is stored but never accessed after creation — both buildProjectNodes() and buildImportedLocalModules() only use typeName(), description(), and score(). Consider removing it to reduce memory overhead.

♻️ Proposed refactor
-        /**
-         * Helper record to store type definition and class symbols along with their relevance scores for ranking.
-         *
-         * `@param` symbol the symbol representing the type
-         * `@param` typeName the name of the type
-         * `@param` description the description of the type
-         * `@param` score the relevance score for ranking
-         */
-        private record ScoredType(Symbol symbol, String typeName, String description, int score) {
+    /**
+     * Helper record to store type metadata along with relevance scores for ranking.
+     *
+     * `@param` typeName the name of the type
+     * `@param` description the description of the type
+     * `@param` score the relevance score for ranking
+     */
+    private record ScoredType(String typeName, String description, int score) {
     }

Then update callers:

-                scoredTypes.add(new ScoredType(typeSymbol, typeName, description, score));
+                scoredTypes.add(new ScoredType(typeName, description, score));
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java`
around lines 377 - 386, Remove the unused Symbol field from the ScoredType
record and fix the Javadoc/record indentation: change the record declaration to
only hold (String typeName, String description, int score) and update all
instantiations to pass only those three values; update callers in
buildProjectNodes() and buildImportedLocalModules() that create ScoredType
instances so they no longer supply or expect a Symbol, and adjust any usages to
call typeName(), description(), and score() as before; also normalize the
leading spaces on the Javadoc and record declaration so indentation matches
surrounding code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/FunctionSearchCommand.java`:
- Around line 186-196: The getFunctions(Project project) method currently only
queries the default module via currentPackage.getDefaultModule().moduleId(), so
functions in other modules are omitted; update it to iterate all modules in the
Package (e.g., currentPackage.modules() or similar API) and for each module call
PackageUtil.getCompilation(currentPackage).getSemanticModel(module.moduleId()).moduleSymbols(),
filter for SymbolKind.FUNCTION excluding AutomationBuilder.MAIN_FUNCTION_NAME,
cast to FunctionSymbol and aggregate into a single list to return; ensure you
still use PackageUtil.getCompilation(currentPackage) and preserve the existing
filtering and casting logic.

In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java`:
- Around line 363-369: The Codedata built in buildImportedLocalModules() is
missing the node kind set in buildProjectNodes(); update the Codedata builder in
TypeSearchCommand.buildImportedLocalModules() to call .node(NodeKind.TYPEDESC)
so imported module entries match buildProjectNodes() behavior; locate the
Codedata.Builder<>(null) call that sets org/module/packageName/symbol/version
and add .node(NodeKind.TYPEDESC) before .build() to ensure consistent NodeKind
for typedesc entries.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json`:
- Around line 664-726: The JSON contains duplicate imported-function entries for
the io package (fileReadJson, fileReadString, fileWriteJson, fileWriteString);
remove the repeated objects so each function symbol (codedata.symbol:
"fileReadJson", "fileReadString", "fileWriteJson", "fileWriteString") appears
only once in the array, leaving the original/first occurrence intact and
deleting the subsequent duplicate blocks.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json`:
- Around line 10-17: The metadata for the TYPE category is inconsistent:
although this fixture is for kind=TYPE, the "description" and "keywords" refer
to "Functions"; update the "description" value to something like "Types
available in the current workspace" and replace keyword entries ("Function",
"Functions", "Local" if needed) with appropriate type-focused terms (e.g.,
"Type", "Types", "Workspace") so the metadata aligns with kind=TYPE and the
label "Current Workspace".

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg2_default.json`:
- Around line 10-17: The metadata for the fixture marked kind=TYPE is
inconsistent: update the "metadata" fields in workspace_pkg2_default.json so the
"description" and any "keywords" no longer reference "Functions" but instead say
"Types" (e.g., change "Functions available in the current workspace" to "Types
available in the current workspace" and replace keyword "Function" with "Type"),
leaving "label" intact; ensure the keywords array reflects type-focused terms
and the description aligns with kind=TYPE.

---

Nitpick comments:
In
`@flow-model-generator/modules/flow-model-generator-core/src/main/java/io/ballerina/flowmodelgenerator/core/search/TypeSearchCommand.java`:
- Around line 377-386: Remove the unused Symbol field from the ScoredType record
and fix the Javadoc/record indentation: change the record declaration to only
hold (String typeName, String description, int score) and update all
instantiations to pass only those three values; update callers in
buildProjectNodes() and buildImportedLocalModules() that create ScoredType
instances so they no longer supply or expect a Symbol, and adjust any usages to
call typeName(), description(), and score() as before; also normalize the
leading spaces on the Javadoc and record declaration so indentation matches
surrounding code.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/source/workspace1/package1/main.bal`:
- Around line 34-42: The function findMax reads values[0] without guarding
against an empty array; add an early check in findMax to handle empty inputs
(e.g., if values is empty, either throw a descriptive error or return a sensible
default) before accessing values[0], using the array-length/isEmpty check
appropriate for the codebase, and if you choose to return an error adjust the
function signature to return an error union accordingly.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default.json (1)

513-576: ⚠️ Potential issue | 🟡 Minor

Remove duplicate imported-function entries.

The io module items array contains duplicates: fileReadJson (lines 369-384 and 513-528), fileReadString (lines 321-336 and 529-544), fileWriteJson (lines 449-464 and 545-560), and fileWriteString (lines 401-416 and 561-576). This can cause ambiguous test results.

🧹 Suggested fix (remove duplicates starting at line 513)
-            {
-              "metadata": {
-                "label": "fileReadJson",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileReadString",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileWriteJson",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileWriteString",
-                ...
-              },
-              ...
-            },

Remove the four duplicate entries (fileReadJson, fileReadString, fileWriteJson, fileWriteString) that appear after openWritableFile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default.json`
around lines 513 - 576, Remove the duplicated io module function entries for
"fileReadJson", "fileReadString", "fileWriteJson", and "fileWriteString" that
are repeated later in the array (the duplicate objects with metadata.label
matching those four names that appear after the original "openWritableFile"
entry); delete those four duplicate JSON objects and keep the first occurrences
earlier in the file so the io items array contains only one entry per symbol
(refer to the codedata.symbol fields "fileReadJson", "fileReadString",
"fileWriteJson", "fileWriteString" to locate the duplicates).
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default2.json (1)

513-576: ⚠️ Potential issue | 🟡 Minor

Remove duplicate imported-function entries.

The io module items array contains duplicates: fileReadJson, fileReadString, fileWriteJson, and fileWriteString appear twice (first around lines 369-416 and again at lines 513-576).

🧹 Suggested fix (remove duplicates)
-            {
-              "metadata": {
-                "label": "fileReadJson",
-                "description": "Reads file content as a JSON...",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileReadString",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileWriteJson",
-                ...
-              },
-              ...
-            },
-            {
-              "metadata": {
-                "label": "fileWriteString",
-                ...
-              },
-              ...
-            },

Remove the four duplicate entries that appear after openWritableFile.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default2.json`
around lines 513 - 576, Duplicate function entries for the io module
(fileReadJson, fileReadString, fileWriteJson, fileWriteString) were added twice;
remove the second set of duplicates that appear after openWritableFile so each
function symbol (fileReadJson, fileReadString, fileWriteJson, fileWriteString)
exists only once in the items array, ensuring you delete the repeated objects
(the ones with codedata.symbol matching those four names) and leave the original
entries intact.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default.json`:
- Around line 513-576: Remove the duplicated io module function entries for
"fileReadJson", "fileReadString", "fileWriteJson", and "fileWriteString" that
are repeated later in the array (the duplicate objects with metadata.label
matching those four names that appear after the original "openWritableFile"
entry); delete those four duplicate JSON objects and keep the first occurrences
earlier in the file so the io items array contains only one entry per symbol
(refer to the codedata.symbol fields "fileReadJson", "fileReadString",
"fileWriteJson", "fileWriteString" to locate the duplicates).

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/custom_default2.json`:
- Around line 513-576: Duplicate function entries for the io module
(fileReadJson, fileReadString, fileWriteJson, fileWriteString) were added twice;
remove the second set of duplicates that appear after openWritableFile so each
function symbol (fileReadJson, fileReadString, fileWriteJson, fileWriteString)
exists only once in the items array, ensuring you delete the repeated objects
(the ones with codedata.symbol matching those four names) and leave the original
entries intact.

---

Duplicate comments:
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/functions/workspace_pkg1_default.json`:
- Around line 665-728: The JSON contains duplicate function entries for the io
module (symbols fileReadJson, fileReadString, fileWriteJson, fileWriteString);
remove the redundant block that repeats these objects so each unique function
(identified by codedata.symbol and codedata.module/org/version) appears only
once in the file (keep the preferred/earlier occurrence and delete the duplicate
group around the second instance).

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/search/config/types/workspace_pkg1_default.json`:
- Around line 10-19: The metadata.keywords array for the fixture contains
"Function" which likely conflicts with this fixture's intent as a kind: "TYPE"
search; open the JSON around the metadata object and either remove or replace
"Function" in metadata.keywords with a type-appropriate keyword (e.g., "Type" or
"Data Type") or, if cross-search is intentional, add a comment or a clarifying
keyword (e.g., "CrossSearch") and update any tests that rely on this keyword;
ensure you modify the metadata object where "label":"Current Workspace" and
"keywords" are defined so the keywords align with kind: "TYPE".

@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

Note

Unit test generation is a public access feature. Expect some limitations and changes as we gather feedback and continue to improve it.


Generating unit tests... This may take up to 20 minutes.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request extends the Language Server API to support workspace-wide function and type discovery, enabling better cross-project visibility and reuse in multi-package workspaces. The changes introduce public visibility qualifiers, workspace-aware search capabilities, and update test fixtures to use proper boolean types.

Changes:

  • Added workspace-level function and type search with visibility filtering (only public symbols from other projects are exposed)
  • Introduced isPublic flag support throughout the codebase for functions, types, and enums with proper boolean type handling
  • Refactored search commands to distinguish between current integration, workspace, and library components with new categorization

Reviewed changes

Copilot reviewed 147 out of 147 changed files in this pull request and generated no comments.

Show a summary per file
File Description
SourceCodeGenerator.java Added public qualifier generation for enums and type definitions
FunctionSearchCommand.java Refactored to support workspace-wide function discovery with visibility filtering
TypeSearchCommand.java Extended to include workspace symbols (TypeDefinitionSymbol and ClassSymbol) with scoring/ranking
FormBuilder.java Changed isPublic value type from String to boolean
Category.java Updated CURRENT_INTEGRATION description and added CURRENT_WORKSPACE category
FunctionDefinitionBuilder.java Added isPublic property initialization and source generation
ProjectInfoBuilder.java Implemented library project detection via bi.validator import
ProjectInfoResponse.java Added isLibrary field to project metadata
Test resources (170+ files) Updated JSON fixtures to use boolean values instead of strings for flags, added workspace test sources and expected outputs

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai
Copy link

coderabbitai bot commented Feb 17, 2026

✅ Created PR with unit tests: #707

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 147 out of 147 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (1)
flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/to_source/config/function_definition21.json (1)

75-75: Minor: Unusual spacing in generated function signature.

The newText contains "public function initialize( ) " with a space inside the parentheses and a trailing space. If this is the expected formatting convention for the code generator, this is fine. Otherwise, consider whether "public function initialize() " or "public function initialize()" is more appropriate.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/to_source/config/function_definition21.json`
at line 75, The generated signature for function initialize currently uses
"newText" with an extra space inside the parentheses and a trailing space
("public function initialize( ) "), so update the code-generation logic that
builds the function signature (where "newText" is composed for function
initialize) to produce no space inside the parentheses and no trailing space
(e.g. "public function initialize()" or at minimum "public function initialize()
"); trim or adjust the string concatenation/format helper that emits parentheses
to remove the internal and trailing spaces and ensure this formatting is applied
consistently for other function signatures.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/to_source/config/data_mapper_definition15.json`:
- Line 158: The generated function signature string for mapPersonToEmployee
contains an extra space after the opening parenthesis in the "newText" value
("mapPersonToEmployee( Person person)"); update the generator or the test
fixture so the signature is emitted as "mapPersonToEmployee(Person person)" by
trimming or avoiding insertion of a space after '(' when constructing the
function parameter list (look for the code that builds the function
signature/newText for mapPersonToEmployee and remove the added space).

In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/to_source/config/function_definition20.json`:
- Around line 2-13: The JSON fixture has a mismatched file name in
diagram.codedata.lineRange.fileName (it is "single.bal") which must match the
declared source/output "empty.bal"; update diagram.codedata.lineRange.fileName
to "empty.bal" (and any other occurrences referenced in the same fixture, e.g.,
the block around lines 109-121) so the test harness applies ranges to the
correct file and lookups succeed.

---

Nitpick comments:
In
`@flow-model-generator/modules/flow-model-generator-ls-extension/src/test/resources/to_source/config/function_definition21.json`:
- Line 75: The generated signature for function initialize currently uses
"newText" with an extra space inside the parentheses and a trailing space
("public function initialize( ) "), so update the code-generation logic that
builds the function signature (where "newText" is composed for function
initialize) to produce no space inside the parentheses and no trailing space
(e.g. "public function initialize()" or at minimum "public function initialize()
"); trim or adjust the string concatenation/format helper that emits parentheses
to remove the internal and trailing spaces and ensure this formatting is applied
consistently for other function signatures.

Copy link
Contributor

@NipunaRanasinghe NipunaRanasinghe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants