-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
How to disable auto import in eclipse java jdt #224
Comments
@GNSubrahmanyam Either use a middleware to intercept the request or change the You can look at microsoft/vscode-languageserver-node#322 or microsoft/vscode-languageserver-node#628 for some middleware examples I guess. |
I tried using middleware to intercept the request but still auto import is happening in Java eclipse language server |
@GNSubrahmanyam What does your middleware code look like? Whenever you ask for help, you should always share your code if at all possible. |
@rcjsuen I did that resolveCompletionItem: (items, token, next) => { |
I'm surprised the language server hasn't died since you're sending nothing back. You don't want to talk to the server at all, right? Why are you calling |
@GNSubrahmanyam Then you need to keep debugging to see what's going on and/or reach out to the JDT Language Server team. |
@rcjsuen eclipse-jdtls/eclipse.jdt.ls#1505. In JDT language server no option to disable auto import |
Oh, that's too bad. |
Any alternative way to prevent via client middleware or server middleware. |
@GNSubrahmanyam Well, did you figure out where the auto-imports are coming from? |
@GNSubrahmanyam OK, did you try deleting them then? |
Will try. How can i modifiy the request from lsp backend? |
@GNSubrahmanyam You can just modify the result in your middleware, no? |
in middleware which method ? |
@rcjsuen did this and it is working import { has, get, map, omit, set} from "lodash";
import * as rpc from "vscode-ws-jsonrpc";
export const launch = (request: http.IncomingMessage, socket: rpc.IWebSocket) => {
if (rpc.isResponseMessage(message)) {
if (typeof message.result === 'object' && has(message.result, 'isIncomplete')) {
let items = map(get(message.result, 'items'), (item) => {
if (has(item, 'additionalTextEdits')) {
item = omit(item, 'additionalTextEdits')
return item;
}
return item;
})
set(message.result, 'items', items)
}
} |
@GNSubrahmanyam Thank you for sharing your solution! OK to close this? |
@rcjsuen Thanks :) |
@GNSubrahmanyam how did you connect the server side of In python i've done it by
How is it done in Java? |
Hey @Gilwe, did you get solution?
|
Their documentation is pretty exhaustive just run the provided command line instead of |
@rcjsuen In our use case we want to disable autoimport. How to stop sending completionItem/resolve
The text was updated successfully, but these errors were encountered: