The following steps outline the process for configuring propath entries in your development environment. Propath allows the OpenEdge compiler and runtime to locate procedures and classes stored in the specified directory, which ensures that any .p files or related resources within that directory are recognized and used correctly during compilation and execution. By defining valid paths and restarting the language server, developers can ensure accurate resolution of dependencies and improved development workflow.
  1. To add a propath entry, update the buildPath attribute in the openedge-project.json project configuration file. Ensure that backslashes are properly escaped in JSON format. For example, to include c:\workspace\myProject\dependency as a propath entry, specify it as follows:
    
    {
      "path": "c:\\workspace\\myProject\\dependency",
      "type": "propath"
    }
    Note: The specified propath must exist on disk. If it does not, the language server Output reports an error upon restart. To resolve, create the c:\workspace\myProject\dependency directory.
  2. Restart the ABL language server.
  3. Create an include file with the .i extension in the specified propath. An include file is a reusable code fragment that can be referenced from other procedures. For example, the following code defines the myTT temp-table within the myInclude.i include file in the dependency directory:
    
    define temp-table myTT no-undo
    field fld1 as int
    field fld2 as int
    field fld3 as char
    index myTT-PK is primary unique fld1.
    Code completion is now available for this temp-table. You can reference it in src\test1.p.

    By placing the include file in a shared location, such as \dependency directory and referencing it from other .p files like src\test1.p, you enable code completion and ensure consistent structure and behavior for the temp-table throughout your project. This setup not only enables code completion in the IDE but also promotes reuse and maintains a consistent structure and behavior for the temp-table throughout your development workflow.

    Note: Due to a known issue in the language server, code completion for file names in propath entries is not available. However, code completion works for files in source directories. Use F12 or right-click and select Go to Definition while the caret is within the curly braces to open the include file.
  4. The openedge.net.pl procedure library is not included in the propath by default. This procedure library allows developers to make HTTP(S) requests directly from ABL code, enabling integration with web services, REST APIs, and other external systems. To add the procedure library to propath, add the following snippet in openedge-project.json:
    
    {
      "path": "${DLC}/tty/netlib/openedge.net.pl",
      "type": "propath"
    }
    The openedge.net.pl procedure library is added to the propath.
  5. Restart the language server to enable code completion for class names.

    Note: Accepting a class name automatically inserts the required USING statement. Enhancements to the formatting of USING statements are under active development.

Add documentation to propath entries for enhanced code insight

You can associate documentation with propath entries using the documentation attribute. This functionality enables IDE features like hover tooltips, which display method properties and descriptions similar to Javadoc-style documentation in other languages.

To configure, follow these steps:
  1. Add the following snippet to openedge-project.json:
    {
      "path": "${DLC}/tty/netlib/openedge.net.pl",
      "type": "propath",
      "documentation": "c:\\workspace\\myProject\\doc\\netlib.json"
    },
    {
      "path": "${DLC}/tty/openedge.core.pl",
      "type": "propath",
      "documentation": "c:\\workspace\\myProject\\doc\\corelib.json"
    }
    
  2. After adding the entries, restart the language server to apply the changes.
  3. To validate the configuration, create a procedure in the src directory and save the procedure using a valid filename, for example test2.p. Ensure that the filename includes the .p extension to ensure it is recognized as an OpenEdge procedure file. Add the following code to test2.p to confirm that code completion and documentation features are working as expected:
    using OpenEdge.Core.Collections.* from propath.
    using OpenEdge.Net.HTTP.*.
    using OpenEdge.Net.URI.
    using Progress.Json.ObjectModel.*.
    
    define variable oClient as IHttpClient no-undo.
    define variable oURI as URI no-undo.
    define variable oRequest as IHttpRequest no-undo. 
    define variable oResponse as IHttpResponse no-undo.
    define variable oList as IList no-undo.
    
    oURI = URI:Parse("http://example.com").
    oRequest = RequestBuilder:GET(oURI):request.
    
    oClient = ClientBuilder:Build():Client.
    oResponse = oClient:Execute(oRequest).
    
    if oResponse:StatusCode <> 200 then
        return error "Request Error: " + string(oResponse:StatusCode).
    else do:
        message string(oResponse:StatusCode) + " -- " + oResponse:StatusReason.
        output to "target/output.html".
        put unformatted oResponse:entity.
        output close.
        message "target/output.html written".
    end.
    
    // OpenEdge.Core
    oList = new List().
    oList:Add(1, oClient).
    
    quit.
    Hovering over a method name displays its properties and documentation, if available.