@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
Command<?> command = session.getCommand(commandName); if (command != null) { completion = command.complete(new RuntimeContextImpl(session, session.getContext().getAttributes()), termPrefix); } else { completion = new CompletionMatch(Delimiter.EMPTY, Completion.create());
} else { Repl found = null; for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.getName().equals(name)) { if (lang.isActive()) { for (Language lang : session.getContext().getPlugins(Language.class)) { Repl repl = lang.getRepl(); if (repl != null) {
@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
@Override public Completion complete(ParameterDescriptor parameter, String prefix) throws Exception { ShellSession session = (ShellSession)context.getSession(); Completion.Builder builder = Completion.builder(prefix); for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.isActive()) { if (lang.getRepl() != null) { String name = lang.getName(); if (name.startsWith(prefix)) { builder.add(name.substring(prefix.length()), true); } } } } return builder.build(); } }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
/** * The underlying groovu shell used for the REPL. * * @return a groovy shell operating on the session attributes */ public static GroovyShell getGroovyShell(ShellSession session) { GroovyShell shell = (GroovyShell)session.get("shell"); if (shell == null) { CompilerConfiguration config = new CompilerConfiguration(); config.setRecompileGroovySource(true); ShellBinding binding = new ShellBinding(session, session); shell = new GroovyShell(session.getContext().getLoader(), binding, config); session.put("shell", shell); } return shell; }
Command<?> command = session.getCommand(commandName); if (command != null) { completion = command.complete(new RuntimeContextImpl(session, session.getContext().getAttributes()), termPrefix); } else { completion = new CompletionMatch(Delimiter.EMPTY, Completion.create());
Command<?> command = session.getCommand(commandName); if (command != null) { completion = command.complete(new RuntimeContextImpl(session, session.getContext().getAttributes()), termPrefix); } else { completion = new CompletionMatch(Delimiter.EMPTY, Completion.create());
} else { Repl found = null; for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.getName().equals(name)) { if (lang.isActive()) { for (Language lang : session.getContext().getPlugins(Language.class)) { Repl repl = lang.getRepl(); if (repl != null) {
} else { Repl found = null; for (Language lang : session.getContext().getPlugins(Language.class)) { if (lang.getName().equals(name)) { if (lang.isActive()) { for (Language lang : session.getContext().getPlugins(Language.class)) { Repl repl = lang.getRepl(); if (repl != null) {