jitar icon indicating copy to clipboard operation
jitar copied to clipboard

Visual studio code plugin

Open basmasking opened this issue 5 months ago • 0 comments

We would like to have our own VS code plugin to improve developer experience.

Because we have separated the deployment model from the runtime model, VS code is not able to help the developer to determine if an import will be available at runtime. This depends on the segment configuration.

We would like to have a nice VS code plugin that can read the segment information, and help the developer by highlighting imports that won't work at runtime. When, for example, a certain function is set to private in the segment configuration, then VS code should show a red highlight when a function from another segment wants to import that specific function.

If the configuration looks like below

{
    "./game/checkSecret": {
        "default": {
            "access": "protected"
        }
    },
    "./game/getSecret": {
        "default": {
            "access": "private"
        }
    }
}

We would like to have a red highlight for the following import

// a random function in another segment

import getSecret from '../game/getSecret';

export default randomFunction(secret: number)
{
    return secret === await getSecret();
}
...

But it should not highlight the import for any function that is in the same segment.

// function in the 'game' segment

import getSecret from './getSecret';

export default async function checkSecret(secret: number): Promise<boolean>
{
    return secret === await getSecret();
}

In case of protected access, some sort of warning highlight would be nice. This should help the developer understand that the function is only available from any server that has a trust key configured.

basmasking avatar Feb 15 '24 14:02 basmasking