From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.devel Subject: Re: Using incremental parsing in Emacs Date: Sat, 4 Jan 2020 16:42:38 +0300 Message-ID: References: <83blrkj1o1.fsf@gnu.org> <41b3e9a0-2866-4692-a35c-6d9541bc3aaa@Spark> <83lfqnha8a.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="107109"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 Cc: HaiJun Zhang , "emacs-devel@gnu.org" To: arthur miller , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jan 04 14:42:53 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1injhd-000RkE-Ai for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 14:42:53 +0100 Original-Received: from localhost ([::1]:34090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1injhb-0007rz-Oa for ged-emacs-devel@m.gmane.org; Sat, 04 Jan 2020 08:42:51 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55640) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1injhU-0007r7-MX for emacs-devel@gnu.org; Sat, 04 Jan 2020 08:42:45 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1injhT-0004zr-5A for emacs-devel@gnu.org; Sat, 04 Jan 2020 08:42:44 -0500 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:35954) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1injhS-0004ws-P6; Sat, 04 Jan 2020 08:42:42 -0500 Original-Received: by mail-lf1-x132.google.com with SMTP id n12so33628845lfe.3; Sat, 04 Jan 2020 05:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=MBR4U3JHhMAIvgR8cQq7miUJszvAK79Wz4SWBPSHb74=; b=vTBq7By3ZaOTmC/q3BTd052JxQ14os0RYHh2F3zYDIG87OeDL2eWBKR7dCulvWVMYC 1o2fcFr8cIEkvexCDrRgJtQLytjqWNcp+UBQkFuh1QvfILaZNyvdbElm0y4irfXuHFBy WYLxE3WZzyF7j3VdbKQZZ9gLkwkC6AzvDgRCKWWj4NW2jFtee8F0hLU8ygwh5SfRwTe4 Haewpvx4sUoiNFzHUSgfbDgnHnciOQVkPZAhJYmEHy1rbRipwebOZ9cRhidAI6YP7XMC dkWWXlQrJ6zjCDiULQ6/xlUh7Wy9SBwV/PVU7pUYKYmeukfDSmeEYkFRRyJxnuXlyAWr BALQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=MBR4U3JHhMAIvgR8cQq7miUJszvAK79Wz4SWBPSHb74=; b=i1YWry8s4Gr53B9uQIuI7Xro0S6PHZTfr88aU5NDG0PoWomVXjJZbhOxwvaBMGFTZg ZzsU/ds+Cq011q53ti22IQ4OYiRqKIXpxFXE+I+xAUy1nBL8AN7CGPrARRaAaif05S86 th1V2Irj4LjLmA7g8c9JW8F4qTsJaCPlO27WVN1X1IHDxD5rV5zVXAgnitgnT7jimXs9 Fl8GosYJ6nrDZftb2zn/T5EZ4zNJ7gZsShijUx8suR5dkPDtGmVLs4qz2Uow7AVFjhPX HzrSvniw6ApiRE96ZzBGMyelRQWv3M5LfAt+Cu/wkx7bEdvsSdmdgGw7Jhny7TkSR/Qb hI6Q== X-Gm-Message-State: APjAAAW1pfokuAg9z25bFuhMvui9WLnOMbfMUbGoTOw+7/yRm1U122H/ HgECt7xupSbyx0HfMtRg8l8S9xeXZE0= X-Google-Smtp-Source: APXvYqzT4fpAtRQk9wqgF78C8+geomBlsraP/nutGdKIJKmsNzXcaOD6PfxM0tBJ0fE2FEgPnGx7WQ== X-Received: by 2002:ac2:4c2b:: with SMTP id u11mr53315134lfq.46.1578145360296; Sat, 04 Jan 2020 05:42:40 -0800 (PST) Original-Received: from [192.168.1.142] ([178.252.127.239]) by smtp.googlemail.com with ESMTPSA id l12sm26163399lji.52.2020.01.04.05.42.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 04 Jan 2020 05:42:39 -0800 (PST) In-Reply-To: Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::132 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:243920 Archived-At: On 04.01.2020 15:30, arthur miller wrote: > Do it in a thread and display file originally without syntax coloring, > and then gradually display results as the tree-sitter thread work it's > way? Syntax info is needed not only for coloring, and often on-demand. So a synchronous API will be needed. > Maybe start with displayed portion of the file only. Then since > tree-sitter accepts changes as fine-grained as on character level, send > new lines for syntax colouring as they are scrolled upp or down. Like Eli said, see how JIT-lock works. If tree-sitter can support this usage, very good. > Or other strategy could be to have tree-sitter thread highlight the > visible portion of the file and to continue to work with non-visible > part of the buffer in background? That seems kinda wasteful.