Skip to content

Does not respect 4D Package Manager ? #37

@dbyte

Description

@dbyte

We’ve just migrated our project to the no-longer brand-new 4D Package Manager. That means our custom components are no longer located in <4DHostProjectRoot>/Components. Instead, their sources are located and Git-tracked in <4DHostProjectRoot>/.dev/components-source (so still being part of our modular monolith, which is ok so far).

Our 4D.app development environment can handle this new setup in interpreted mode and the syntax check runs successfully and type-ahead for component methods and cs namespaces succeeds. In our host app there is <4DHostProjectRoot>/Project/Sources/dependencies.json in the source folder, and an additional <4DHostProjectRoot>/environment4d.json. Both are tracked via Git.

But your 4D Language Server for VS Code appears to expect components in <4DHostProjectRoot>/Components (both as links to the components source projects or as packaged 4dbase components). It now reports 4k+ errors because it does not anymore recognize the custom components we’re using. There is no type-ahead for component methods or namespaces either in VS Code.

Note: As soon as we restore all links (OS aliases) to our custom component project files in <4DHostProjectRoot>/Components, the 4D-Analyzer works as expected. But that's not the point of the 4D Package Manager, is it? We want to avoid this effort in any case, and avoiding it is a main reason why we migrated to the "new" 4D Package Manager.

Is the assumption correct that the language server does not recognize the components when their 4dbase package or links to their project source files are not located directly in <4DHostProjectRoot>/Components? Is it not aware of the 4D Package Manager?

Appendix

File <4DHostProjectRoot>/Project/Sources/dependencies.json:

{
    "dependencies": {
        "4D-Form-JSON-SDK": {},
        "Code-Behind-Forms-SDK": {},
        "CustomConstants": {},
        "EInvoice": {},
        "js_component": {},
        "Logger": {},
        "Progress": {},
        "VM-Dashboard": {},
        "VM-Email": {},
        "VM-Entity": {},
        "VM-File-Manager": {},
        "VM-SVG_mP_Logos": {},
        "VM-Xml": {},
        "VMForecast": {},
        "VMGui": {}
    }
}

File <4DHostProjectRoot>/environment4d.json:

{
    "dependencies": {
        "4D-Form-JSON-SDK": ".dev/components-source/4D-Form-JSON-SDK",
        "Code-Behind-Forms-SDK": ".dev/components-source/Code-Behind-Forms-SDK",
        "CustomConstants": ".dev/components-source/CustomConstants",
        "EInvoice": ".dev/components-source/EInvoice",
        "js_component": ".dev/components-source/js_component",
        "Logger": ".dev/components-source/Logger",
        "Progress": ".dev/components-source/Progress",
        "VM-Dashboard": ".dev/components-source/VM-Dashboard",
        "VM-Email": ".dev/components-source/VM-Email",
        "VM-Entity": ".dev/components-source/VM-Entity",
        "VM-File-Manager": ".dev/components-source/VM-File-Manager",
        "VM-SVG_mP_Logos": ".dev/components-source/VM-SVG_mP_Logos",
        "VM-Xml": ".dev/components-source/VM-Xml",
        "VMForecast": ".dev/components-source/VMForecast",
        "VMGui": ".dev/components-source/VMGui"
    }
}

Content of folder <4DHostProjectRoot>/.dev/components-source:
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions