VS Code and online editors or file upload (deployment) via HTTP - visual-studio-code

I have an editor on my site that allows to edit and save certain HTML code.
But I wanted to be able to edit this code through Visual Studio Code.
If there is any way using VS Code to edit code in a form on a Chrome browser page, or send code from VS Code directly to a remote server via HTTP ?
I know that it is possible to use remote development via SSH, but this is not suitable, since I do not have access to the server.

Related

Start Point for writing own debugger extension for Visual Studio Code

I want to migrate from Eclipse based IDE to VSC for working with remote Ruby apps and I stuck with writing VSC debugger extension.
Currently, the debugger in the Ruby App and debugger part in Eclipse IDE communicates via HTTP.
I have read the known widely article "Debugger Extension" and don't have yet clear understanding how exact to do it.
In my mind I must use Server type of VSC debugger, which starts to listen HTTP on specific port and translate commands to from DAP. But I cannot get workable sample of this.
Do somebody smthng like this?

How do you debug a Microsoft Word web add-in with vscode?

Visual Studio has a template for a Word web add-in. Clicking 'Start' opens Word with the add-in loaded, and allows for immediate debugging of the front-end javascript in the IDE.
Word was running the add-in in ie11.
With this project, the only options I've found are debugging with 'f12' debugger located in C:\Windows\SysWOW64\F12\IEChooser.exe (or System32).
I installed the latest version of windows to get access to the new Windows Terminal. This update also switched the Word add-in to load in edge instead of ie11, which requires the new Microsoft Edge Developer Tools.
I would like to get access to the functionality Visual Studio provides for debugging front-end code via an IDE instead of f12/edge developer tools. I cannot find out how Visual Studio allows this debugging as all of the properties are hidden away as settings in .sln and web.config etc.
Is there any way to debug this add-in with Visual Studio/vscode (preferrably vscode)?
There are many ways you can use VSCode for debugging but all debugging methods depends on external browsers like chrome, IE, edge debugger. I believe you do not want to perform this in VSCode.
This method will help you in some way. But I am sure you can manage this.
Step 1. Create a word web addin using Yeoman generator. Official link below
https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/word-quickstart?tabs=yeomangenerator
They use nodejs and you can choose Angular / React / JS to build your addin.
The advantage is it will give you the flexibility to debug in any IDE .
Caveat: As I said above you can easily build the Addin with the help of web technology.
Step 2: Debugging: either you can use VSCODE Debugging functionality or use the browser
Step 3: If you choose browser: Go to sources > Choose Webpack > Select the .ts or /js file and set the breakpoint. Screenshot below for your kind reference.
note: I have selected Angular from office generator to build the addin. Then you can see the webpack under the sources. I believe this is the same for any technology.
Hope this will help you.

Word Web Add-in: Sorry, but we can't start this app because it isn't set up properly

I try to deploy my Word web add-on that created by Visual Studio 2017 using the Slideloading method.
When I upload the manifest file the message it gives to me seems fine saying:
Get started with your sample add-in!
Your sample add-in loaded successfully. Go to the HOME tab and click 'Show Taskpane' button to get started.
but when I go to use it, it fails saying:
Add-in Error Sorry, but we can't start this app because it isn't set up properly.
Although I followed the sideloading method well and changed the source location default value to: <SourceLocation DefaultValue="https://localhost:44300/App/Home/Home.html" />
Besides this method worked well by OfficeApp manifest.
If you created your add-in using Visual Studio and just want to test it, you can run/load the add-in simply by using F5 (Start) within the Visual Studio project. When you press F5 to start the project, Visual Studio will automatically host the add-in on your local IIS server and will open Word with the Show Taskpane button visible in the Home tab. The Word add-in quickstart describes this process in more detail. (Note: if you're using Visual Studio to run the add-in like I've described here, you shouldn't modify the localhost port number within the DefaultValue attribute of the SourceLocation element in the manifest.)
If you created your add-in using Visual Studio but want to be able to run it by using the Sideloading technique (i.e., without using Visual Studio), then you'll need to deploy the web application portion of the add-in to a web server. In your post, you say that you've specified https://localhost:44300/App/Home/Home.html as the initial page of your add-in. If you navigate to that URL using a web browser, does the page load successfully (with no certificate errors)? If not, that could indicate a problem with your web app -- for example, perhaps there is no web server running at localhost:44300, or perhaps the web server is running but there is no such path as App/Home/Home.html, or perhaps the web server is running and that is a valid path but the add-in web app isn't SSL-secured.

Console does not show event source from source map

In FireFox I load my web application which has a Source Map. The Source Map seems to be loaded correctly, as the Debugger tab shows the original source files.
However, the Console tab contains only links to the compiled code, instead of the Source Map code.
Is a Source mapping done in FireFox Console?
Do I have to enable anything?
Update: I also tried it in chrome and there the console shows the original location of the event, BUT: only the first time after starting chrome AND only, if I first load the page and then open the developer tools. Exactly same behaviour in opera (same engine...)
Update 2:
As of Firefox bug 670002 Web console does still not support source mapping.
In chrome the source mapping works more than once if I directly embed the source mapping instead of using an URL.
For chrome developer tools, the answer was covered in this issue:
https://bugs.chromium.org/p/chromium/issues/detail?id=633549
In some cases, developer tools requested the source map file when no connection was alive anymore. It tried to open a new connection, which failed silently because of an invalid ssl certificate.
You may run into this, when:
You serve using https
You do not have a valid ssl certificate (which may happen often when you just run a quick local node.js https server)
Your https server closes the connection fast or immediately
Especially when your https server sends connection:close in the response headers you may run into this.
The biggest issue is, that this request is not shown in the network tap nor in the console, it is just silent.

How OrientDB Studio Code Works?

I have a question regarding the way the OrientDB studio works.
When I build my own web application to access the OrientDB database, I need to enable CORS and then it works, but how comes that the OrientDB studio app works without having to enable CORS?
That's really puzzling me because I'd like to reuse the code logic of the OrientDB Studio app in my own application and it does not work like the OrientDB Studio app.
Also, it seems that the OrientDB Studio app is using the REST API of OrientDB, not the JavaScript API (orientdb-api.js). Am I right?
Is there any documentation I could read to get a full understanding of how the Studio works?
Regards,
Jeremie
You need to enable CORS because your app it is outside the domain of ODB. if you are running it in localhost is http://localhost:2480.
So if you make a request from a different domain the browser stops you if the server has CORS disabled.
Studio starts as a plugin inside ODB http (http://localhost:2480/studio/index.html) so is allowed to do request without enabling CORS.
If you do not want to enable CORS you can put your html and js under the www directory in
the $ORIENTDB_HOME distribution.
There is no documentation about Studio Code. You can browse it here https://github.com/orientechnologies/orientdb-studio if you need some further information you can ask me as i'm the main maintainer of Studio :D
I can tell you that it does not use the orientdb-api.js as it uses angular.js.
I advice you to not use orientdb-api.js but uses directly the REST api
with JQuery/Angular.