Minor refactoring

This commit is contained in:
Nathan McCarty 2024-12-30 13:43:26 +00:00
parent 72393480e3
commit f6c40813d2
4 changed files with 108 additions and 108 deletions

View file

@ -7,6 +7,7 @@
"Nathan McCarty <thatonelutenist@stranger.systems>"
],
"provides": {
"IUtils": "lib/IUtils.rakumod",
"IUtils::IDEMode": "lib/IUtils/IDEMode.rakumod"
},
"bin": {

View file

@ -1,8 +1,8 @@
#!/usr/bin/env raku
use v6.d;
use IUtils::IDEMode;
use IUtils;
my $ide = IUtils::IDEMode::IDEMode.new();
my $ide = IUtils::IDEMode.new();
# my @res = $ide.browse-namespace: 'Data.List';
# say @res;
@ -14,7 +14,6 @@ say @res.raku;
@res = $ide.interpret: ':exec works >>= print';
say @res.raku;
say $ide.read-sexp();
@res = $ide.interpret: ':exec fails';
say @res.raku;

3
lib/IUtils.rakumod Normal file
View file

@ -0,0 +1,3 @@
unit module IUtils;
need IUtils::IDEMode;

View file

@ -1,4 +1,9 @@
unit module IUtils::IDEMode;
unit class IUtils::IDEMode;
has $!process;
has $!port;
has $!socket;
has $!request-id = 0;
grammar SExp {
rule TOP { <sexp> }
@ -35,12 +40,6 @@ class SExp::Actions {
}
}
class IDEMode {
has $!process;
has $!port;
has $!socket;
has $!request-id = 0;
submethod TWEAK {
# Start idris2 in IDE mode
my $ret = Promise.new;
@ -142,5 +141,3 @@ class IDEMode {
method version() {
self.send-command('version')
}
}