gaograce / java-editor

A simple java editor
2 stars 3 forks source link

为什么错误代码没有像你截图的那样标红 #1

Open Jean-Jacques-Nuoan opened 2 years ago

Jean-Jacques-Nuoan commented 2 years ago

image

gaograce commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。 很高兴收到您的邮件,现在我无法回复,我将尽快给您回信。申し訳ございません。

gaograce commented 2 years ago

你启动language server了吗?你确定连接到language server了吗?

Jean-Jacques-Nuoan commented 2 years ago

image 这个是截图

Jean-Jacques-Nuoan commented 2 years ago

image 是有提示的,但是没有代码检查

gaograce commented 2 years ago
Jean-Jacques-Nuoan commented 2 years ago

{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":null,"clientInfo":{"name":"Monaco"},"locale":"zh-CN","rootPath":null,"rootUri":null,"capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"callHierarchy":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"trace":"off","workspaceFolders":null}}

gaograce commented 2 years ago

截屏2022-07-12 15 15 31

Jean-Jacques-Nuoan commented 2 years ago

image 这个是初始化发的请求

Jean-Jacques-Nuoan commented 2 years ago

image 跟这个有关系么

gaograce commented 2 years ago

这个包咱们俩下载的一样啊

gaograce commented 2 years ago

jdt-language-server-1.10.0-202203040350.tar.gz

Jean-Jacques-Nuoan commented 2 years ago

我的node是12.19的

Jean-Jacques-Nuoan commented 2 years ago

image 我只改了electron的版本

gaograce commented 2 years ago

node 14.16.0

gaograce commented 2 years ago

java version 16

Jean-Jacques-Nuoan commented 2 years ago

跟java还有关系么

gaograce commented 2 years ago

不知道啊,提供个思路,我看jdt支持java1.5到16,默认里面功能就支持语法错误的检查,如果你实在是不好用,我建议你可以去jdt提个issue看看

gaograce commented 2 years ago

