Skip to content
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

Error on document close, after renaming a file #993

Closed
fbricon opened this issue Apr 15, 2019 · 1 comment · Fixed by #1033
Closed

Error on document close, after renaming a file #993

fbricon opened this issue Apr 15, 2019 · 1 comment · Fixed by #1033
Assignees
Labels
Milestone

Comments

@fbricon
Copy link
Contributor

fbricon commented Apr 15, 2019

In vscode 1.32.3 (1.33 has the same problem but has issues of its own), after renaming a type, when you save the file (which has been renamed) the server throws an exception in JDTLanguageServer.didClose:

[Trace - 9:57:49 AM] Sending request 'textDocument/rename - (12)'.
Params: {
    "textDocument": {
        "uri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java"
    },
    "position": {
        "line": 5,
        "character": 14
    },
    "newName": "Fooo"
}


[Trace - 9:57:49 AM] Received response 'textDocument/rename - (12)' in 194ms.
Result: {
    "changes": {},
    "documentChanges": [
        {
            "textDocument": {
                "version": 0,
                "uri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java"
            },
            "edits": [
                {
                    "range": {
                        "start": {
                            "line": 5,
                            "character": 13
                        },
                        "end": {
                            "line": 5,
                            "character": 16
                        }
                    },
                    "newText": "Fooo"
                }
            ]
        },
        {
            "oldUri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java",
            "newUri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Fooo.java",
            "kind": "rename"
        }
    ]
}


[Trace - 9:57:49 AM] Sending notification 'textDocument/didChange'.
Params: {
    "textDocument": {
        "uri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java",
        "version": 2
    },
    "contentChanges": [
        {
            "range": {
                "start": {
                    "line": 5,
                    "character": 13
                },
                "end": {
                    "line": 5,
                    "character": 16
                }
            },
            "rangeLength": 3,
            "text": "Fooo"
        }
    ]
}


[Trace - 9:57:49 AM] Sending notification 'textDocument/didClose'.
Params: {
    "textDocument": {
        "uri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java"
    }
}


[Trace - 9:57:49 AM] Received notification 'window/logMessage'.
Params: {
    "type": 1,
    "message": "Apr. 15, 2019, 9:57:49 a.m. Error while handling document close. URI: file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java\nFile not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.\nJava Model Exception: Core Exception [code 368] File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java....

[Error - 9:57:49 AM] Apr. 15, 2019, 9:57:49 a.m. Error while handling document close. URI: file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java
File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.
Java Model Exception: Core Exception [code 368] File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1209)
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1181)
	at org.eclipse.jdt.internal.core.CompilationUnit.openBuffer(CompilationUnit.java:1215)
	at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:115)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:268)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:596)
	at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:43)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:99)
	at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:106)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.handleClosed(DocumentLifeCycleHandler.java:392)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler$3.run(DocumentLifeCycleHandler.java:200)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.didClose(DocumentLifeCycleHandler.java:197)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.didClose(JDTLanguageServer.java:693)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$0(ParentProcessWatcher.java:83)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: org.eclipse.core.internal.resources.ResourceException: File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:833)
	at org.eclipse.core.internal.resources.File.getContents(File.java:280)
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1207)
	... 33 more
Caused by: java.lang.Exception: File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.
	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
	... 36 more
Caused by: org.eclipse.core.internal.resources.ResourceException(/getting-quarked/src/main/java/org/acme/quickstart/Bar.java)[368]: java.lang.Exception: File not found: /Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Bar.java.
	at org.eclipse.core.internal.resources.ResourceException.provideStackTrace(ResourceException.java:42)
	at org.eclipse.core.internal.resources.ResourceException.<init>(ResourceException.java:38)
	at org.eclipse.core.internal.localstore.FileSystemResourceManager.read(FileSystemResourceManager.java:833)
	at org.eclipse.core.internal.resources.File.getContents(File.java:280)
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1207)
	at org.eclipse.jdt.internal.core.util.Util.getResourceContentsAsCharArray(Util.java:1181)
	at org.eclipse.jdt.internal.core.CompilationUnit.openBuffer(CompilationUnit.java:1215)
	at org.eclipse.jdt.internal.core.CompilationUnit.buildStructure(CompilationUnit.java:115)
	at org.eclipse.jdt.internal.core.Openable.generateInfos(Openable.java:268)
	at org.eclipse.jdt.internal.core.JavaElement.openWhenClosed(JavaElement.java:596)
	at org.eclipse.jdt.internal.core.BecomeWorkingCopyOperation.executeOperation(BecomeWorkingCopyOperation.java:43)
	at org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:736)
	at org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:802)
	at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:99)
	at org.eclipse.jdt.internal.core.CompilationUnit.becomeWorkingCopy(CompilationUnit.java:106)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.handleClosed(DocumentLifeCycleHandler.java:392)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler$3.run(DocumentLifeCycleHandler.java:200)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2295)
	at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
	at org.eclipse.jdt.ls.core.internal.handlers.DocumentLifeCycleHandler.didClose(DocumentLifeCycleHandler.java:197)
	at org.eclipse.jdt.ls.core.internal.handlers.JDTLanguageServer.didClose(JDTLanguageServer.java:693)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.lambda$null$0(GenericEndpoint.java:65)
	at org.eclipse.lsp4j.jsonrpc.services.GenericEndpoint.notify(GenericEndpoint.java:152)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.handleNotification(RemoteEndpoint.java:220)
	at org.eclipse.lsp4j.jsonrpc.RemoteEndpoint.consume(RemoteEndpoint.java:187)
	at org.eclipse.jdt.ls.core.internal.ParentProcessWatcher.lambda$0(ParentProcessWatcher.java:83)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.handleMessage(StreamMessageProducer.java:192)
	at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:94)
	at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:99)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

[Trace - 9:57:49 AM] Sending notification 'textDocument/didOpen'.
Params: {
    "textDocument": {
        "uri": "file:///Users/fbricon/Dev/souk/getting-quarked/src/main/java/org/acme/quickstart/Fooo.java",
        "languageId": "java",
        "version": 1,
        "text": "package org.acme.quickstart;\n\n/**\n * Foo\n */\npublic class Fooo {\n\n    \n}"
    }
}

}
@fbricon fbricon added the bug label Apr 15, 2019
@fbricon
Copy link
Contributor Author

fbricon commented Apr 15, 2019

@snjeza I could reproduce this issue with vscode-java 0.35.0, so it not a new problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants