-
Notifications
You must be signed in to change notification settings - Fork 401
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
Find references only working in the current document. Not working. Across the project. #3280
Comments
Do references from across the project show if you set |
Thank you for responding your response. But I'm still seeing the same issue. I'm attaching the initialization response If it can provide more insights.
|
I just tried it out and it seems to be working for me. I used a basic request like : (formatted for readability) {
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"initializationOptions": {
"workspaceFolders": [
"file:///home/rgrunber/git/lemminx"
],
"settings": {
"java": {
"home": "/usr/lib/jvm/java-17-openjdk-17.0.12.0.7-2.fc40.x86_64/",
"autobuild": {
"enabled": true
}
}
},
"extendedClientCapabilities": {
"classFileContentsSupport": true
}
}
}
} for initialization and a request like : {
"jsonrpc": "2.0",
"id": 2,
"method": "textDocument/references",
"params": {
"textDocument": {
"uri": "file:///home/rgrunber/git/lemminx/org.eclipse.lemminx/src/main/java/org/eclipse/lemminx/utils/IOUtils.java"
},
"position": {
"line": 34,
"character": 27
},
"context": {
"includeDeclaration": true
}
}
} The only other thing I can think of is your offsets. When you pass a position (line/character) to the request, how are those determined ? Do you simply extract the line/character offsets from your client ? Note that the language server has 0-based line/char offsets so if your client reported lines starting from 1, you'd need to adjust that. |
I'm using the following command to start the server
` command = [
"x:\jdk-17_windows-x64_bin\jdk-17.0.2\bin\java.exe",
"-Declipse.application=org.eclipse.jdt.ls.core.id1",
"-Dosgi.bundles.defaultStartLevel=4",
"-Declipse.product=org.eclipse.jdt.ls.core.product",
"-Dosgi.checkConfiguration=true",
r"-Dosgi.sharedConfiguration.area=x:\eclipse.jdt.lsNew\org.eclipse.jdt.ls.product\target\repository\config_win",
"-Dosgi.sharedConfiguration.area.readOnly=true",
"-Dosgi.configuration.cascaded=true",
"-noverify",
"-Xms1G",
f"-Djava.util.logging.config.file={log_config}",
"-Dlog.level=ALL",
"-jar",
r"x:\eclipse.jdt.lsNew\org.eclipse.jdt.ls.product\target\repository\plugins\org.eclipse.equinox.launcher_1.6.900.v20240613-2009.jar",
"-configuration",
r"x:\eclipse.jdt.lsNew\org.eclipse.jdt.ls.product\target\repository\config_win",
"-data",
path
]
def initialize(self):
params = {
"processId": None,
"rootUri": self.root_uri,
"capabilities": { "references": { "dynamicRegistration": True } }
}
return self.client.send_request_and_wait_for_response("initialize", params)
`
However, when I run the project In Eclipse, PDE debugging mode on jdt.ls.socket-stream.launch,
I am able to see all references across the project.
The text was updated successfully, but these errors were encountered: