emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Greg Minshall <minshall@umich.edu>
To: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: typescript from org src buffer -- tide, lsp
Date: Thu, 04 Nov 2021 06:30:38 +0300	[thread overview]
Message-ID: <1837352.1635996638@apollo2.minshall.org> (raw)

hi.

i'm wondering if anyone programming in typescript might have run into,
and solved, this "problem", of tangling into a subdirectory, and tide
[1] not being able to resolve "relative" imports.

i have a file in path /a/b/foo.org.  it includes various source blocks,
and they do things like `:tangle c/d/bar.ts`.  another source block,
tangled into in c/d/fubar.ts, say, does something like:
----
import Bar from "./bar"
----

when i open an Org Src edit buffer from fubar.ts's source block, with
tide mode [1] enabled, i get a complaint
----
Cannot find module './bar' or its corresponding type declarations. [2307]
----
tide (or, really, iiuc, tsserver) appears to be, reasonably, looking for
/a/b/bar.ts, and not finding it.  but, i haven't been able to figure out
how to talk tide into looking elsewhere.

i've done things like add "rootDirs" to `tsconfig.json`, to no avail.  i
haven't been able to get lsp-mode [2] to work for this scenario, either.

anyway, in case anyone has done exactly that, i'm asking.

cheers, Greg

[1] tide: https://github.com/ananthakumaran/tide
[2] lsp:  https://github.com/emacs-lsp/lsp-mode/


ps -- scrounging around trying to deal with this, i stumbled on
----
https://github.com/justbur/emacs-which-key
----
which i find a treat.


             reply	other threads:[~2021-11-04  3:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  3:30 Greg Minshall [this message]
2021-11-06 10:33 ` Tim Cross
2021-11-06 15:29   ` Samuel Banya
2021-11-06 16:56   ` Greg Minshall

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1837352.1635996638@apollo2.minshall.org \
    --to=minshall@umich.edu \
    --cc=emacs-orgmode@gnu.org \
    --subject='Re: typescript from org src buffer -- tide, lsp' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).