unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: "Jostein Kjønigsen" <jostein@secure.kjonigsen.net>
To: Randy Taylor <dev@rjt.dev>, Dmitry Gutov <dgutov@yandex.ru>
Cc: eliz@gnu.org, 61302@debbugs.gnu.org
Subject: bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties
Date: Tue, 14 Feb 2023 12:42:50 +0100	[thread overview]
Message-ID: <5075852e-480b-7ca9-ba46-8de230ed8df5@secure.kjonigsen.net> (raw)
In-Reply-To: <VrmpocQOMAcOnnt0KIhKxitvxtNy6qA2woMqwau9KZ0Giv7iLVl1PDYC91BMKzRohliHW0eQcgwOGhnMWoaRszvVbxNqX8qykvqfxthN_6w=@rjt.dev>

[-- Attachment #1: Type: text/plain, Size: 2125 bytes --]

On 2/14/23 04:25, Randy Taylor wrote:
>
> Hi Dmitry and Jostein,
>
> Here is the promised patch in all its glory.
> I have also attached a screenshot of how things look now.
>
> Changes:
> - Attributes are now highlighted with font-lock-preprocessor-face.
> - Added import-specific queries to cover all (hopefully...) import highlights, and simplified the existing scoped identifier types.
>    - Note: I decided that anything at the end of a scoped identifier for imports or within a use list that's lowercased should be the default face because we don't know if it's a module, function, type, or whatever else. rust-mode also does this, and now we match their highlighting almost one for one. neovim and the rest do it this way too, and it makes the most sense.

Haven given the latest patch a try on a less macro-ridden codebase I 
have to say it looks a lot better. In general I would say for this other 
code-base it looks favourable to rust-mode.

If there's one thing which still seems to be done better in rust-mode 
(not nitpicking the variable highlighting), it would be fully namespaces 
function calls within classes.

Consider the following code:

extern crate claxon;
let result = claxon::FlacReader::open(path);

While rust-ts-mode correctly identifies that open() is a function-call, 
rust-mode correctly identified FlacReader as a class.

Based on the tree-sitter output for this node, it seems plausible that 
one should be able to implement the same for rust-ts-mode as well.

(source_file (line_comment)
  (extern_crate_declaration extern (crate) name: (identifier) ;)
  (let_declaration let pattern: (identifier) =
   value:
    (call_expression
     function:
      (scoped_identifier
       path: (scoped_identifier path: (identifier) ::
                                name: 
(identifier))                                <-- this is the class
       :: name: (identifier))
     arguments: (arguments ( (identifier) )))
   ;))

That's nowhere near a "big" problem though. It's just icing on the cake ;)

--
Jostein

[-- Attachment #2.1: Type: text/html, Size: 2878 bytes --]

[-- Attachment #2.2: 5LcAjDfSb1da6nv4.png --]
[-- Type: image/png, Size: 16670 bytes --]

  reply	other threads:[~2023-02-14 11:42 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-05 20:15 bug#61302: 29.0.60; rust-ts-mode does not show function-invocation on field-properties Jostein Kjønigsen
2023-02-05 21:30 ` Randy Taylor
2023-02-05 21:52   ` Jostein Kjønigsen
2023-02-05 21:59     ` Jostein Kjønigsen
2023-02-06  1:50       ` Randy Taylor
2023-02-06  2:45         ` Dmitry Gutov
2023-02-06  2:57           ` Randy Taylor
2023-02-07 14:26           ` Randy Taylor
2023-02-07 18:16             ` Dmitry Gutov
2023-02-07 18:25               ` Dmitry Gutov
2023-02-08  3:38                 ` Randy Taylor
2023-02-08 15:44                   ` Dmitry Gutov
2023-02-09  3:38                     ` Randy Taylor
2023-02-09 21:19                       ` Dmitry Gutov
2023-02-10  3:44                         ` Randy Taylor
     [not found]                           ` <33cec9a6-7e69-2eb3-a8a6-58ce23a5c185@yandex.ru>
2023-02-12  2:48                             ` Randy Taylor
2023-02-13  3:37                               ` Dmitry Gutov
2023-02-14  3:25                                 ` Randy Taylor
2023-02-14 11:42                                   ` Jostein Kjønigsen [this message]
2023-02-14 12:39                                     ` Randy Taylor
2023-02-14 14:28                                       ` Jostein Kjønigsen
2023-02-14 22:14                                       ` Dmitry Gutov
2023-02-15  2:07                                         ` Randy Taylor
2023-02-16  1:53                                           ` Dmitry Gutov
2023-02-18  3:27                                             ` Dmitry Gutov
2023-02-18 20:42                                               ` Randy Taylor
2023-02-18 21:45                                                 ` Dmitry Gutov
2023-02-18 23:31                                                   ` Randy Taylor
2023-02-19  0:13                                                     ` Dmitry Gutov
2023-02-19  0:50                                                       ` Randy Taylor
2023-02-19 17:23                                                         ` Dmitry Gutov
2023-02-18 20:59                                               ` Dmitry Gutov
2023-02-13 10:17                           ` Jostein Kjønigsen
2023-02-13 14:39                             ` Randy Taylor
2023-02-13 15:04                               ` Jostein Kjønigsen
2023-02-13 18:19                                 ` Randy Taylor
2023-02-13 19:57                               ` Dmitry Gutov
2023-02-13 20:49                                 ` Dmitry Gutov
2023-02-13 19:59                             ` Dmitry Gutov
2023-02-05 21:56   ` Dmitry Gutov
2023-02-06  2:06     ` Randy Taylor
2023-02-06  2:16       ` Dmitry Gutov
2023-02-05 21:44 ` Dmitry Gutov

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.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=5075852e-480b-7ca9-ba46-8de230ed8df5@secure.kjonigsen.net \
    --to=jostein@secure.kjonigsen.net \
    --cc=61302@debbugs.gnu.org \
    --cc=dev@rjt.dev \
    --cc=dgutov@yandex.ru \
    --cc=eliz@gnu.org \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.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).