mathworks / mathworks/MATLAB-language-server

Go to Definition on package name in call to package function opens package name, not function

Open
#16 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
125
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Create the following files, one of which is in a package directory: somepath/+plot/doThing.m
    • somepath/+plot/doThing.m
    • somepath/sample.m
  2. In sample.m, make the following call: plot.doThing()
  3. Go-to-Definition on doThing - doThing.m opens correctly
  4. Go-to-Definition on plot - plot.m opens instead

Expected behavior
In the above example, it is expected that doThing.m will open.

Additional context
Will need to determine how to handle cases like the following: pkg.ClassName.funcName(). If Go-to-Definition is triggered on the class name, do we want to open the class definition? Going to the function definition would often go to the same file, unless it is implemented in a class folder.

Internal tracking number: g2885285

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the issue with somepath/+plot/doThing.m and somepath/sample.m, then trace the Go-to-Definition handling for plot.doThing(). Compare the existing behavior for doThing with the package-name case, and clarify how class-name selections such as pkg.ClassName.funcName() should resolve. Done means selecting plot opens doThing.m consistently with the expected behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.