-2

using this code to fetch files for codegen from filesystem

public void executeCommand(Resource resource, Document document, ILanguageServerAccess access,
            ExecuteCommandParams params) {

        JavaIoFileSystemAccess fileSystemAccess = getFileSystemAccess(params);

        final Function<ILanguageServerAccess.IndexContext, Boolean> func = (
                ILanguageServerAccess.IndexContext ctxt) -> {
            for (final IResourceDescription rd : ctxt.getIndex().getAllResourceDescriptions()) {
                if (isGenerate(rd)) {

                    Resource res = getResource(access, rd);

                    if (res != null) {
                        generator.doGenerate(res, fileSystemAccess, new GeneratorContext());
                    }
                }

            }
            return true;
        };

        access.doReadIndex(func);
    }

this code is returning deleted files of filesystem.

Expecting updated files from filesystem with deleted files filtered

Siddharth
  • 1
  • 1

1 Answers1

0

It might be due to language client options, it should be similar to below :

function createClientOptions(): LanguageClientOptions {
    return {
        documentSelector: ["your extension"], synchronize: {
            fileEvents: workspace.createFileSystemWatcher("**/*.*")
        }
    };
}

Particularly in this case, i think you are missing createFileSystemWatcher. Also if not using the latest version of Theia then please update.

kuldeep singh
  • 25
  • 1
  • 7