这个是我的server的log,你也可以看看你的少了什么。 `/java-lsp Receive:{"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":null,"clientInfo":{"name":"Monaco"},"locale":"zh-CN","rootPath":null,"rootUri":null,"capabilities":{"workspace":{"applyEit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"callHierarchy":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}}},"trace":"off","workspaceFolders":null}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Main thread is waiting"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 \u003e\u003e initialize"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Initializing Java Language Server 1.10.0.202203040350"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 No workspace folders or root uri was defined. Falling back on /Documents/wace/java-languageserver/workspace"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Static Commands: []"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Non-Static Commands: [java.edit.organizeImports, java.project.refreshDiagnostics, java.proimport, java.navigate.openTypeHierarchy, java.project.removeFromSourcePath, java.project.listSourcePaths, java.project.resolveStackTraceLocation, java.project.getAll, java.project.isTestFile, java.project.getClasspaths, java.navigate.resolveTypeHierarchy, java.edit.stringFormatting, java.project.getSettings, java.project.updateSourceAttachment, java.project.upgradeGradle, java.project.resolveSourceAttachment, java.project.addToSourcePath]"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Starting org.eclipse.m2e.core"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Started org.eclipse.m2e.core 1ms"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 ProjectRegistryRefreshJob finished 14ms"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Starting org.eclipse.buildship.core"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 Started org.eclipse.buildship.core 36ms"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 LoadingGradleVersionJob finished 22ms"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Starting","message":"Init..."}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Starting","message":"0% Starting Java Language Server"}} Send: {"jsonrpc":"2.0","id":0,"result":{"capabilities":{"textDocumentSync":{"openClose":true,"change":2,"willSave":true,"willSaveWaitUntil":true,"save":{"includeText":true}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}},"callHierarchyProvider":true,"selectionRangeProvider":true,"semanticTokensProvider":{"legend":{"tokenTypes":["namespace","class","interface","enum","enumMember","type","typeParameter","method","property","variable","parameter","modifier","keyword","annotation","annotationMember","record","recordComponent"],"tokenModifiers":["abstract","static","readonly","deprecated","declaration","documentation","public","private","protected","native","generic","typeArgument","importDeclaration","constructor"]},"range":false,"full":{"delta":false},"documentSelector":[{"language":"java","scheme":"file"},{"language":"java","scheme":"jdt"}]}}}} Receive:{"jsonrpc":"2.0","method":"initialized","params":{}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:36 \u003e\u003e initialized"}} Receive:{"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java","languageId":"java","version":1,"tet":""}}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Starting","message":"30% Starting Java Language Server"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"ProjectStatus","message":"OK"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Starting","message":"100% Starting Java Language Server"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 Workspace initialized in 521ms"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Started","message":"Ready"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"Starting","message":"100% Starting Java Language Server"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e initialization job finished"}} Send: {"jsonrpc":"2.0","id":"1","method":"client/registerCapability","params":{"registrations":[{"id":"b1a2b0ed-7b6d-443f-8a89-3b091840ad33","method":"textDocument/completion","registerOptions":{"resolveProvider":true,"triggerCharacters":[".","@","#","*"," "]}}]}} Send: {"jsonrpc":"2.0","id":"2","method":"client/registerCapability","params":{"registrations":[{"id":"8891868a-d510-4f5e-b855-2dd6f63e6e1a","method":"workspace/symbol"}]}} Send: {"jsonrpc":"2.0","id":"3","method":"client/registerCapability","params":{"registrations":[{"id":"2e853509-a09b-4fd5-ab55-06795583eedb","method":"textDocument/documentSymbol"}]}} Send: {"jsonrpc":"2.0","id":"4","method":"client/registerCapability","params":{"registrations":[{"id":"1d0f3747-16ed-41db-9294-b889697e6a4e","method":"textDocument/codeAction","registerOptions":{"codeActionKinds":["quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"],"resolveProvider":true}}]}} Send: {"jsonrpc":"2.0","id":"5","method":"client/registerCapability","params":{"registrations":[{"id":"d588928a-602d-404c-bb49-de319f162d7f","method":"textDocument/definition"}]}} Send: {"jsonrpc":"2.0","id":"6","method":"client/registerCapability","params":{"registrations":[{"id":"b6267343-48f4-4275-994b-43274ece5ea9","method":"textDocument/typeDefinition"}]}} Send: {"jsonrpc":"2.0","id":"7","method":"client/registerCapability","params":{"registrations":[{"id":"1b74f063-622e-47de-8955-382b9a7cc973","method":"textDocument/hover"}]}} Send: {"jsonrpc":"2.0","id":"8","method":"client/registerCapability","params":{"registrations":[{"id":"aac6f502-e482-49a4-abb5-4449325cc121","method":"textDocument/references"}]}} Send: {"jsonrpc":"2.0","id":"9","method":"client/registerCapability","params":{"registrations":[{"id":"76120da3-d32c-4dbc-b8c4-300be97fc5eb","method":"textDocument/documentHighlight"}]}} Send: {"jsonrpc":"2.0","id":"10","method":"client/registerCapability","params":{"registrations":[{"id":"b7cd67c5-7977-4e34-aa54-e44aea20b727","method":"textDocument/foldingRange"}]}} Send: {"jsonrpc":"2.0","id":"11","method":"client/registerCapability","params":{"registrations":[{"id":"74c337d2-4b1e-4718-b0bf-5316d7b206d8","method":"workspace/didChangeWorkspaceFolders"}]}} Send: {"jsonrpc":"2.0","id":"12","method":"client/registerCapability","params":{"registrations":[{"id":"fca93a21-0cdf-455b-8402-82c83f5ed7f7","method":"textDocument/implementation"}]}} Send: {"jsonrpc":"2.0","id":"13","method":"client/registerCapability","params":{"registrations":[{"id":"83fea131-0ad8-498f-a17f-2e842c0d5d65","method":"textDocument/formatting"}]}} Send: {"jsonrpc":"2.0","id":"14","method":"client/registerCapability","params":{"registrations":[{"id":"8d665ba5-4e9f-4216-8214-caaed852453c","method":"textDocument/rangeFormatting"}]}} Send: {"jsonrpc":"2.0","id":"15","method":"client/registerCapability","params":{"registrations":[{"id":"31fcd02a-6d29-47f0-8aa8-1b53c0056e88","method":"textDocument/codeLens","registerOptions":{"resolveProvider":true}}]}} Receive:{"jsonrpc":"2.0","id":"1","result":null} Receive:{"jsonrpc":"2.0","id":"2","result":null} Receive:{"jsonrpc":"2.0","id":"3","result":null} Receive:{"jsonrpc":"2.0","id":"4","result":null} Receive:{"jsonrpc":"2.0","id":"5","result":null} Receive:{"jsonrpc":"2.0","id":"6","result":null} Send: {"jsonrpc":"2.0","id":"16","method":"client/registerCapability","params":{"registrations":[{"id":"b17098f6-5721-4f61-85ac-3c8cbe492a9b","method":"textDocument/rename","registerOptions":{"prepareProvider":true}}]}} Send: {"jsonrpc":"2.0","id":"17","method":"client/registerCapability","params":{"registrations":[{"id":"d4dcfb80-0392-4a5a-a69c-02c288cd48e6","method":"workspace/executeCommand","registerOptions":{"commands":["java.edit.organizeImports","java.project.refreshDiagnostics","java.project.import","java.navigate.openTypeHierarchy","java.project.removeFromSourcePath","java.project.listSourcePaths","java.project.resolveStackTraceLocation","java.project.getAll","java.project.isTestFile","java.project.getClasspaths","java.navigate.resolveTypeHierarchy","java.edit.stringFormatting","java.project.getSettings","java.project.updateSourceAttachment","java.project.upgradeGradle","java.project.resolveSourceAttachment","java.project.addToSourcePath"]}}]}} Receive:{"jsonrpc":"2.0","id":"7","result":null} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e document/didOpen"}} Receive:{"jsonrpc":"2.0","id":"8","result":null} Receive:{"jsonrpc":"2.0","id":"9","result":null} Receive:{"jsonrpc":"2.0","id":"10","result":null} Receive:{"jsonrpc":"2.0","id":"11","result":null} Receive:{"jsonrpc":"2.0","id":"12","result":null} Receive:{"jsonrpc":"2.0","id":"13","result":null} Receive:{"jsonrpc":"2.0","id":"14","result":null} Receive:{"jsonrpc":"2.0","id":"15","result":null} Receive:{"jsonrpc":"2.0","id":"16","result":null} Receive:{"jsonrpc":"2.0","id":"17","result":null} Receive:{"jsonrpc":"2.0","id":1,"method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Receive:{"jsonrpc":"2.0","id":2,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e document/foldingRange"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e document/codeLens"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 Reconciled 1. Took 0 ms"}} Send: {"jsonrpc":"2.0","id":2,"result":[]} Send: {"jsonrpc":"2.0","id":1,"result":[]} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 begin problem for /Test.java"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 1 problems reported for /Test.java"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":1,"message":"2022年7月12日下午3:45:37 Offset \u003e length: 1 \u003e 0\nOffset \u003e length: 1 \u003e 0\norg.eclipse.jface.textocationException: Offset \u003e length: 1 \u003e 0\n\tat org.eclipse.jface.text.ListLineTracker.getLineNumberOfOffset(ListLineTracker.java:141)\n\tat org.eclipse.jface.text.AbstractLineTracker.getLineNumberOfOffset(AbstractLineTracker.java:155)\n\tat org.eclipse.jface.text.AbstractDocument.getLineOfOffset(AbstractDocument.java:872)\n\tat org.eclipse.core.internal.filebuffers.SynchronizableDocument.getLineOfOffset(SynchronizableDocument.java:334)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:156)\n\tat org.eclipse.jdt.ls.core.internal.handlers.JsonRpcHelpers.toLine(JsonRpcHelpers.java:101)\n\tat org.eclipse.jdt.ls.core.internal.JDTUtils.toRange(JDTUtils.java:858)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDiagnosticsHandler.convertRange(BaseDiagnosticsHandler.java:246)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDiagnosticsHandler.toDiagnosticsArray(BaseDiagnosticsHandler.java:152)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDiagnosticsHandler.endReporting(BaseDiagnosticsHandler.java:130)\n\tat org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.reportProblems(ReconcileWorkingCopyOperation.java:148)\n\tat org.eclipse.jdt.internal.core.ReconcileWorkingCopyOperation.executeOperation(ReconcileWorkingCopyOperation.java:112)\n\tat org.eclipse.jdt.internal.core.JavaModelOperation.run(JavaModelOperation.java:740)\n\tat org.eclipse.jdt.internal.core.JavaModelOperation.runOperation(JavaModelOperation.java:806)\n\tat org.eclipse.jdt.internal.core.CompilationUnit.reconcile(CompilationUnit.java:1319)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:285)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler.publishDiagnostics(BaseDocumentLifeCycleHandler.java:249)\n\tat org.eclipse.jdt.ls.core.internal.handlers.BaseDocumentLifeCycleHandler$2.runInWorkspace(BaseDocumentLifeCycleHandler.java:117)\n\tat org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:42)\n\tat org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)\n"}} Send: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///data/java-server/workspace/test/src/Test.java","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"severity":2,"code":"16","source":"Java","message":"Test.java is a non-project file, only syntax errors are reported"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 Validated 1. Took 25 ms"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e build jobs finished"}} Send: {"jsonrpc":"2.0","method":"language/status","params":{"type":"ServiceReady","message":"ServiceReady"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e registerWatchers\u0027"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e registerFeature \u0027workspace/didChangeWatchedFiles\u0027"}} Send: {"jsonrpc":"2.0","id":"18","method":"client/registerCapability","params":{"registrations":[{"id":"6a19db2b-a179-4a17-82a0-d7e654295dee","method":"workspace/didChangeWatchedFiles","registerOptions":{"watchers":[{"globPattern":"/*.java"},{"globPattern":"/.project"},{"globPattern":"/.classpath"},{"globPattern":"*/.settings/.prefs"},{"globPattern":"/src/"},{"globPattern":"/*.gradle"},{"globPattern":"*/.gradle.kts"},{"globPattern":"/gradle.properties"},{"globPattern":"/pom.xml"},{"globPattern":"/Documents/workspace/java-languageserver/workspace/jdt.ls-java-project","kind":4}]}}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:37 \u003e\u003e watchers registered"}} Receive:{"jsonrpc":"2.0","id":"18","result":null} Receive:{"jsonrpc":"2.0","id":3,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:39 \u003e\u003e document/codeLens"}} Send: {"jsonrpc":"2.0","id":3,"result":[]} Receive:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java","version":2},"contentChanges":[{"ange":{"start":{"line":0,"character":0},"end":{"line":0,"character":0}},"rangeLength":0,"text":"i"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/didChange"}} Receive:{"jsonrpc":"2.0","id":4,"method":"textDocument/completion","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"position":{"line":0,"chracter":1},"context":{"triggerKind":1}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/completion"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 Reconciled 1. Took 5 ms"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 Completion request completed"}} Send: {"jsonrpc":"2.0","id":4,"result":{"isIncomplete":false,"items":[{"label":"import","kind":14,"sortText":"999999213","insertTextFormat":2,"textEdit":{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"newText":"import"},"data":{"pid":"0","rid":"0","uri":"file:///data/java-server/workspace/test/src/Test.java"}},{"label":"interface","kind":14,"sortText":"999999213","insertTextFormat":2,"textEdit":{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"newText":"interface"},"data":{"pid":"1","rid":"0","uri":"file:///data/java-server/workspace/test/src/Test.java"}},{"label":"interface","kind":15,"documentation":{"kind":"markdown","value":"java\n/**\n * Test\n */\npublic interface Test {\n\n\t\n}\n"},"sortText":"999999999","filterText":"interface","insertText":"/*\n Test\n */\npublic interface Test {\n\n\t${0}\n}","insertTextFormat":2}]}} Receive:{"jsonrpc":"2.0","id":5,"method":"completionItem/resolve","params":{"label":"import","insertTextFormat":1,"textEdit":{"newText":"import","range":{"start":{"line":0,"character":0},"end":{"lne":0,"character":1}}},"kind":14,"sortText":"999999213","data":{"pid":"0","rid":"0","uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/resolveCompletionItem"}} Send: {"jsonrpc":"2.0","id":5,"result":{"label":"import","kind":14,"sortText":"999999213","insertTextFormat":1,"textEdit":{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"newText":"import"}}} Receive:{"jsonrpc":"2.0","id":6,"method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/foldingRange"}} Send: {"jsonrpc":"2.0","id":6,"result":[]} Receive:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java","version":3},"contentChanges":[{"ange":{"start":{"line":0,"character":1},"end":{"line":0,"character":1}},"rangeLength":0,"text":"m"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/didChange"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 Reconciled 1. Took 2 ms"}} Receive:{"jsonrpc":"2.0","id":7,"method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/foldingRange"}} Send: {"jsonrpc":"2.0","id":7,"result":[]} Receive:{"jsonrpc":"2.0","id":8,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/codeLens"}} Receive:{"jsonrpc":"2.0","id":9,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"range":{"start":{"line"0,"character":2},"end":{"line":0,"character":2}},"context":{"diagnostics":[]}}} Send: {"jsonrpc":"2.0","id":8,"result":[]} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:40 \u003e\u003e document/codeAction"}} Send: {"jsonrpc":"2.0","id":"19","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.tabSize"},{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.insertSpaces"}]}} Receive:{"jsonrpc":"2.0","id":"19","result":[null,null]} Send: {"jsonrpc":"2.0","id":9,"result":[{"title":"Organize imports","kind":"source.organizeImports","diagnostics":[],"data":{"pid":"0","rid":"0"}}]} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 begin problem for /Test.java"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 2 problems reported for /Test.java"}} Send: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///data/java-server/workspace/test/src/Test.java","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"severity":2,"code":"16","source":"Java","message":"Test.java is a non-project file, only syntax errors are reported"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":2}},"severity":1,"code":"1610612968","source":"Java","message":"Syntax error on token \"im\", delete this token"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 Validated 1. Took 12 ms"}} Receive:{"jsonrpc":"2.0","id":10,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"range":{"start":{"line:0,"character":2},"end":{"line":0,"character":2}},"context":{"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":2}},"message":"Syntax error on token \"im\", delete this token","severity":1,"code":"1610612968","source":"Java"}]}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 \u003e\u003e document/codeAction"}} Send: {"jsonrpc":"2.0","id":"20","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.tabSize"},{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.insertSpaces"}]}} Receive:{"jsonrpc":"2.0","id":"20","result":[null,null]} Send: {"jsonrpc":"2.0","id":10,"result":[{"title":"Organize imports","kind":"source.organizeImports","diagnostics":[],"data":{"pid":"0","rid":"1"}}]} Receive:{"jsonrpc":"2.0","method":"textDocument/didChange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java","version":4},"contentChanges":[{"ange":{"start":{"line":0,"character":0},"end":{"line":0,"character":2}},"rangeLength":2,"text":"import"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 \u003e\u003e document/didChange"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 Reconciled 1. Took 1 ms"}} Receive:{"jsonrpc":"2.0","id":11,"method":"textDocument/foldingRange","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 \u003e\u003e document/foldingRange"}} Send: {"jsonrpc":"2.0","id":11,"result":[]} Receive:{"jsonrpc":"2.0","id":12,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"}}} Receive:{"jsonrpc":"2.0","id":13,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"range":{"start":{"line:0,"character":6},"end":{"line":0,"character":6}},"context":{"diagnostics":[]}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 \u003e\u003e document/codeLens"}} Send: {"jsonrpc":"2.0","id":12,"result":[]} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 \u003e\u003e document/codeAction"}} Send: {"jsonrpc":"2.0","id":"21","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.tabSize"},{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.insertSpaces"}]}} Receive:{"jsonrpc":"2.0","id":"21","result":[null,null]} Send: {"jsonrpc":"2.0","id":13,"result":[{"title":"Organize imports","kind":"source.organizeImports","diagnostics":[],"data":{"pid":"0","rid":"2"}}]} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 begin problem for /Test.java"}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 2 problems reported for /Test.java"}} Send: {"jsonrpc":"2.0","method":"textDocument/publishDiagnostics","params":{"uri":"file:///data/java-server/workspace/test/src/Test.java","diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"severity":2,"code":"16","source":"Java","message":"Test.java is a non-project file, only syntax errors are reported"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":6}},"severity":1,"code":"1610612968","source":"Java","message":"Syntax error on token \"import\", delete this token"}]}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:41 Validated 1. Took 10 ms"}} Receive:{"jsonrpc":"2.0","id":14,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"range":{"start":{"line:0,"character":6},"end":{"line":0,"character":6}},"context":{"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":6}},"message":"Syntax error on token \"import\", delete this token","severity":1,"code":"1610612968","source":"Java"}]}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:42 \u003e\u003e document/codeAction"}} Send: {"jsonrpc":"2.0","id":"22","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.tabSize"},{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.insertSpaces"}]}} Receive:{"jsonrpc":"2.0","id":"22","result":[null,null]} Send: {"jsonrpc":"2.0","id":14,"result":[{"title":"Organize imports","kind":"source.organizeImports","diagnostics":[],"data":{"pid":"0","rid":"3"}}]} Receive:{"jsonrpc":"2.0","id":15,"method":"textDocument/hover","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"position":{"line":0,"characer":5}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:45 \u003e\u003e document/hover"}} Send: {"jsonrpc":"2.0","id":15,"result":{"contents":""}} Receive:{"jsonrpc":"2.0","id":16,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///data/java-server/workspace/test/src/Test.java"},"range":{"start":{"line:0,"character":0},"end":{"line":0,"character":6}},"context":{"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":1}},"message":"Test.java is a non-project file, only syntax errors are reported","severity":2,"code":"16","source":"Java"},{"range":{"start":{"line":0,"character":0},"end":{"line":0,"character":6}},"message":"Syntax error on token \"import\", delete this token","severity":1,"code":"1610612968","source":"Java"}],"only":["quickfix"]}}} Send: {"jsonrpc":"2.0","method":"window/logMessage","params":{"type":3,"message":"2022年7月12日下午3:45:45 \u003e\u003e document/codeAction"}} Send: {"jsonrpc":"2.0","id":"23","method":"workspace/configuration","params":{"items":[{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.tabSize"},{"scopeUri":"file:///data/java-server/workspace/test/src/Test.java","section":"java.format.insertSpaces"}]}} Receive:{"jsonrpc":"2.0","id":"23","result":[null,null]} Send: {"jsonrpc":"2.0","id":16,"result":[{"title":"Report compilation errors for this file","kind":"quickfix","diagnostics":[],"command":{"title":"Report compilation errors for this file","command":"java.project.refreshDiagnostics","arguments":["file:///data/java-server/workspace/test/src/Test.java","thisFile",false]}},{"title":"Report compilation errors for any non-project file in the current session","kind":"quickfix","diagnostics":[],"command":{"title":"Report compilation errors for any non-project file in the current session","command":"java.project.refreshDiagnostics","arguments":["file:///data/java-server/workspace/test/src/Test.java","anyNonProjectFile",false]}}]}

`

