M3.4: completion, hover and signature help from Phpactor
Engine (crates/engine/src/cmd/lsp_assist.rs), on M3.5's pending outcomes:
- lsp.completion {id, position, triggerCharacter?}: items with label,
kind, detail, Markdown documentation, insertText, textEdit,
additionalTextEdits, sortText; sorted, capped at 500 (cut lists are
incomplete), snippets turned into plain text.
- lsp.hover {id, position}: Markdown contents and range.
- lsp.signatureHelp {id, position}: signatures with UTF-16 parameter spans.
- The request is queued after every didChange; the answer is converted
in the reply callback, off the engine lock. Positions are checked
against the buffer. Server strings and lists are capped.
- lutra-lsp-fake answers completion and signature help.
Editor (ui/src/components/editor/assist/):
- Completion source with Lutra's triggers (identifiers, $, ->, ?->, ::,
namespace \; not in strings or comments unless asked), the server's
ranking as boost, text edits and imports applied in UTF-16 (CRLF too),
Lucide kind icons.
- Hover documentation (350 ms) and editor.quickDocumentation (Mod+I).
- Signature help on ( and , following the cursor; editor.parameterInfo.
- editor.complete.
- Lutra's own Markdown renderer without HTML (XSS-tested), tokens only.
- Requests wait for the buffer sync to be idle and use runWaiting.
- New dependency @codemirror/autocomplete (MIT, already transitive).
Tests: 6 engine tests against the fake server, 9 unit tests, an ignored
real-Phpactor latency test, 29 Vitest tests; palette and menu tests list
the new UI commands.
Measured with the real Phpactor (Windows 11, debug build, 25 ms tick):
- Completion 61-109 ms while typing (median 76 ms; ~107 ms in the app).
- Hover and signature help ~16 ms median.
- A useful list 2.3 s after opening a file in a 20-class project, ~65 s
for 2,000 classes (indexing).
- Phpactor 56-71 MB working set, ~6% of one core while typing.
Live-checked in the app on port 7934. Docs: Code completion 0% -> 5%
(est.), feature depth ~4.1% -> ~4.6%, breadth 26/155, architecture, G6,
ui-parity, language-parity, roadmap, README.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
12d21d96f4
commit
a212a44490
35 changed files with 3916 additions and 25 deletions
|
|
@ -1,5 +1,8 @@
|
|||
{
|
||||
"app.statusBar.version": "{name} {version}",
|
||||
"command.editor.complete": "Complete Code",
|
||||
"command.editor.parameterInfo": "Parameter Info",
|
||||
"command.editor.quickDocumentation": "Quick Documentation",
|
||||
"command.editor.reveal": "Reveal Cursor in Editor",
|
||||
"command.find.open": "Find in Files…",
|
||||
"command.goto.classOpen": "Go to Class…",
|
||||
|
|
@ -31,6 +34,32 @@
|
|||
"common.toolWindow.resize": "Resize {title}",
|
||||
"common.toolWindow.show": "Show {title}",
|
||||
"common.toolWindow.stripe": "Tool windows",
|
||||
"editor.assist.kind.class": "Class",
|
||||
"editor.assist.kind.color": "Colour",
|
||||
"editor.assist.kind.constant": "Constant",
|
||||
"editor.assist.kind.constructor": "Constructor",
|
||||
"editor.assist.kind.enum": "Enum",
|
||||
"editor.assist.kind.enumMember": "Enum case",
|
||||
"editor.assist.kind.event": "Event",
|
||||
"editor.assist.kind.field": "Field",
|
||||
"editor.assist.kind.file": "File",
|
||||
"editor.assist.kind.folder": "Folder",
|
||||
"editor.assist.kind.function": "Function",
|
||||
"editor.assist.kind.interface": "Interface",
|
||||
"editor.assist.kind.keyword": "Keyword",
|
||||
"editor.assist.kind.method": "Method",
|
||||
"editor.assist.kind.module": "Namespace",
|
||||
"editor.assist.kind.operator": "Operator",
|
||||
"editor.assist.kind.property": "Property",
|
||||
"editor.assist.kind.reference": "Reference",
|
||||
"editor.assist.kind.snippet": "Snippet",
|
||||
"editor.assist.kind.struct": "Structure",
|
||||
"editor.assist.kind.text": "Text",
|
||||
"editor.assist.kind.typeParameter": "Type parameter",
|
||||
"editor.assist.kind.unit": "Unit",
|
||||
"editor.assist.kind.value": "Value",
|
||||
"editor.assist.kind.variable": "Variable",
|
||||
"editor.assist.signature.count": "{index} of {count}",
|
||||
"editor.closePrompt.question": "Save changes to {name} before closing?",
|
||||
"editor.notice.changedOnDisk": "{name} changed on disk. Your unsaved changes are kept; saving overwrites the file.",
|
||||
"editor.notice.removedOnDisk": "{name} was deleted on disk. Your text is kept; saving writes it again.",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue