Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freezing on #lang rhombus #20

Closed
sorawee opened this issue Sep 28, 2021 · 3 comments
Closed

freezing on #lang rhombus #20

sorawee opened this issue Sep 28, 2021 · 3 comments

Comments

@sorawee
Copy link

sorawee commented Sep 28, 2021

When DrComplete is enabled, typing the following content will freeze DrRacket:

#lang rhombus

fun

Note that #lang rhombus can be installed with the instruction at racket/rhombus#163 (comment)

ctrl-c DrRacket reveals the following stacktrace:

^Cuser break
  context...:
   /Users/sorawee/projects/racket/racket/share/pkgs/drcomplete-user-defined/tool.rkt:45:8: get-all-words method in def-mixin
   /Users/sorawee/projects/racket/racket/share/pkgs/drcomplete-module/tool.rkt:20:8: get-all-words method in fc-mixin
   /Users/sorawee/projects/racket/racket/share/pkgs/drcomplete-base/tool.rkt:29:8: get-all-words method in s->l-mixin
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/framework/private/text-autocomplete.rkt:204:6: auto-complete method in autocomplete-mixin
   /Users/sorawee/projects/racket/racket/share/pkgs/drcomplete-auto/tool.rkt:33:16
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/timer.rkt:34:38
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:435:6
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:486:32
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:634:3
^Cuser break
  context...:
   /Users/sorawee/projects/racket/extra-pkgs/gui/gui-lib/mred/private/wx/common/queue.rkt:634:3

I don't know if DrComplete is meant to work outside of #lang racket. If so, this would be a bug. If not, it would be nice to disable the plug-in when #lang is not Racket.

@yjqww6
Copy link
Owner

yjqww6 commented Sep 28, 2021

minimal example to reproduce

#lang racket
(require syntax-color/module-lexer)

(define (symbols in)
  (let loop ([mode #f] [s (set)])
    (define-values (str type _1 _2 _3 _4 new-mode)
      (module-lexer in 0 mode))
    (cond
      [(eof-object? str) s]
      [(eq? type 'symbol)
       (loop new-mode (set-add s str))]
      [else (loop new-mode s)])))

(symbols (open-input-string "#lang rhombus\nfun"))

@sorawee
Copy link
Author

sorawee commented Sep 28, 2021

Thanks! I will report this at the Rhombus repo then.

@sorawee sorawee closed this as completed Sep 28, 2021
@yjqww6
Copy link
Owner

yjqww6 commented Sep 28, 2021

It seems when the type is eof, the str is not guaranteed to be an eof object. I will add a workaround for this.

yjqww6 added a commit that referenced this issue Sep 28, 2021
yjqww6 added a commit that referenced this issue Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants