Skip to main content
InterSystems Components and Tools
AskMe (beta)
Loading icon

Troubleshoot Common Problems Encountered When Editing ObjectScript with VS Code

This page provides solutions to problems which you may encounter while using the InterSystems® ObjectScript Extension Pack for Visual Studio Code (VS Code) to develop ObjectScript-based applications.

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.

When you use an editor to view the contents of a routine file which does not include the ROUTINE 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.

FeedbackOpens in a new tab