mathworks / MATLAB-language-server

MIT License
82 stars 10 forks source link

Define project path to find all code dependencies #37

Open a1gituser opened 6 months ago

a1gituser commented 6 months ago

I'm currently able to setup and use matlab_ls under neovim. However, one of the projects I work on has multiple functions and scripts defined in different folder paths. Usually these are added with some setup scripts so as to not contaminate the path with unnecessary entries when working with other projects.

Is it possible to setup the LSP to load these paths via a script or some other setting? Is there a different approach to help the language server find my function definitions?

thanks!

dklilley commented 6 months ago

Thanks for raising this!

This seems similar to mathworks/MATLAB-extension-for-vscode#98. Do you think these are the same, or do you have additional requirements to address your pain?

J-Sorenson commented 6 months ago

This seems similar to mathworks/MATLAB-extension-for-vscode#98. Do you think these are the same, or do you have additional requirements to address your pain?

I suppose it could be implemented in the VSCode extension by way of a startup script (if the language server supports that). It may be cleaner to implement path definitions in the language server, though. It would be nice to specify paths in the project workspace preferences in a generic fashion in order to support multiple editors.

a1gituser commented 6 months ago

Yes they're similar, and agree that having the option to execute a script like startup.m would take care of this. Whether it is fixed (i.e., always startup.m) or defined in options per project would be awesome. And I think it would fix my issue.

Thanks for showing me the other issue! That was helpful.