![](/img/trans.png)
[英]Neovim setting up jdtls with lsp-zero/mason
作為即將到來的 2023 年新年的一部分,我想嘗試將我的開發環境遷移到 vim 或 neovim。 我已經完成了一些設置,並設置了 go 和 js/ts,看起來工作正常。 自動完成、linting 和導入管理。 試圖讓 lsp-zero 和 java 工作雖然結果是一場噩夢(因為當然 java 將 ...
[英]Neovim setting up jdtls with lsp-zero/mason
作為即將到來的 2023 年新年的一部分,我想嘗試將我的開發環境遷移到 vim 或 neovim。 我已經完成了一些設置,並設置了 go 和 js/ts,看起來工作正常。 自動完成、linting 和導入管理。 試圖讓 lsp-zero 和 java 工作雖然結果是一場噩夢(因為當然 java 將 ...
[英]How to discover all dependencies (aka. "imports") from an IType?
我正在使用 Eclipse JDT API 並且我有一個 IType。 我想發現這個 IType 的所有“依賴項”。 我認為這將是: 直接導入(導入語句) 以及方法簽名中的完整限定符使用以上來自超類型的信息我現在忽略運行時依賴項發現。 我的目標是為“從 class 文件間接引用”提供一個 Quic ...
[英]Configure enum constants on its own line using Eclipse Code Formatter
我將Spotless與 Gradle 一起使用。我已將其配置為使用 Eclipse 的 JDT 代碼格式化程序: eclipe_jdt_formatter.xml的內容就是:<?xml version="1.0" encoding="UTF-8" ?> <profiles ver ...
[英]jdt.core CodeFormatter - formatting blocks of comments
我正在使用 org.eclipse.jdt.core.formatter.CodeFormatter class。 我在正確格式化評論時遇到問題。 誰能告訴我應該使用 DefaultCodeFormatterConstants 中的哪些選項來正確格式化注釋塊? 我有這樣的情況: 我想將其格式化為 甚 ...
[英]How to find all occurrencces of String expressions directly compared to null?
作為特殊上下文中代碼質量工作的一部分,我們希望避免將字符串表達式直接與 null 進行比較。 有沒有辦法找到所有這樣的表達式(stringExp == null; stringExp;= null. and vv?)? ...
[英]Casting Class instance of an generic class using wildcards
我目前真的無法理解這里發生的事情。 我有以下(最小)代碼:public class SillyCast { interface B {} interface D<T extends B> {} class C<T extends D<?>> ...
[英]Unable to acquire application service when trying to execute JDTLS (Java language server) from command line
我一直在嘗試使JDTLS(java 語言服務器)與 nvim LSP 功能一起使用,但在解決了一些問題后,我遇到了日志文件中寫入的以下錯誤: 注意:在評論中發現了一個線索,它正在嘗試導入 org. E clipse.core.runtime 而不是全小寫版本。 正如日志建議的那樣,我檢查了./co ...
[英]JDK 17: Switch statement causes java.lang.VerifyError: Bad type on operand stack
剛剛在 Eclipse 2021-09 上嘗試了 JDK17 使其失敗並顯示java.lang.VerifyError ,這本身並不是很有幫助。 我將其追溯到一個 switch 語句,該語句從Map或其他泛型類型中提取出一個值。 如果我在 switch 語句中使用局部變量,則一切都按預期工作。 測 ...
[英]ASTVisitor class definition not found in Eclipse
我是 Eclipse 的新手,我正在嘗試使用 ASTVisitor class。 我已將 jar jdt.core文件添加到我引用的庫和其他所需的 jars 中。 我從C:\Users\nemo\.p2\pool\plugins文件夾中的 Eclipse 安裝的插件中添加了 jars。 我收到以下錯 ...
[英]Monaco client won't connect to Eclipse JDT server
我想將 Java Intellisense 添加到我的摩納哥客戶端。 為此,我將 Eclipse JDT 服務器與 Monaco 客戶端連接起來。 Monaco client link: https://github.com/TypeFox/monaco-languageclient Eclips ...
[英]Is there a way to color-code parentheses in Eclipse?
有沒有辦法在 Eclipse 中對匹配的括號進行顏色編碼? 我正在尋找一種在嵌套時使匹配的括號具有不同顏色的方法,類似於 Excel 的方式。 ...
[英]Issue setting Java Compliance level to newest JDK (16)
我昨天成功安裝並驗證了 JDK 16,但無法將 Compiler Compliance Level 設置為 16(來自 Preferences/Java/Compiler)。 15 就這么高了。 我今天確實安裝了新更新,但仍然無法達到 select 16 合規級別。 我正在使用帶有當前 Big ...
[英]select node type in eclipse.jdt.core AST for external object
如果我們從 class 創建一個 object 然后在編譯時調用它的方法並將其添加到 AST 樹中,我們應該使用什么樣的節點? 例如: new PasswordFormate().format(); 這個節點在 AST 中的類型是什么? AST 中該節點的子節點類型是什么? ...
[英]I'm having an issue with using ASTParser in eclipse
我正在嘗試在 eclipse 中使用 ASTParser,但面臨 NoClassDefFoundError。 我已經遵循了一些指南並導入了相關的 9 jars。 以下是詳細信息: } 包括 jars 錯誤報告命令行我應該如何讓代碼運行良好? ...
[英]ASTParser: Find Declaring Node after resolve Bindings
我創建了一個啟用了綁定的 AST,當我稍后解析綁定時,我得到了一個有效的 ITypeBinding。 但是,當我想獲取綁定的聲明節點時,它總是返回 null(除非在 sourceFile 中聲明了 ITypeBinding)。 這是我的 AST 生成代碼:public void parseFunct ...
[英]Resolve a type in a context
我有一個 Spring boot 項目,我想解析它並歸檔我使用 JavaSymbolSolver 找出類名的類之間的依賴關系 public static void main(String[] args) throws Exception { Set<Map<Strin ...
[英]Preserving type, field and method comment when rewriting a CompilationUnit
TL;DR:在基於給定類型創建新的 Java 類型時如何保留 Javadoc、行和塊注釋? 長: 我正在通過使用 JDT 的無頭 eclipse 應用程序將基於不需要的基類的無限數量的類型(Java 類)批量轉換為 Java 枚舉類型。 我的方法是根據類型信息創建一個新的EnumDeclara ...
[英]How to extract metadata from Java methods using AST?
是否有允許從 Java 方法中輕松提取元數據的 AST 工具? 例如,使用以下代碼片段 /* Checks if a target integer is present in the list of integers. */ public Boolean contains(Integer tar ...
[英]How to fix a workspace in Eclipse that does not open anymore (because of EGit)?
我的 Eclipse 工作區不再打開。 Eclipse 開始發射,然后..什么都沒有。 這是我的日志: 我幾周前安裝了 GitBash,但之前從未使用過它,除了配置我的用戶名和 GitHub 帳戶上使用的 email 地址。 我還沒有創建本地存儲庫。 我幾周前安裝了 Egit 插件,但沒有使用它 ...
[英]After updating from Eclipse 2020-06 to 2020-09, Java support is gone
我在 Eclipse 上為 Windows 10 上的 Java Developers 2020-06 使用 Java 進行開發,並決定運行安裝了 Eclipse 2020-09 的更新。 當 Eclipse 重新啟動時,我創建了一個新工作區。 當我打開Preferences ,不再有 Java 部 ...