-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
LSP features does not work in another directory #16085
Comments
@sergiuilie when you say it works in Theia proper, what is the procedure to test that? |
I build and run Theia browser example, in the plugins folder I attached our extension .vsix and I repeated the steps described above, open a document that doesn't stay on |
Do you "Open folder" and chose the "/projects" folder? One notable difference we have with vanilla Theia is that we have a fixed workspace root. How exactly do you open the file outside "/projects"? File->Open File menu? |
Not exactly, one of our extension which is available on marketplace Code4Z contains an application called Zowe which pulls a file from mainframe and save it under temporary folder which is one level above |
Sure, can you ping me on Eclipse mattermost to set up a meeting? I'm @tsmaeder |
Had that meeting, and it seems the file is being opened automatically after being downloaded. A quick look at some error messages seems to indicate that the being used in the completion request is correct and that the file being opened is present in the container running the language server. |
@sergiuilie you said you had a reproducer based on Java? |
Please let me know if you are able to reproduce it, I just tested it before posting |
Well, that's not really the same case: if you open |
So the question really is: how do you open the file at all? Do you copy it to both theia:/tmp and java:/tmp? What API do you use to display the downloaded file? |
@tsmaeder I don't think there was any change regarding exposure of folders to sidecars (eg. the |
Well it's not a regression in the sense that the /tmp folders are not intended to be shared between the containers. If that is what the problem really is. But I don't know what's going on, t.b.h. |
I don't think this issue is even related to sharing the folders. LSP protocol does not works this way. Only the LSP client part, which exists inside Theia, needs to access the file represented by URI. The file contents is provided to the LSP server via RPC (that is how the protocol is defined). The LSP server which resides in the mentioned sidecar does not need to have access to the analyzed file on filesystem. |
@tsmaeder I am opening the file inside Theia container but java LSP is running on another container, I will attach a gif to show that the |
Hmh...but in our meeting, we checked that the file was present in the container that runs the language server, not the IDE container. |
BTW: jdt.ls sends errors for files that have not been opened, so we can't really deduce the sending of correct "documentOpened"-events from that fact. |
that's true, is the same behavior, same error |
Ok, I see it now. Unfortunately, the production versions of Che don't have source map info, so it's not trivial to analyze. The way I'm reproducing it is like so:
|
@tsmaeder the API used to open the document by Zowe extension is vscode.window.showTextDocument or vscode.window.openTextDocument depends on the condition, please check it out here |
Ok, some time ago, we added code to support opening files that are present in plugin containers: https://github.com/eclipse/che-theia/blob/master/extensions/eclipse-che-theia-plugin-remote/src/node/che-content-aware-utils.ts Basically, we override the URI for anything outside the /projects directory with a container-specific prefix. However, this prefix is not used in all requests, only for "definition" requests, it seems. |
@tsmaeder understood, we are discussing this issue and see how is better to design our extension, one question: could you please let me know how I can debug che-theia? |
There is some doc in https://github.com/eclipse/che-theia/blob/master/CONTRIBUTING.md, but I'm not sure how up-to-date it is. Haven't had to debug lately. I think what your extension is doing is reasonable, we just didn't expect that case. |
Thank you 😄 |
Issues go stale after Mark the issue as fresh with If this issue is safe to close now please do so. Moderators: Add |
Describe the bug
Our product is an LSP server for COBOL language. Theia editor usually opens in
./projects
folder and our LSP features work normally, nothing new so far. The problem is when you open a file that is sitting in another directory located at top level from./projects
.Example: I have the following directories structure
bin boot dev entrypoint.sh etc home lib lib64 media mnt opt plugins proc projects root run sbin srv sys tmp usr var workspace_logs
if I will open the file under
.tmp
some of our features stop working. Please take a look at the following gif:This behavior is not present on Theia vanilla and it is reproducible for HLASM, COBOL, JAVA LSPs.
Can not reproduce it on
che-theia:7.3.3
.This error I am getting in the console log:
Che version
Steps to reproduce
Expected behavior
Runtime
kubectl version
)oc version
)minikube version v1.6.2
andchectl version chectl/0.0.20200214-next.75e7903 win32-x64 node-v10.19.0
)minishift version
andoc version
)docker version
andkubectl version
)Installation method
Environment
The text was updated successfully, but these errors were encountered: