Closed rover-random closed 6 months ago
Hi @rover-random , thanks for reaching out!
I believe the issue is that +mypackage
needs to be on the path. By default, the current working directory in VS Code is not MATLAB's cwd, nor is it added to the path. We have received similar requests before (e.g. #98), so this is something which is on our radar.
In the file "Explorer" tab in VS Code, try right-clicking in some empty space (in your screenshot, anywhere below "myscript.m") and selecting "MATLAB: Add Folder To Path". Does autocompletion of mypackage
and its subfunctions work after this?
@dklilley right clicking and adding to path was the solution. Wow, thanks! That's been driving me nuts.
Glad to hear it!
We definitely want to improve this to be more seamless.
Describe the bug Code completion for built-in MATLAB works:
Say in my working directory
foobar
I have a namespacemypackage
:I would like to be able to type in vscode
mypa
and seemypackage
autocompleted, and from there the functions in the namespacemypackage
. But I do not:Sometimes this happens for me, and sometimes it doesn't! I cannot discern why it sometimes works and sometimes does not. Things I have considered and have seemed to make some difference, but have not conclusively solved the problem:
+mypackage
, or does a directory containing+mypackage
only need to be on path?I am on Windows.