How to trigger file delete? #459
Unanswered
BruceQin2016
asked this question in
Q&A
Replies: 1 comment 1 reply
-
As well as registering the For example, the following snippet will ask the client to send you delete notifications for any python files in the workspace. @server.feature(
WORKSPACE_DID_DELETE_FILES,
FileOperationRegistrationOptions(
filters=[
FileOperationFilter(
pattern=FileOperationPattern(glob="**/*.py"),
)
]
),
)
def did_delete(params:DeleteFilesParams):
logging.info(params.files) The LSP Specification has the details on all the different options you can use with Hope that helps! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
When i try to use "WORKSPACE_DID_DELETE_FILES" feature, nothing happened after i delete one file
The code is here:
import logging
from pygls.server import LanguageServer
from lsprotocol.types import (
TEXT_DOCUMENT_COMPLETION,
CompletionItem,
CompletionList,
CompletionParams,
CompletionOptions,
WORKSPACE_DID_DELETE_FILES,
DeleteFilesParams
)
from pygls.workspace import TextDocument
from lsprotocol import types
@server.feature(WORKSPACE_DID_DELETE_FILES)
def did_delete(params:DeleteFilesParams):
logging.info(params.files)
no log output
how to deal with this?
Beta Was this translation helpful? Give feedback.
All reactions