mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-08 08:52:12 +00:00
fix(php): document language constructs and clarify rename failures (#354)
PHP language constructs such as empty and isset had no completion documentation, hover or quick documentation because the language server reports them as plain keywords. They now get built-in documentation in completion, hover, quick documentation and Go to Declaration (which shows the docs instead of failing), without matching strings, comments, methods or other languages. A refused syntax-based rename now states why the language server couldn't rename first. Closes #340 Refs #221
This commit is contained in:
1 parent
bc70ec7028
commit
b2c183dbd4
10 files changed
+195
-10
No files matched your search
@@ -350,6 +350,24 @@ describe("navigation wiring", () => {
|
||||
});
|
||||
|
||||
describe("rename wiring", () => {
|
||||
it("preserves the server's missing capability when syntax cannot rename a method", async () => {
|
||||
cmd.lspPrepareRename.mockReturnValueOnce(
|
||||
Promise.resolve({
|
||||
status: "error",
|
||||
error: { kind: "unavailable", message: "intelephense doesn't support rename" },
|
||||
}),
|
||||
);
|
||||
cmd.syntaxLocals.mockReturnValueOnce(ok({ status: "notLocal", name: "run", range: r(0, 4, 7), reason: "member" }));
|
||||
const view = editor("obj.run();", "php", 5);
|
||||
await startRename(view);
|
||||
const message = document.querySelector(".cm-lsp-hint")?.textContent;
|
||||
expect(message).toContain("intelephense doesn't support rename");
|
||||
expect(message).toContain("only local variables");
|
||||
expect(message).not.toContain("without the language server");
|
||||
expect(view.state.doc.toString()).toBe("obj.run();");
|
||||
expect(useLspPopup.getState().popup).toBeNull();
|
||||
});
|
||||
|
||||
it("renames a certain local in place when the server is not ready", async () => {
|
||||
cmd.syntaxLocals.mockReturnValueOnce(ok(local({ references: [r(1, 4, 5)] })));
|
||||
cmd.syntaxNodeAt
|
||||
|
||||
Reference in new issue
Block a user