How VSCode debugger stepin to open a new file? - visual-studio-code

I am implementing a vscode debugger, with stepin function, I need to step into a new file, but I don't know how it works now, how it opens a new file for step into? and another question, this new file will be loaded from server dynamically, it is not in the local workspace. I don't know how to do it in DAP? please help!! Thanks!

I have the answer and post here for a reference.
VSCode use StackTraceRequest to set the stop line number and file.
It will be called after a stopped event.
so for the response of StackTraceRequest, we can set the StackFrame object, and the source object in it is for file.
https://microsoft.github.io/debug-adapter-protocol/specification#Types_StackFrame

Related

How to change the default URL of thunderclient

Whenever we make a New Request, the default URL in the URL box is
"https://www.thunderclient.com/welcome"
How can we change this with our own URL?
If you want to have a base url. It's super easy in Thunder Client-vs-code.
Firstly, got to Collections
You should have Folder for your project API. And click on ... icon and got to Settings will move to Collection Settings
Secondly, Change the Base Url and save it.
You have done.
This feature is already requested in their Github issues but has still not been added yet.
So, the workaround I find is this:
Go to %USERPROFILE%\.vscode\extensions\rangav.vscode-thunder-client-1.18.7\dist for Windows.
Or go to $HOME/.vscode/extensions/rangav.vscode-thunder-client-1.18.7/dist for Mac or Linux.
Open extension.js file with Notepad or any text editor.
Find and replace this https://www.thunderclient.com/welcome with your desired URL.
Save the file and restart VS Code.

How to log file data onclick on vscode workspace using onDidChangeSelection event

I want to get file data on file click on workspace.
For example I have todo-list project folder and a file named app.js. I want to log app.jss' vscode metadata in debug console on file click in tree-view workspace.
todo-list > app.js
Upon searching in docs, I saw onDidChangeSelection event. I want to use the event and see if I can log any data on file selection in tree-view.
onDidChangeSelection: Event<TreeViewSelectionChangeEvent<T>>
Can anyone please help me on how to use onDidChangeSelection event? I already tried scanning vscode.window and vscode.TreeItem and still can't find the event.
And if anyone had already tried logging file data on file click in tree view, what vscode event/api did you use?

How to create an extension command similar to VSCode's File: New File command?

I want to create a command that has the same flow where once you create the command it will take you to the explorer window and allow you to type the name of the file there. Is there a way to do that with the existing vscode API?
Update: The flow of creating the file through the explorer was done by executing 'explorer.newFile'. I want to take the user's input, create 2 template files, and then delete the original file created by 'explorer.newFile'. It does not seem like 'explorer.newFile' returns info about the new file so I created a filewatcher to do this which makes for choppy creation/deletion of the files. Is there a way to make this smoother?
No, not as VSCode 1.15. Your best bet currently is to either try reusing the built-in create file command (explorer.newFile) or to use the quick picker API to achieve a similar flow

{Netbeans}The form file does not contain valid XML.Form cannot be opened.Contents is not allowed in prolog

I was recently working on a really huge project in netbeans. I saved it in my desktop, and then proceeded to save it also in my USB. However, the next day, when I learned it could be for a later date, I deleted the one in my USB.When I put on the one in my desktop, all the work I had done was not saved on it, including the making of new JFrames etc. So I used a program to recover my deleted files. I now have loaded them into the netbeans IDE< however, there is an error sign next to most of them. When I click on a class inside my project with the error,an error message comes up before I can access it. It says "The form file does not contain valid XML.Form cannot be opened.Contents is not allowed in prolog." When I press "OK", my class has "coding" which looks like:
W�'6��G��ԧ��(g&�Cd�nw|7�\ej��
�;���كG�s=�Bl+��6�r�#ma���'�f�T�9Kx�q�M�G�t�q� �:���� \!�%İ��P�&!�[�R���`�,+��U���"���Ј���yF&mÛ�
�
Y ?/,8��#�t:�ԇ
��lOѪ|T�^?v"
....that.
And when I go to "design view" that message comes up again. What should I do? What CAN I do? I really need the bulk of my project to finish it in time!!!Oh, the project is for tommorow, so the quicker answer the better :'(
right click on the latest file from History ->revert (the .form)
Go to the history of the file and copy the content of .form file then go to directory and open the 0byte file .form by the editor and paste the content! I have done this and it worked for me.

Where should I place the java properties file under netbeans

In my netbeans IDE I am creating one project.That project(Web Application) needs properties file.Since my application is having several packages.And all packages need to read this properties file in their code.So where should I place this java properties file.If I place the file out side of the packages that is under sourcepackages seperately,I am getting FilenotFound Exception.So where should I place it.
And one more doubt is if I want to change any content in the file in future where should I change the contents since it is present in Projects folder and under Files->build->classes folder also.From where should I modify it.From where the changes will be effected.
Please help.
Thank you.
Put your file under /src/resources/, then use it like below:
ResourceBundle props = ResourceBundle.getBundle("resources.config");
You may put this in any package. The point ist to read with
MyClass.getResourceAsStream("my.properties");
Read further here.
You always change in the project src folder. The build folder is only for building your app.
If you want to change the properties file on a deployed system you may put the properties into the WEB-INF folder and then access with ServletContext#getRealPath().
I put the .properties file in the same folder as the src and it works :)
Alright, so I'm working on Windows and here's my solution...
It actually doesn't matter much where you put the .properties file--but assuming you created the file in NetBeans and let it save to its default location, you can simply call the data with the full directory attached.
Just for reference, here's what I did:
SimpleDataSource sds = new SimpleDataSource("src\\simpledatasource\\mystuff.properties");
Notice you'll need to escape the backslash, so use two of them.