mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-06 16:08:33 +00:00
Go to Declaration and Cmd-click said "Cannot find declaration" on HTML href/src, CSS url() and @import, Markdown links and CSS selectors: language servers expose paths as document links, not definitions, and none resolves class/id to selectors. - ide-lsp: textDocument/documentLink (lsp_document_links), resolving links that lack a target. - Editor: when the server has no definition, follow its document links, then URLs and quoted / Markdown / url() paths in any language. Server file links are checked to exist; root-relative paths also resolve against resource roots. Cmd-hover underlines the whole link. - ide-language: tree-sitter web references (class / id attributes, href="#id", var(--x)) and .class / #id / --var definitions from stylesheets and <style> elements, indexed as symbols. web_goto looks them up by exact name (ProjectIndex::symbols_named), using the open document's unsaved text. - Detect public/ of package.json modules as a resource root (Vite, Next, CRA serve it at /).
12 lines
354 B
TypeScript
12 lines
354 B
TypeScript
import { isTauri } from "./ipc";
|
|
|
|
/** Opens a web or `mailto:` URL with the system handler (the default browser). */
|
|
export async function openExternalUrl(url: string): Promise<void> {
|
|
if (!isTauri()) {
|
|
window.open(url, "_blank", "noopener");
|
|
return;
|
|
}
|
|
const { openUrl } = await import("@tauri-apps/plugin-opener");
|
|
await openUrl(url);
|
|
}
|