From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id wK97BamfhmHBFgAAgWs5BA (envelope-from ) for ; Sat, 06 Nov 2021 16:30:49 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id mOAIAamfhmHLdQAAbx9fmQ (envelope-from ) for ; Sat, 06 Nov 2021 15:30:49 +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 243FA3338E for ; Sat, 6 Nov 2021 16:30:48 +0100 (CET) Received: from localhost ([::1]:50770 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mjNeZ-0007oX-5B for larch@yhetil.org; Sat, 06 Nov 2021 11:30:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43942) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjNdw-0007o4-11 for emacs-orgmode@gnu.org; Sat, 06 Nov 2021 11:30:08 -0400 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]:54995) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mjNdp-00029f-5c for emacs-orgmode@gnu.org; Sat, 06 Nov 2021 11:30:07 -0400 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id D302C3200AC9 for ; Sat, 6 Nov 2021 11:29:57 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Sat, 06 Nov 2021 11:29:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=nFMQ1sDw8j4MbEw9+OZgCWH16B+RieY iS0YfXHmkpXg=; b=aD0FTgC2/m/2wvrdmcKJ2I0xG1zm6YUR/HFzj6U8w85AcLz ChCZPDHNBiewd7NAhOplDO8jgPRUOyLQm6KSF+n1bDEUEqA2T+HG87tE26BVo17i bm/PbV7XoXxmDh5fIPvRhDbGAwmpSvsQjJUW1f7Awpz1zLZvlaDv+nIU0yKEjt8O iawMUa3/9SK9KaHkWOt4ul4Z76O0Vo5ObSX5w9Wqnd9vJLe+95cbFR3EWebLbqSd xf67h3xnC/Z0kiGIes1rnN0BWlPltYAB7Y1t2zHcaofusbxg4ezlz10xG2ZLXmyz 0mH3AJviRYm6ZaZ/uepoIlbtv4W+Zn6bJwGKrSA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=nFMQ1s Dw8j4MbEw9+OZgCWH16B+RieYiS0YfXHmkpXg=; b=DHp8+0+d569bPsZB/qn9EQ GVhnvOoTcY7fXAZE7ApB6CXk2EwttSjDT6l9vXcNjHhwEkw0XBR3uEqIKp2mS/QX OR+ilouL7nCoF8bnNaT3fLrt2Bqs+qK3MTQ04C8EJ1tOfk+2FNYf4RVA+Z0Rcvxa vi1IttgGAr+my/sEX1JQWTnLT3tfbkbREtDd1CfiqXTl23jyZbL1hTgpRg55JJVF 2DsMFMb/Xf12hCgnzzzfmcFsVdmeqxj7q++x44Mp7wNKQHPscDLNsWKExodZr3s/ cmE/mbwyQ4GG1HyyxqhAOAZ6kjxjHDULRtaXjzvH7ORqCu3ABE0VoR/dqA11qmwQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdekgdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecuogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenuc fjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfufgrmhhu vghluceurghnhigrfdcuoehssggrnhihrgesfhgrshhtmhgrihhlrdgtohhmqeenucggtf frrghtthgvrhhnpedttdffffekfeetveevteevffevffdtgfdvudekheelvdekvddvfeel vdelhefgueenucffohhmrghinheprhgvugguihhtrdgtohhmpdhgihhthhhusgdrihhopd hthhhomhgrshhhvggrrhhtmhgrnhdrtghomhdptggrtghhvghsthhotggrtghhvghsrdgt ohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepsh gsrghnhigrsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1AB9DF60069; Sat, 6 Nov 2021 11:29:56 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-1369-gd055fb5e7c-fm-20211018.002-gd055fb5e Mime-Version: 1.0 Message-Id: In-Reply-To: <8735o97ejp.fsf@gmail.com> References: <1837352.1635996638@apollo2.minshall.org> <8735o97ejp.fsf@gmail.com> Date: Sat, 06 Nov 2021 11:29:36 -0400 From: "Samuel Banya" To: "Charles Berry" Subject: Re: typescript from org src buffer -- tide, lsp Content-Type: multipart/alternative; boundary=7d00f8663c5248da870f834f0b605142 Received-SPF: pass client-ip=64.147.123.20; envelope-from=sbanya@fastmail.com; helo=wout4-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-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=1636212648; 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=nFMQ1sDw8j4MbEw9+OZgCWH16B+RieYiS0YfXHmkpXg=; b=TPnLn5F+L7UcCpqn2DsCIu9lG72VDUV1QQ4Q5vevJgVJyntlTMtyi4LvFnvitQC3e0HT37 bRBNMdfND+KoAQaymZps2H/agxJC75OGTTQ4pYtLZoeFEHVLXM7EVDnZzBVwAJqKWqSOFX fMa/WAqxU8UvkvXi1jp+Tn6yv2pDDyTrw0jlyUA4xahd4nwgaXbOPmXdYPQSs4bZxzwJv7 icFRkAhJqAMpyk3uuquz/o3iaYtBWGBIFIbTo86YVtcODFI0r2/lsYZAedWPwmErig29Zs EWA0P4dgZ/MKLMz+Jj+SlKQrMQD1N41/u5972StYm5zx0az2QCnDo5ZDvoN1sA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1636212648; a=rsa-sha256; cv=none; b=pRwZsJrq8x7RgzBJzAx2GEgeDij1+OydSu8b26JqYZs5O1Z1hnKwXId5v76z6iKJz2aFvM +z+BOLDrA7ChxJolTir1kxoboKFa0PQKUr5CdB6GUbnIcyDbJqz+DXgi48KQbNinfFV300 W8mrHfHTjSE3wwywkeirCV0YM61sqwLuHsuTQhRQJpNQTHP3ZpIVb1Y6GGJoy/qPgByUTe EcPVkI7n80tCACXraw6CiKUqgfyS4IGf1IbpnaOzEyLK9DWlfah59aytEeUQi/5KHfCiMI fkA6qq0sSLVq3H2EbV0EHgtI6pqPPsu2Y0PB31+YGenN0ds56i+tnVi6nceVsQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm1 header.b=aD0FTgC2; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=DHp8+0+d; dmarc=pass (policy=none) header.from=fastmail.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-Spam-Score: -2.11 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm1 header.b=aD0FTgC2; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=DHp8+0+d; dmarc=pass (policy=none) header.from=fastmail.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: 243FA3338E X-Spam-Score: -2.11 X-Migadu-Scanner: scn0.migadu.com X-TUID: NyQZTP+77rYT --7d00f8663c5248da870f834f0b605142 Content-Type: text/plain Cool topic, but I haven't done it myself either as most explanations are pretty big-brained in the sense that its a little hard for a beginner to figure out sometimes. However, the power of literate programming is super cool, so here's a few links I found that you can go through that might help you out: https://www.reddit.com/r/emacs/comments/a3rlvk/orgmode_literate_programming_and_emacs/ https://emacs-lsp.github.io/lsp-mode/manual-language-docs/lsp-org/ https://blog.thomasheartman.com/posts/configuring-emacs-with-org-mode-and-literate-programming http://cachestocaches.com/2018/6/org-literate-programming/ Hope it helps, Sam On Sat, Nov 6, 2021, at 6:33 AM, Tim Cross wrote: > > 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. > > --7d00f8663c5248da870f834f0b605142 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Cool topic, but= I haven't done it myself either as most explanations are pretty big-bra= ined in the sense that its a little hard for a beginner to figure out so= metimes.

