MCP lsfusion_find_elements: a relatedElements seed outside the modules filter is silently dropped and the filtered modules are returned whole

Open
#94 0 comments 0 reactions 1 assignee View on GitHub

@pavel-miniutka is already working on this.

Since Nov 17, 2026.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
54/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
java
Domain
tooling

Research direction

Start by locating the lsfusion_find_elements implementation and its tests for relatedElements, classes, and the modules filter; the issue does not name file paths. Check how seed lookup is limited by the filter and how unresolved seeds are handled. Done means seeds resolve across the project and its libraries, unresolved seeds appear in errors, and a related filter with no resolved seeds returns an empty result.

Written by the indexing model from the issue text.

Description

bug
Description

lsfusion_find_elements with relatedElements and a modules filter is the way to ask which elements of modules B and C a module A (or one of its elements) actually uses, for example when trimming a REQUIRE list. When the seed element is declared outside the filtered modules, the tool returns every element of the filtered modules, as if no relatedElements filter had been given, and reports neither an error nor a meta entry.

Reproducer on a project whose module Catalog requires only System (nothing of Time or Utils is referenced from it):

  1. relatedElements='module:Catalog', relatedDirection='uses', modules='Time, Utils', requiredModules=false, minSymbols=0 returns the Time and Utils module declarations with their classes (DOW, Month, YesNo, ...) and properties (fileName[INTEGER], zipped[], ...).
  2. relatedElements='property:Catalog.nameCategory[Catalog.Item]', relatedDirection='uses', modules='Time', requiredModules=false, minSymbols=0 returns the content of Time, although nameCategory uses only category[Item] and name[Category].
  3. The same module seed with its own module added to the filter (modules='Time, Utils, Catalog') works as intended: the result is Catalog and the System module it requires, and nothing from Time or Utils.
Fix

A seed of relatedElements (and a class of the classes filter) is looked up in the whole project and its libraries, whatever the modules filter, and the filter restricts only the result. A seed that cannot be resolved is reported in errors, and when a related filter was given but none of its seeds resolved, the result is empty instead of the whole filtered modules.

Reason

The usage traversal from a seed in one module into the elements of other modules is the main use of relatedElements together with modules; today that exact combination silently answers a different question, so a dependency check done with it is wrong without any sign of it.

Dominant language
Java
Stars
9
Forks
3
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from lsfusion/plugin-idea

All issues in lsfusion/plugin-idea

Similar issues

More Java issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.