gaograce commented 2 years ago

├── monaco-editor@0.30.1 ├─┬ monaco-editor-webpack-plugin@6.0.0 ├─┬ monaco-languageclient@0.18.1

Jean-Jacques-Nuoan commented 2 years ago

image 跟这个有关系么

Jean-Jacques-Nuoan commented 2 years ago

是不是这里参数不一样

Jean-Jacques-Nuoan commented 2 years ago

image

gaograce commented 2 years ago

image 你改参数了?我直接启动的language server,用的参数就是上面那个

gaograce commented 2 years ago

我觉得可能是monaco-editor的问题,它没有显示,也可能是language-server的问题,其他的问题可能性比较小吧

gaograce commented 2 years ago

image 跟这个有关系么

这个看起来有错误啊

gaograce commented 2 years ago

你可以试试换个前端试试,测试一下是不是前端的问题,比如使用其他的编辑器,或者不用electron,用网页monaco试试

Jean-Jacques-Nuoan commented 2 years ago

我截图的这个就是仓库里面的

Jean-Jacques-Nuoan commented 2 years ago

image 感觉是Monaco没有发送消息呢

Jean-Jacques-Nuoan commented 2 years ago

我这边是有一条初始化的消息

Jean-Jacques-Nuoan commented 2 years ago

