-
-
Notifications
You must be signed in to change notification settings - Fork 960
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
workspace.onDidOpenTextDocument cannot work #5200
Comments
I encountered this before; I remember that the event was fired before the extension was activated. After extension activated, open document like |
A workaround for this: export async function activate(context: ExtensionContext): Promise<void> {
context.subscriptions.push(
workspace.onDidOpenTextDocument(didOpenTextDocument),
);
workspace.documents.map((doc: Document) => {
didOpenTextDocument(doc.textDocument);
});
} |
Where is didOpenTextDocument? |
Custom example function. The |
Can you provide an entire solution includes |
Freed-Wu
added a commit
to Freed-Wu/coc-write-good
that referenced
this issue
Dec 25, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Result from CocInfo
versions
vim version: NVIM v0.10.2
node version: v20.18.0
coc.nvim version: 0.0.82-9fd85781 2024-09-21 00:59:00 +0900
coc.nvim directory: /home/wzy/.local/share/nvim/repos/github.com/neoclide/coc.nvim_release
term: tmux
platform: linux
Log of coc.nvim
2024-11-24T22:30:58.650 INFO (pid:1067148) [plugin] - coc.nvim initialized with node: v20.18.0 after 78
2024-11-24T22:30:58.669 INFO (pid:1067148) [core-watchman] - watchman watching project: /dev/shm/coc-test
Describe the bug
Then
Expected:
Display test after open test.vim
Actually:
Nothing happened.
The text was updated successfully, but these errors were encountered: