update format.

This commit is contained in:
ShuiRuTian 2021-01-10 14:15:59 +08:00
parent 09ed9d0444
commit f5a6fda327

View file

@ -58,16 +58,17 @@ export function createClient(serverPath: string, cwd: string, extraEnv: Env): lc
// 2. filter some change in here.
// 2.1 rename from or to `mod.rs` should be special.
// 2.2 not all folder change should be cared, only those have files with ".rs" postfix.
let newFiles = data.files.map((file)=>{
const newFiles = data.files.map((file) => {
const isFolder = !file.oldUri.path.endsWith(".rs");
return !isFolder ? file : {
oldUri: vscode.Uri.file(file.oldUri.path + '/'),
newUri: vscode.Uri.file(file.newUri.path + '/')
}});
};
});
data = { ...data, files: newFiles };
return next(data);
}
}
};
const clientOptions: lc.LanguageClientOptions = {
documentSelector: [{ scheme: 'file', language: 'rust' }],