Codelens using theia extension

I am looking for an example for monaco.languages.CodeLensProvider , I found an example using theia plugins api , but I am not able to mock the same in theia extension.
I have the same question as the link below,but this old link is no longer valid!
Add Codelens using theia extension - Theia Community (theia-ide.org)

Could someone point me to a new one?

Thanks.

I use the following code in frontend-module of theia extension.
However, sometimes it takes effect, sometimes it does not.

import * as monaco from '@theia/monaco-editor-core';

monaco.languages.registerCodeLensProvider('json', {
    // eslint-disable-next-line @typescript-eslint/tslint/config
    provideCodeLenses: function () {
        console.log('aaaaaaaaaaaaaaaa');
        return {
            lenses: [
                {
                    range: {
                        startLineNumber: 1,
                        startColumn: 1,
                        endLineNumber: 2,
                        endColumn: 1,
                    },
                    id: 'setting33',
                    command: {
                        id: 'setting33',
                        title: '配置',
                    },
                },
            ],
            dispose: () => {},
        };
    },
});

Thanks!!!