Program Beckhoff PLC in VS Code - visual-studio-code

Since Beckhoffs TwinCAT3 Shell is missing basic function that are considered standard in other IDEs im trying to switch to VS Code to do the job.
There is an extension that enables syntax highlighting for ST (Structured Text) which is great.
But im not satisfied how the TcPOU files (xml formatted) are displayed.
I'm used to the window layout of TwinCAT3 and am wondering if it is somehow possible to have a similar layout with VS Code.
In Beckhoffs TwinCAT3 Shell, which is based on Visual Studio, the decleration of variables and the code are seperated by a horizontal bar. Furthermore the header of the xml file is not displayed in TwinCAT3.
So basically what im asking is if i can make VS Code display
<Declaration><![CDATA[
]]></Declaration>
as a horizontal line and hide the xml header.
VS Code Beckhoff TwinCAT3

Related

Vscode .net interactive notebooks hide code when exporting to HTML

How do I hide the code cell when exporting .net interactive notebooks in visual studio code?
For instance,
I'd like to export the output, which is the latex display part of the example above,
while excluding the actual code cell from being exported.
I found this question for Jupyter notebook but I can't seem to make it work for vscode.
My best option, for now, is to export the whole file to HTML and then manually exclude the elements that are not needed.

Real time Code render mode in Visual Studio Code

For a half year now, I carry an innovative idea for a modern way of code editing. I just realized what Visual Studio Code extensions are already capable of and made me wonder.
The idea is that a real time code render mode for code editors where code is visualized like rendered documentation (for example Doxygen). Non-commented lines of code are displayed like collapsable codeblocks and documentation comments are displayed as the surrounding markdown/HTML/LaTeX document.
This rendered view still can be edited and navigated in same way as the classic text view so that new graphical elements appear after typing them as text into a comment. Therefore, rich interactive documentation reading (like hiding/showing parts, jumping across locations with hyperlinks) and code editing would be combined into one activity without time needed for switching between both or mapping Documentation with actual code locations. Different from the original literate programming idea, the file's physical content is unchanged and doesn't complicate the process or source code reading.
It's conceptually how Moodle text editors work (HTML code view and render view) or like using a graphical word processor to visualize source code instead of a single monospace text. Of course, the cursor would move along lines in their visually presented order and not in their file's actual order.
Do you know, if such a real time render mode is possible in VSCode?
Did someone had such an idea and made an extension?
btw:
This "render mode" idea is actually quite generic and could be used as general customizable GUI technology that would allow GUI elements to be navigated, edited via an underlying text representation.

VSCode displays source code again in interactive window

A question from a newbie here: when I run some python code in VSCode, there is always a display of source code in the interactive window. Thus I have to scroll all the way down before I can see the output. That makes the debug quite troublesome.
Please see the screenshot above. The code was displayed in the interactive window despite the editor just at left side over there. Any way to have VSCode, or maybe Jupyter extension, go directly to the output? (in my case starting from the 'Training Dataset shape......')

How to create a modal for a VSCode extension?

I'm trying to make an extension for VSCode to Find text in File (Like in Notepad++).
Is there an API for using a modal in a VSCode extension? or at least extend the Command Palette?
VS Code (1.34) has no concept modal UI. Extensions can only show basic dialog messages modally using the showMessage apis.
Messages can show message text and a set of buttons. By default VS Code will render messages in its UI. The MessageOptions.modal option makes VS Code render the message using system UI instead.
Try positing a more specific question about what you are trying to accomplish. VS Code's extension model is different from other editors, so if you are trying to replicate functionality from another editor like Notepad++ you may need to rethink the user experience.
I believe what you are looking for is an input box. It will show a UI where you can input text. From there you can grab the text of a document and parse it for entered text. For completeness, VS Code does this with ctrl + f or cmd + f depending on OS. Add the shift key to search the whole project.
As mentioned above there are the limited built-in inputs and message box (which can also be used to display choice buttons).
You can also have a look at WebView these can be used to display a side-bar view (like the EXPLORER) or a full document. They are made up from HTML and plain old JavaScript. You will have to pass simple string messages between your HTML/JS view and vscode itself.
https://code.visualstudio.com/api/extension-guides/webview
https://github.com/Microsoft/vscode-extension-samples/tree/main/tree-view-sample
A large 'document' view example vscode extension is call 'nearest-icons'
https://github.com/noGreg/nearest-icons

Spacing or Horizontal lines in custom VS Code grammar

I just worked into grammar creation with Atom and now VS Code and I'm currently developing an own grammar in VS Code.
In the text file I cannot insert extra spacings, but I would like to separate logical blocks with an Bigger spacing or an horizontal line.
But I don't now how to achieve this, because as far as I figured out none of the VS Code templates scopes allows such a style.
Could someone tell me how I can achieve this?
As far as I figured out I will need to add a custom scope to each used template?
That's not possible. Visual Studio Code is not a text processor, but a source code editor. If you want separation simply add an empty line.