From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: JD Smith Newsgroups: gmane.emacs.devel Subject: Re: Eglot cannot work with default completion-in-region? Date: Mon, 29 Jan 2024 17:51:12 -0500 Message-ID: References: <87ttmy7pog.fsf@catern.com> <87r0i1blch.fsf@gmail.com> <874jevzsqa.fsf@gmail.com> Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3774.300.61.1.2\)) Content-Type: multipart/alternative; boundary="Apple-Mail=_993450F1-345E-48C4-A207-67EF809AAC0A" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="27512"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Spencer Baugh , sbaugh@catern.com, emacs-devel , monnier@iro.umontreal.ca To: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 29 23:52:19 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUaUC-0006zz-Ko for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jan 2024 23:52:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUaTR-0003gJ-Qh; Mon, 29 Jan 2024 17:51:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUaTP-0003fN-29 for emacs-devel@gnu.org; Mon, 29 Jan 2024 17:51:27 -0500 Original-Received: from mail-io1-xd30.google.com ([2607:f8b0:4864:20::d30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUaTN-0006Ma-9H for emacs-devel@gnu.org; Mon, 29 Jan 2024 17:51:26 -0500 Original-Received: by mail-io1-xd30.google.com with SMTP id ca18e2360f4ac-7bed8fee278so142180139f.2 for ; Mon, 29 Jan 2024 14:51:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1706568684; x=1707173484; darn=gnu.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=0YfckBsXaCEqpQI2Su6VMrE8bcRYF1Kbc1aXwlNVhUo=; b=cNMy3FO1v1Sl30L/v7PKFvSlWAe1op0p3SADkTCDvn2ZEZ9FqRqk/uI4geWhcD80uS NmG4OBsbN2fwHsvL2OdJteiD7yi9VI5A/Dlb4tOnGFNj8niAj7gLS4SpiigsA966OsJx Y997+euGSIccgen7X8nxABFIsZ8+qiaH7SpJb2TJSkAaBdopd9u728HGpxl2wgQtmyWD e2b/IF/qaMMv7YLzI0vgWBaXtxdSnEih5FFDut6a4ExXuRdhj6ifh2K2VUzUNIoFK4kY xsJ2b3vNObpKagqDVMni5E6QNPvbhGc5tM8h+w4FiaCi0M4xdva8GV6nY2THvGMvrXyT RYlA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706568684; x=1707173484; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=0YfckBsXaCEqpQI2Su6VMrE8bcRYF1Kbc1aXwlNVhUo=; b=RVtHiaElEsVlL4GPuLzzwNy7wJ6h1LKkFgSkHr6U96Vaabuex0ZbhacYuO2PbxH+uH SGam/cR6wRlpG85FBeONeqSS2GEH5LEifRNEsrKFRDpSHbFTP746EZ0sP45wN6sqIwEM ZYjDQHVo4N6VtZ2aoKwk7Pbgrsk0JOn05Mdf2sjgKFhAoiTQtaxAq8NqEI9umN8xTBAu LSgG6dv/x+9Ka87gS0LNqfuUsiTAespNj5EOCYbEHaYq9TIIO9srOyTzl3rcY47FVMqc U7++0gKjJ/RaT16xtqJeG/uNtrIGdhWpaNcn/tqjtln8XcNvIrD8YqvtI7L8VWDVSPmB 1aCA== X-Gm-Message-State: AOJu0Yy4dw+GpQuwMh1Mq87YqPG8vtf6qYzSEMWDmed2W9ky1kMlxR5y GAofw0Jq6rxdg3PEoI+w8WatpLWHizY0RSHJCp5/fDYgIMDBVvir X-Google-Smtp-Source: AGHT+IE1RrYB5ndG4TcuMMD123lbH49RNLmThSr4L/iRQ8ua33YTxX08XJK+OcCQklLEPdVh3dMTeQ== X-Received: by 2002:a5e:c60a:0:b0:7bf:d37a:f343 with SMTP id f10-20020a5ec60a000000b007bfd37af343mr6896567iok.18.1706568683929; Mon, 29 Jan 2024 14:51:23 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCVdl41SN/Sl3e0/sVv64UWR+OffmhKgkTJ/BND8jw7v1dbkY7wQ3YJtdCiwZ2/vTM7YwnW8TJ4M2iwNY4lNfL07cK2hPqRUqKqo61/KMS6ObzUxh8w6OzMg6NqcdYRgewQGunb9kmRMyyFJcECQvEca Original-Received: from smtpclient.apple (cm-24-53-187-34.buckeyecom.net. [24.53.187.34]) by smtp.gmail.com with ESMTPSA id u3-20020a02b1c3000000b0046b59ded0eesm1951312jah.59.2024.01.29.14.51.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 29 Jan 2024 14:51:23 -0800 (PST) In-Reply-To: <874jevzsqa.fsf@gmail.com> X-Mailer: Apple Mail (2.3774.300.61.1.2) Received-SPF: pass client-ip=2607:f8b0:4864:20::d30; envelope-from=jdtsmith@gmail.com; helo=mail-io1-xd30.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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:315612 Archived-At: --Apple-Mail=_993450F1-345E-48C4-A207-67EF809AAC0A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > That's because it's a fundamentally different problem. I agree with this. Fancy completion styles work by sending all possible = completions, and the completion-at-point systems suggests you do = absolutely no filtering based on what the user has typed, leaving the = style functions to do that. This only works when all that data is in = memory or close at hand. A completion style simply has no relevance to = the LSP server; it only knows what's in the buffer at point when = completion was requested.=20 > On Jan 29, 2024, at 5:21=E2=80=AFPM, Jo=C3=A3o T=C3=A1vora = wrote: >=20 > It may look like there is, but it's an illusion. > Some people are using "orderless" with LSP (via Eglot or others), but > they're guaranteed to be missing completions here and there except in > perhaps in the most trivial cases. Unless such people configure orderless to pass every single LSP = completion result from the initial orderless term, then turn on all the = bells and whistles for winnowing that set down for subsequent terms, = which is how I use orderless with LSP. Definitely not an illusion, but = does require a "context" switch as you go. This switch is aided by the = corfu in-buffer completion system's mnemonic of M-SPACE to insert a = space (the default orderless separator) and keep completion active. = Before the space? LSP rules. After the space? Orderless takes over. =20= But yes, it's a tricky impedance mismatch to manage (and there are many = others in the completion-of-data-which-lives-outside-the-emacs-process = space).=20= --Apple-Mail=_993450F1-345E-48C4-A207-67EF809AAC0A Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
That's because = it's a fundamentally different = problem.

I agree with this. =  Fancy completion styles work by sending all possible completions, = and the completion-at-point systems suggests you do absolutely no = filtering based on what the user has typed, leaving the style functions = to do that.  This only works when all that data is in memory or = close at hand.  A completion style simply has no relevance to the = LSP server; it only knows what's in the buffer at point when completion = was requested. 

On Jan = 29, 2024, at 5:21=E2=80=AFPM, Jo=C3=A3o T=C3=A1vora = <joaotavora@gmail.com> wrote:

It may = look like there is, but it's an illusion.
Some = people are using "orderless" with LSP (via Eglot or others), = but
they're guaranteed to be = missing completions here and there except in
perhaps in the most trivial = cases.

Unless such people = configure orderless to pass every single LSP completion result from the = initial orderless term, then turn on all the bells and whistles for = winnowing that set down for subsequent terms, which is how I use = orderless with LSP.  Definitely not an illusion, but does require a = "context" switch as you go.  This switch is aided by the corfu = in-buffer completion system's mnemonic of M-SPACE to insert a space (the = default orderless separator) and keep completion active.  Before = the space?  LSP rules.  After the space?  Orderless takes = over.  

But yes, it's a tricky impedance = mismatch to manage (and there are many others in the = completion-of-data-which-lives-outside-the-emacs-process = space). 
= --Apple-Mail=_993450F1-345E-48C4-A207-67EF809AAC0A--