racket-langserver icon indicating copy to clipboard operation
racket-langserver copied to clipboard

Lint same equals, e.g (equal? foo foo)

Open jestarray opened this issue 6 months ago • 10 comments

Image

#lang racket

(define x "foo")

(string=? x x)

Saw this and thought it would be a useful lint. Unsure if this should go here or be in re-syntax or some other tool. We do have lints for unused variables already though

jestarray avatar Jul 01 '25 18:07 jestarray

We expect that should be supported by DrRacket first, then this project uses that result. For example, unused variable is use DrRacket's no bound occurrences.

dannypsnl avatar Jul 02 '25 05:07 dannypsnl

This should be related to resyntax support issue (#40). I believe it would be a simple rule to implement using resyntax.

6cdh avatar Jul 05 '25 03:07 6cdh

Do anyone know how to use resyntax as library?

dannypsnl avatar Jul 05 '25 06:07 dannypsnl

Do anyone know how to use resyntax as library?

I believe it is possible, but not yet implemented.

Would calling Resyntaxt with system* from racket/system suit your needs?

spdegabrielle avatar Jul 05 '25 13:07 spdegabrielle

https://github.com/jeapostrophe/racket-langserver/blob/master/service/

I have no idea how resyntax be implemented, so I was expecting something compatible with these service, but another options are also available (if they can produce result in reasonable time)

dannypsnl avatar Jul 05 '25 13:07 dannypsnl

It does not seem to provide a library.

Starting a resyntax process and parse its output is feasible, but a more stable interface would be better, and start a racket process has high latency.

6cdh avatar Jul 05 '25 13:07 6cdh

It does not seem to provide a library.

Starting a resyntax process and parse its output is feasible, but a more stable interface would be better, and start a racket process has high latency.

It sounds like you are interested in using Resyntax interactively. I believe that would be welcomed by the project owner - https://github.com/jackfirth/resyntax/issues/27

spdegabrielle avatar Jul 05 '25 13:07 spdegabrielle

@6cdh I would suggest trying to add this rule to Resyntax directly as one of the default recommendations, rather than trying to do it completely externally.

jackfirth avatar Jul 06 '25 05:07 jackfirth

@jackfirth I thought @6cdh is suggesting to invoke resyntax analyze --file a.rkt via system function in racket base, for the rule here indeed should be added into resyntax, not implement it externally.

dannypsnl avatar Jul 06 '25 13:07 dannypsnl

Yes. New rule should be considered for adding to Resyntax first.

6cdh avatar Jul 07 '25 13:07 6cdh