-
Notifications
You must be signed in to change notification settings - Fork 4
Fix: Register DocumentFormattingEditProvider for VS Code 1.93.1 compatibility #59
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
base: main
Are you sure you want to change the base?
Conversation
|
@copilot the root cause of this issue is likely related to the extension trying to fetch github apis (for listing releases and downloading jar of google java format) from behind company policy. |
…tibility Co-authored-by: JoseVSeb <20752081+JoseVSeb@users.noreply.github.com>
You're absolutely right. Looking at the code flow, the extension tries to fetch GitHub APIs during activation in |
|
@copilot, even if company policy is the cause, GitHub APIs are not necessarily blocked (this was verified by me previously). However, the fetch by the extension fails because the SSL certificate is not being verified. The proxy employed by the company may be interfering with the extension's ability to properly check with the CA Authority (although it's not blocked, as SSL-validated downloads work even through the console). Perhaps there's a way for the extension to do this even behind a proxy? |
Co-authored-by: JoseVSeb <20752081+JoseVSeb@users.noreply.github.com>
You're absolutely right about the SSL certificate verification issue. I've implemented a solution that adds a The changes include:
When Fixed in commit a9ee473. |
Problem
Users reported that the Google Java Format extension was not working with VS Code 1.93.1, showing an error: "Google Java Format for VS Code is configured, but it cannot format 'Java'-files."
Root Cause
The extension was only registering a
DocumentRangeFormattingEditProviderbut not aDocumentFormattingEditProvider. VS Code's "Format Document" command requires aDocumentFormattingEditProviderto be registered, and VS Code 1.93.1 appears to have made this requirement stricter.Solution
Added registration of both formatting providers in
GoogleJavaFormatEditService.ts:The
GoogleJavaFormatEditProvideralready implemented both required interfaces:DocumentRangeFormattingEditProvider- for "Format Selection"DocumentFormattingEditProvider- for "Format Document"Testing
This minimal change resolves the compatibility issue with VS Code 1.93.1 while preserving all existing functionality.
Fixes #57.
Warning
Firewall rules blocked me from connecting to one or more addresses
I tried to connect to the following addresses, but was blocked by firewall rules:
update.code.visualstudio.comnode ./out/test/runTest.js(dns block)If you need me to access, download, or install something from one of these locations, you can either:
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.