Unable to get file operation notifications (willRename, etc) #387
-
I'm tring to implement a language server for Minecraft:Java Edition shaderpacks that require Optifine, and I found that my language server cannot recieve willRename notifications. Source code here: GeForceLegend/vscode-mcshader/rename_feature. I searched in issues of several vscode related repo and google, and found nothing useful. There are some guys on stackOverflow have the same problem with me, but the answer doesn't helps. // will_rename part in server capabilities
will_rename: Some(FileOperationRegistrationOptions {
filters: vec![FileOperationFilter{
scheme: Some(String::from("file")),
pattern: FileOperationPattern {
glob: String::from("**/*.{vsh,gsh,fsh,csh,glsl}"),
matches: Some(FileOperationPatternKind::File),
options: None
}
}]
})
// dynamic registration for will rename. it's now commented in source code.
Registration {
id: String::from("workspace/willRenameFiles"),
method: String::from("workspace/willRenameFiles"),
// glsl_file_operation is a FileOperationRegistrationOptions with same filter in above capabilities code
register_options: Some(serde_json::to_value(&glsl_file_operation).unwrap()),
}, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi there, @GeForceLegend! I think your server capabilities code looks fine, on a cursory glance (though I believe Have you verified that the client extension has Here's a page you might find helpful regarding dynamic capability registration, if you haven't looked at it already: link |
Beta Was this translation helpful? Give feedback.
Hi there, @GeForceLegend! I think your server capabilities code looks fine, on a cursory glance (though I believe
did_rename
needs to be activated also by being set toSome(_)
, if you'd like to receive that type of notification statically, but that's a minor thing).Have you verified that the client extension has
willRename
enabled in itsTextDocumentSyncClientCapabilities
as well? You can find out by inspecting theparams
passed into theLanguageServer::initialize()
method. I'm currently away from my computer, so I can't confirm right now, unfortunately.Here's a page you might find helpful regarding dynamic capability registration, if you haven't looked at it already: link