From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id mOX2MMBbhmHgDwEAgWs5BA (envelope-from ) for ; Sat, 06 Nov 2021 11:41:04 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id EFO7LMBbhmGSDgAA1q6Kng (envelope-from ) for ; Sat, 06 Nov 2021 10:41:04 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 29DE2854B for ; Sat, 6 Nov 2021 11:41:04 +0100 (CET) Received: from localhost ([::1]:48658 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjJ8A-0006RQ-Ab for larch@yhetil.org; Sat, 06 Nov 2021 06:41:02 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:54708) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjJ7h-0006Qp-BR for emacs-orgmode@gnu.org; Sat, 06 Nov 2021 06:40:33 -0400 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]:37525) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mjJ7f-0007Nh-RA for emacs-orgmode@gnu.org; Sat, 06 Nov 2021 06:40:33 -0400 Received: by mail-pj1-x1033.google.com with SMTP id t5-20020a17090a4e4500b001a0a284fcc2so5137884pjl.2 for ; Sat, 06 Nov 2021 03:40:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=references:user-agent:from:to:subject:date:in-reply-to:message-id :mime-version; bh=cqu2MDR6Ts5ryy8+rCf3jFxH63pk+E5Ho8nkzAiOP9w=; b=o4u3+0QexqVlhilL59kyJxNpLSOOCYIqCzqn0nC3ZFVVGJmrkMTuy687FhELkBZieg PKtotKWg9Yv+MwgiQ2AFUcxWBIbd0X/Rn87D69NN2F+6F9OITMCMk9fDBea0V8j/uWJF LSEO4xAfwyILj4TCOsyfNYz6xFDsUMwEA6bY1oVN0Gh2GSnWFUv/b9kSuJXzqPnagETo fa6xnLVny5W4HhafOP8xBBtmtJMPh7jOnLo3hYSvjn7p1Roj+O311VHtoqD+UrHEyr+c +Lr/Kbq6Mw6wFIWGNBCANqo++/MAZUAIfO0Btn1CR8fQgQtJmyH7l3KvaIjYaeAwK6Zl hrJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:references:user-agent:from:to:subject:date :in-reply-to:message-id:mime-version; bh=cqu2MDR6Ts5ryy8+rCf3jFxH63pk+E5Ho8nkzAiOP9w=; b=RHeSYRyFUysCX59Gn2fvPsDXe7vKaXbb7IyJsmNzqkPvA2LsPc+O2PZPAZmufRrnOd fZHkiEv7KXLPA7j5BWf/u6I4TKPhC6X97w47IORoZw0pJi4JTUsSt1C9Wh6g5HwpqL7Z AFbeYrdTvTf4at2vnNRC9yM83hSo9SVjzeqP3F19VNNSKwJ6hnJLBQwQqUsDzQmX9gF6 yyZuEdi1DgVlHmcPvdhabMhnhxGvAjLSHdyS/35VnctQ8Ictq5FrQs6b1pBjAW7eUwC3 rIxKZVhtaZHYlqkr2wX2rBF5SS80Alg/12tl1Vdkgsj9LsOwqSaKSjgEGBR5l+rsRQIJ FxHw== X-Gm-Message-State: AOAM530dL/3825K2l3Js/4EmlIEcRUKkjoYW0c9kyRrGq/dbJpDREp/j lrh18+xmXllp34E7ehqg7WgpKrBU2uM= X-Google-Smtp-Source: ABdhPJzvUK90ih3onSowj73rVFsWChNOgcaDWPf/WJFNYTd1Pe/7GuUK7jtJ+3hyLq5pJUkVysmlIA== X-Received: by 2002:a17:90a:ec0a:: with SMTP id l10mr12383128pjy.92.1636195230035; Sat, 06 Nov 2021 03:40:30 -0700 (PDT) Received: from dingbat (2001-44b8-31f2-bb00-9762-3b1d-1455-e9f6.static.ipv6.internode.on.net. [2001:44b8:31f2:bb00:9762:3b1d:1455:e9f6]) by smtp.gmail.com with ESMTPSA id d20sm10590983pfl.173.2021.11.06.03.40.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 Nov 2021 03:40:29 -0700 (PDT) References: <1837352.1635996638@apollo2.minshall.org> User-agent: mu4e 1.7.4; emacs 28.0.60 From: Tim Cross To: emacs-orgmode@gnu.org Subject: Re: typescript from org src buffer -- tide, lsp Date: Sat, 06 Nov 2021 21:33:48 +1100 In-reply-to: <1837352.1635996638@apollo2.minshall.org> Message-ID: <8735o97ejp.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1033; envelope-from=theophilusx@gmail.com; helo=mail-pj1-x1033.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1636195264; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=cqu2MDR6Ts5ryy8+rCf3jFxH63pk+E5Ho8nkzAiOP9w=; b=aEwgK3kaqnu+yOYolOkMuXOBnA0JAvIDGBXEWQSNcU+qA14FyxrlX83JOXUX3QeBXvtewJ VAhqDbevt+n1pCvZmsl3D1ZtfNWt0zunMpad+95aInT024KXmtW2As5/f77Zn/JhojZCBL bvPi3Y0TMhMCIlLw5DKOED2kYbv4GlSI63uGvyS2lgyr7ffzgclEfAqrgyOjX6K1TUkm7k SIYM99SkGUkQhJhZQjkSuNlPt8n0AxTuXmgSk11u4Q3rp+DTofuRXr4NmG62pv7Bml2368 1pDa+iCZrjlDgxAzu91Sa8885VI9KS8aOmhFQ64+Lef3slea1B5VEcVlgceDtA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636195264; a=rsa-sha256; cv=none; b=eqmzVWUe5SoLm/RxMIsErgbq6DSVQ6mh951PjLgAQ7gkkCxwDQIne61qJ3aC9UeTO85rkx OqKGIh947Kp4jG58e/i2fvxyHBtywZfDOACwrrl+I83IN9eYrqRjVF3Hd14gxJPCB+Uc2r GO2ZE6DIZJ4WDbZ2qxOcRSU592Hhf/A6U1izaNx442y9iTJ+TR5blNY8ybQOr0Y+OjOIuH MSsjskocsX4Zyj2Vip74EgmYwUDy7Xr52P+UUaOeKKiqK2t8BhB3piL2StDwEW98yMXfSw 3ElRNswuYtejNwWFq/9RxCz0eBFrRrYYcxUDcU7DTR+J2SlN3uNgmQE59/eiJQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=o4u3+0Qe; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.12 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=o4u3+0Qe; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 29DE2854B X-Spam-Score: -3.12 X-Migadu-Scanner: scn0.migadu.com X-TUID: 3eY2M6ETueC9 Greg Minshall writes: > 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. > I've not tried to do this, but a complete shot in the dark.... according to the org manual, you can set a :dir value in the source block header which will specify the working directory to be used i.e. the directory where the code will be evaluated. Perhaps setting that to the directory where the other block has tangled the output would work? See the Environment of a code block node under the working with source code node in the org manual for details.