However, the power of literate pro= gramming is super cool, so here's a few links I found that you can go th= rough that might help you out:

<= div>Hope it helps,

Sam

O= n Sat, Nov 6, 2021, at 6:33 AM, Tim Cross wrote:

Greg Minshall <<= a href=3D"mailto:minshall@umich.edu">minshall@umich.edu> writes:<= br>

> hi.
>
&= gt; i'm wondering if anyone programming in typescript might have run int= o,
> and solved, this "problem", of tangling into a sub= directory, and tide
> [1] not being able to resolve "re= lative" 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 sourc= e block,
> tangled into in c/d/fubar.ts, say, does some= thing like:
> ----
> import Bar from "= ./bar"
> ----
>
> whe= n 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 correspondin= g type declarations. [2307]
> ----
> t= ide (or, really, iiuc, tsserver) appears to be, reasonably, looking for<= br>
> /a/b/bar.ts, and not finding it.  but, i haven't= been able to figure out
> how to talk tide into lookin= g elsewhere.
>
> i've done things like= add "rootDirs" to `tsconfig.json`, to no avail.  i
&= gt; haven't been able to get lsp-mode [2] to work for this scenario, eit= her.
>
> anyway, in case anyone has do= ne exactly that, i'm asking.
>

=
I've not tried to do this, but a complete shot in the dark....
<= /div>

according to the org manual, you can set a :dir= value in the source
block header which will specify the w= orking directory to be used i.e.
the directory where the c= ode will be evaluated. Perhaps setting that to
the directo= ry where the other block has tangled the output would work?

See the Environment of a code block node under the work= ing with source
code node in the org manual for details.



--7d00f8663c5248da870f834f0b605142--