Troubleshoot Common Problems Encountered When Editing InterSystems Applications with VS Code
This page provides guidance to help you solve problems which you may encounter while using the InterSystems® ObjectScript Extension Pack for Visual Studio Code (VS Code) to develop InterSystems applications.
Server Connection Issues: Log REST Traffic Between the ObjectScript Extension and Your Server
The InterSystems ObjectScript extension for VS Code provides the connection between your InterSystems server and the VS Code environment by communicating with the server’s /api/atelier REST API. If you are experiencing a problem interacting with an InterSystems server from VS Code, the ObjectScript extension can help you debug it by logging REST traffic to the ObjectScript output channel. This output does not include any confidential identifying information (such as usernames, passwords, or cookies), which means that you can also safely include it as supporting material if you need to report an issue with the extension.
To log the REST traffic between the extension and your InterSystems servers, perform the following steps:
-
Select the Output panel and ensure that it is displaying output from the ObjectScript channel by selecting ObjectScript from the drop-down menu.
-
If necessary, clear the contents of the ObjectScript output channel by selecting the
Clear Output button or by right-clicking within the output channel and then selecting Clear Output from the context menu.
-
Change the value of the objectscript.outputRESTTraffic setting to true. When this setting is enabled, the InterSystems ObjectScript extension logs all REST traffic between the extension and your servers to the ObjectScript output channel.
-
Perform the actions to reproduce your problem, and review the logs which appear in the ObjectScript output channel.
-
Change the value of the objectscript.outputRESTtraffic setting to false to stop logging REST traffic.
Cannot Save Routine: Illegal Header Line, ROUTINE Header Is Required
When you save or update a file to an InterSystems server using the InterSystems ObjectScript extension for VS Code, the extension invokes the InterSystems IRIS® source code file REST API’sOpens in a new tab PutDoc methodOpens in a new tab. The PutDoc method requires the first line of a routine file to be a header which identifies the file contents as routine code. For the ObjectScript routine file testroutine.inc, this header would take the following form:
ROUTINE testroutine [Type=INC]
The Type keyword can also specify MAC or INT. If no Type is specified, MAC is assumed by default.
If you attempt to save or update a routine which does not include the ROUTINE header, the save operation fails with the error message ERROR #5001: Illegal Header Line.
The ObjectScript extension automatically adds this header when you create a new routine file in VS Code if the objectscript.autoAdjustName setting is enabled (which it is, by default). When you use an editor to view the contents of a routine file which does not include this header, the InterSystems Language Server for VS Code decorates the code with a ROUTINE header is required CodeLens link. Select the link and the Language Server extension will add the header for you.