vscode點(diǎn)擊ctrl鍵報(bào)錯(cuò)Request textDocument/definition failed.

現(xiàn)象

用vscode寫java代碼的時(shí)候突然出現(xiàn),修復(fù)問題點(diǎn)擊Ctrl時(shí),輸出窗口就打日志,報(bào)錯(cuò)Request textDocument/definition failed。
我百度唯一的有用線索就是這個(gè)報(bào)錯(cuò)有一個(gè)關(guān)于js的報(bào)錯(cuò)也是輸出的Request textDocument/definition failed。
有一個(gè)回答就是說"這是一個(gè)bug,等待解決"。Spring Boot Tools當(dāng)前的版本是1.8.0.我回退到1.7.0,成功了

錯(cuò)誤

[Error - 下午8:28:20] Request textDocument/definition failed.
Error: The received response has neither a result nor an error property.
    at handleInvalidMessage (C:\**省略*\.vscode\extensions\pivotal.vscode-spring-boot-1.8.0\node_modules\vscode-jsonrpc\lib\main.js:517:40)
    at processMessageQueue (C:\**省略*\.\.vscode\extensions\pivotal.vscode-spring-boot-1.8.0\node_modules\vscode-jsonrpc\lib\main.js:266:17)
    at Immediate.setImmediate (C:\**省略*\.0\.vscode\extensions\pivotal.vscode-spring-boot-1.8.0\node_modules\vscode-jsonrpc\lib\main.js:247:13)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)

解決方式

我嘗試回退Spring Boot Tools至1.7.0,問題解決了。
我再次升級(jí)版本值1.8.0問題浮現(xiàn)

更新日志

## 2019-06-21 (4.3.0 RELEASE)
*   *(Spring Boot)* improvement: project classpath notifications now happen in batch on startup to further optimize performance and job load on the Eclipse side
*   *(Spring Boot)* improvement: symbols are now being re-created if dependent types change
*   *(Spring Boot)* fixed: Slow code completion takes more than a 1 sec. ([#293](https://github.com/spring-projects/sts4/issues/293 "https://github.com/spring-projects/sts4/issues/293"))
*   *(Spring Boot)* fixed: content-assist for Spring XML config files now working again in VS Code and Theia
*   *(Spring Boot)* fixed: ClassCast Exception in Boot LS while application.yml file opened in the editor
*   *(Spring Boot)* fixed: Anonymous inner type beans don't have boot hints

## 2019-05-24 (4.2.2 RELEASE)

*   *(all language servers)* performance: additional improvements to language server startup time
*   *(Spring Boot)* new: additional fine-grained preferences for Spring XML config file support
*   *(Spring Boot)* new: navigation for bean identifiers, bean classes, and property names for Spring XML config files
*   *(Spring Boot)* new: content-assist rolled out for many more Spring XML config elements and attributes
*   *(Spring Boot)* new: live bean information now showing up in types from class files (when source code is shown) - *VSCode and Theia only at the moment*
*   *(Spring Boot)* improvement: hugely improved content-assist for bean class attribute in Spring XML config files (incl. package name proposals and vastly improved performance)
*   *(Spring Boot)* improvement: property name content-assist in Spring XML config files now shows proposals from properties defined in supertypes, too
*   *(Spring Boot)* improvement: symbol scanning skips output folders now

結(jié)語

對(duì)于官方的版本也出現(xiàn)這樣的bug,我覺得開源也不是良藥,有的時(shí)候會(huì)在生產(chǎn)和工作中帶來負(fù)面后果。穩(wěn)定反而更迫切!

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容