langtools/src/jdk.jshell/share/classes/jdk/internal/jshell/tool/JShellTool.java
changeset 44569 b1accf8b2aed
parent 44459 5224425af378
child 44683 610dc2b48954
equal deleted inserted replaced
44568:3d870d326626 44569:b1accf8b2aed
     1 /*
     1 /*
     2  * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
  1438                         .map(c -> ((noslash && c.command.startsWith("/"))
  1438                         .map(c -> ((noslash && c.command.startsWith("/"))
  1439                                 ? c.command.substring(1)
  1439                                 ? c.command.substring(1)
  1440                                 : c.command) + " ")
  1440                                 : c.command) + " ")
  1441                         .toArray(String[]::new))
  1441                         .toArray(String[]::new))
  1442                         .completionSuggestions(code, cursor, anchor);
  1442                         .completionSuggestions(code, cursor, anchor);
  1443             } else if (code.startsWith("/se")) {
  1443             } else if (code.startsWith("/se") || code.startsWith("se")) {
  1444                 result = new FixedCompletionProvider(SET_SUBCOMMANDS)
  1444                 result = new FixedCompletionProvider(SET_SUBCOMMANDS)
  1445                         .completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor);
  1445                         .completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor);
  1446             } else {
  1446             } else {
  1447                 result = Collections.emptyList();
  1447                 result = Collections.emptyList();
  1448             }
  1448             }