Skip to content

Enhance Language Server APIs to Support Workspace-Level Projects #2197

@madushajg

Description

@madushajg

Current Limitation

When working in a multi-package workspace, public constructs such as types, functions, and module-level variables defined in one package are not visible in other packages via the helper pane. As a result:

  • Users cannot reference constructs from one project/package in another using the BI helper.
  • There is no explicit mechanism to declare constructs as public so they can be consumed by other workspace packages.

This significantly limits reusability and collaboration within workspace-based projects.

Current Limitations

  1. Expression Editor Scope
  • The following APIs only resolve constructs within the current package and are not workspace-aware:
    • expressionEditor/types
    • expressionEditor/completion
  • Workspace-level public constructs are not returned, even when they should be accessible.
  1. Construct Visibility via Node Template Definition
  • When defining types, functions, variables, etc there is no way to explicitly mark them as public for cross-package access.

Suggested Improvement

  1. Make Expression Editor APIs Workspace-Aware

Enhance the following APIs to return workspace-level public constructs, not just package-local ones:

  • expressionEditor/types
  • expressionEditor/completion

These APIs should:

  • Discover and include public constructs from all packages within the workspace.
  • Include the addional text edit for the import statement
  1. Introduce Public Access Modifiers for Constructs

Update flowDesignService/getNodeTemplate to enable users to explicitly declare constructs as public so they can be consumed by other workspace packages.

This should apply to:

  • Types
  • Data Mappers
  • Functions
  • Module-level variables (Configurables etc)

Version

BI v1.5.4 | Ballerina v5.6.4

Sub-issues

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions