mathworks / MATLAB-extension-for-vscode

This extension provides support for editing MATLAB® code in Visual Studio® Code and includes features such as syntax highlighting, code analysis, navigation support, and more.
https://marketplace.visualstudio.com/items?itemName=MathWorks.language-matlab
MIT License
234 stars 15 forks source link

path snippet bugs #162

Closed DuGangfeng closed 1 month ago

DuGangfeng commented 2 months ago

Describe the bug When I use load function, I can't get correct path snippet. Usually just works fine for the first path.

To Reproduce Steps to reproduce the behavior:

  1. Create test.m in vscode
  2. Prepare test.mat in your workspace
  3. Try to use load function to load your test.m
  4. Bad snippet behavior, as you see

Expected behavior Just like in matlab, I want a nice snippet for path. Thanks!

Useful Information

Additional context Add any other context about the problem here.

dklilley commented 2 months ago

To clarify, are you seeing an issue using one of the VS Code snippets (inserting a templatized chunk of code into the editor, such as a class definition), or with tab completion of a file path?

It would be helpful to know exactly what you are doing at each stage of the reproduction steps, as well as exactly what incorrect behavior you are seeing.

DuGangfeng commented 2 months ago

To clarify, are you seeing an issue using one of the VS Code snippets (inserting a templatized chunk of code into the editor, such as a class definition), or with tab completion of a file path?

It would be helpful to know exactly what you are doing at each stage of the reproduction steps, as well as exactly what incorrect behavior you are seeing.

Yeah, the question is about tab completion of file path. And I feel sorry for making you confused. I will try to explain what is happening in my situation.

When I use the load function because I want to import a matlab .mat file in my vscode editor, it can supply the first level file path for tab completion. After I choose one of them and click tab, the file path suggestion in the next level will not appear. But I have not finish inserting my file path completely. So I can just type in the left file path by myself.

In the example I give below, my file struct is my_workspace -self(a dir) -1_7_24(a dir) -test(a dir) test.mat test.m When I type "load(", it show this in my vscode. photo_1 Totally right. But when I choose test dir, and click tab. The file path suggestion disappears like this. photo_2 Yes, this is the question what I said. I can type the left file path by myself. It will remind me of the file path again until I type complete file name and '.' like this. photo_3 I guess I can click tab and finish this input. But not so. It gives me {filename.} twice like this. Just help me input the path completely. photo_4

This may not be a serious question. But I still hope you can fix it, and I will really appreciate it.

dklilley commented 2 months ago

Thanks for the clarification! We hope to make improvements to this in a future release of the extension.

dklilley commented 1 month ago

After looking into this further, I do not believe there is much we can do. This appears to be base VS Code behavior, and I am able to reproduce this in a TypeScript file while typing a file path in an import statement.

I am going to close this as not planned for now, due to this. If this default behavior is changed, we can reopen this issue.