orca icon indicating copy to clipboard operation
orca copied to clipboard

Editor lacks language intelligence (LSP): no real hover types, cross-file navigation, or accurate diagnostics

Open moishinetzer opened this issue 3 months ago • 6 comments

The built-in Monaco editor currently runs only the sandboxed single-file TS worker. Because it cannot resolve imports, hover shows any for most symbols, go-to-definition cannot leave the file, Find All References finds nothing outside the current file, and semantic diagnostics are disabled entirely (they were all false positives — see the note in src/renderer/src/lib/monaco-setup.ts). monaco-codebase-search.ts also notes text search is a stand-in "until Orca has semantic LSP references".

Since Orca's core loop is reviewing agent-written code, real language intelligence in both the editor and the diff views would materially improve review quality:

  • hover with real project types
  • go-to-definition and find-references across files
  • completions with project context
  • accurate diagnostics (squiggles) from a real language server

A minimal path: drive user-installed language servers (tsgo / typescript-language-server / pyright / gopls / rust-analyzer) over stdio from the main process, local workspaces only, degrading silently when no server is installed. Notably, TypeScript 7 (typescript@7, tsgo-based) no longer ships tsserver.js, so tsgo's built-in --lsp mode is also the only forward-compatible option for TS7 repos.

I have an implementation ready and will link a PR.

moishinetzer avatar Aug 16 '26 09:08 moishinetzer

Related existing trackers: #3035 (LSP + codebase search) and #961 (TS go-to-references). Leaving this open — it is a more concrete editor-implementation writeup, and the author mentioned a follow-up PR.

OrcaWin avatar Aug 16 '26 15:08 OrcaWin

Hi! I'd like to help land this, but wanted to check direction before writing code since #1912 and #14873 both stalled as fairly large changes and no longer apply cleanly on main.

Two questions for maintainers:

  1. Is the "Monaco is a viewer, not a type checker" note in monaco-setup.ts a firm product decision, or would an opt-in LSP bridge be welcome if it's off by default and does nothing when no server is installed?

  2. If it's welcome, would you prefer a series of small PRs instead of one large one? Something like:

    • LSP core under src/main/lsp/, with tests and no UI
    • IPC/preload behind an experimental setting
    • Go to definition + a small status indicator
    • Hover, references and diagnostics
    • Additional servers and SSH relay support last, since that seems to be the higher-risk area

I'd be happy to reuse ideas/code from #14873 and #1912 where appropriate, with @moishinetzer's and @nwparker's permission.

I work across Go, Python and TypeScript and spend a lot of time reviewing agent-written code in Orca worktrees, so I'd be able to exercise the integration across multiple language servers rather than just one.

Happy to own the series end to end.

If LSP is considered out of scope for Orca, a quick confirmation here would also be useful before someone invests heavily in another implementation.

MarceloMMendes avatar Sep 09 '26 03:09 MarceloMMendes

+1 on the opt-in stdio bridge, with one request: please treat the server list as config, not a hardcoded set.

The proposal names tsgo / typescript-language-server / pyright / gopls / rust-analyzer. I work full-time in Solidity, and the Solidity ecosystem's server (@nomicfoundation/solidity-language-server, the one behind the Hardhat VS Code extension) would never make a curated five-language list, even though it is a plain stdio LSP that needs no special handling.

Concretely, what I'd like to be able to write is a per-language command + args + file-extension mapping in settings, so any conforming server works without a code change in Orca:

{
  "languageServers": {
    "solidity": {
      "command": "nomicfoundation-solidity-language-server",
      "args": ["--stdio"],
      "extensions": [".sol"]
    }
  }
}

Two observations from the current build (macOS, app.asar) that may be useful to whoever picks this up:

  1. There is no registration point for an external server. The only LSP code in the bundle is Monaco's own lspLanguageFeatures (the built-in JSON/CSS/TS workers). None of the 192 keys in the persisted settings object relates to language servers, there is no extension gallery or .vsix handling, and the CLI (orca --help) exposes only startup / diagnostics / accounts / skills. So this really is a from-scratch surface, which is an argument for designing the config shape now rather than retrofitting it after five servers are wired in by name.

  2. The same "curated list" problem already exists one layer down, in syntax highlighting, which is worth looking at as a preview of the maintenance cost. Language selection does not use Monaco's own extension registry; it uses a hand-maintained 85-entry map in the renderer, falling back to plaintext. Solidity's Monarch grammar ships in the bundle and self-registers for .sol, but that registration is never consulted, so .sol files render as plain text anyway. Details and a one-line fix in #13835.

The lesson generalises: a hardcoded table means every language arrives only when someone remembers to add a row. Data-driven from step one costs almost nothing here, and avoids a second migration later. Happy to test the Solidity path against real Foundry/Hardhat repos once there is a branch.

anajuliabit avatar Sep 16 '26 00:09 anajuliabit

+1 for Python. I use Orca daily to review agent-written Python code. Cmd-Click does nothing in .py files today. I open each worktree in VS Code only to follow a function to its definition. An opt-in bridge to a user-installed pyright-langserver --stdio, as proposed above, covers my case. Support for local worktrees only is enough for me.

Zampra2 avatar Sep 24 '26 11:09 Zampra2

+1 for python here

its not really convenient to open files in zed everytime I need to jump classes and functions

Volosha avatar Sep 30 '26 19:09 Volosha

I've been going through the related issues, discussions and PRs, and there are quite a few of them, but none of them has reached a conclusion.

@brennanb2025 is LSP something the Orca team intends to add? Beyond the technical side, this looks like a product decision, so any PR won't help much if it isn't aligned with Orca's vision.

On the other hand, Orca is great for agents, but features like viewing code or find in the right panel are designed for a person. Some people don't just want to see the code, they want to follow it: know what calls what, without typing or searching for the file manually. That's just one use case.

If LSP doesn't fit what the Orca team wants, what other options do we have? Using Go as an example, gopls exposes tools that could conflict with Orca, like refactors or rename symbol. Who should own those changes in an agentic IDE? The agent. But should we be 100% strict about it? If I can edit a file from the right panel, then I could probably use the tools an LSP exposes too.

My point is that there's a real need here that still causes friction, especially when following code. Part of agentic development is review, and that's not only about showing the changed files (already in the right panel as a tab), but also about being able to move between them.

So, what are the Orca team's plans here?

References:

  • Open PRs, none reviewed yet: #14873, #24703, #1912, #4654, #5595, #8574, #18775, #27724
  • Related issues: #961, #3035, #5247, #29937
  • Discussions: #9877 (lightweight, review-first navigation), #1215
  • Related: #7754 (embedded VS Code)

victorlunam avatar Nov 18 '26 18:11 victorlunam