image 我比对了下初始化消息,只有applyEdit这儿不一样

gaograce commented 2 years ago

你可以看看lsp的规定: https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/

gaograce commented 2 years ago

这里具体介绍了每个消息的意思,applyEdit好像还挺重要的

Jean-Jacques-Nuoan commented 2 years ago

有拼写错误的那个是你发的消息

gaograce commented 2 years ago

你的意思是我的是applyEdit:false?

Jean-Jacques-Nuoan commented 2 years ago

可能吧,但我不知道这个可以在哪儿配置

gaograce commented 2 years ago

你的java文件哪来的?你自己创建一个java文件试试?

Jean-Jacques-Nuoan commented 2 years ago

你有配置workspace么

gaograce commented 2 years ago

你有配置workspace么

没有

Jean-Jacques-Nuoan commented 2 years ago

能给个联系方式么

Jean-Jacques-Nuoan commented 2 years ago

image 破案了,java版本的问题。。。。

Jean-Jacques-Nuoan commented 2 years ago

image image

gaograce commented 2 years ago

解决了就好

Jean-Jacques-Nuoan commented 2 years ago

问下,如果网页端访问,也要使用文件的uri方式么

gaograce commented 2 years ago

网页访问的话,你可能要在server端的服务器上存一个对应的文件,我试过如果server找不到文件的话会报错

Jean-Jacques-Nuoan commented 2 years ago

嗯是的,我从这个issue里面找到解决办法了,再次感谢 https://github.com/TypeFox/monaco-languageclient/issues/299

gaograce commented 2 years ago

这是来自QQ邮箱的假期自动回复邮件。 很高兴收到您的邮件,现在我无法回复,我将尽快给您回信。申し訳ございません。

NightMingGit commented 1 year ago

嗯是的,我从这个issue里面找到解决办法了,再次感谢 TypeFox/monaco-languageclient#299

你好请问你用的语言服务版本号是多少

gaograce commented 1 year ago

这是来自QQ邮箱的假期自动回复邮件。 很高兴收到您的邮件,现在我无法回复,我将尽快给您回信。申し訳ございません。

Jean-Jacques-Nuoan commented 1 year ago

嗯是的,我从这个issue里面找到解决办法了,再次感谢 TypeFox/monaco-languageclient#299

你好请问你用的语言服务版本号是多少

要跟java版本一致 jdt-language-server-1.8.0-202201261434.tar.gz

rick-chou commented 1 year ago

@gaograce 你好 请问你有遇到过这个报错吗 demo