8178013: Finetuning of merged tab and shift tab completion

Fixing mistakes in localization bundle, fixing completion after /help set.

Reviewed-by: rfield
This commit is contained in:
Jan Lahoda 2017-04-06 11:55:58 +02:00
parent 06143df6a2
commit 64d37b0a69
3 changed files with 10 additions and 8 deletions

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -1440,7 +1440,7 @@ public class JShellTool implements MessageHandler {
: c.command) + " ")
.toArray(String[]::new))
.completionSuggestions(code, cursor, anchor);
} else if (code.startsWith("/se")) {
} else if (code.startsWith("/se") || code.startsWith("se")) {
result = new FixedCompletionProvider(SET_SUBCOMMANDS)
.completionSuggestions(code.substring(pastSpace), cursor - pastSpace, anchor);
} else {

View File

@ -1,5 +1,5 @@
#
# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved.
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
#
# This code is free software; you can redistribute it and/or modify it
@ -500,11 +500,11 @@ Supported shortcuts include:\n\
Shift-<tab> v\n\t\t\
After a complete expression, hold down <shift> while pressing <tab>,\n\t\t\
then release and press "v", the expression will be converted to\n\t\t\
a variable declaration whose type is based on the type of the expression.\n\t\t\
a variable declaration whose type is based on the type of the expression.\n\n\
Shift-<tab> i\n\t\t\
After an unresolvable identifier, hold down <shift> while pressing <tab>,\n\t\t\
then release and press "i", and jshell will propose possible imports\n\t\t\
which will resolve the identifier based on the content of the specified classpath.\n\t\t\
which will resolve the identifier based on the content of the specified classpath.
help.context.summary = the evaluation context options for /env /reload and /reset
help.context =\
@ -928,5 +928,5 @@ startup.feedback = \
/set format silent display '' \n
jshell.fix.wrong.shortcut =\
Invalid <fix> character. Use "i" for auto-import or "v" for variable creation. For more information see:\n\
Unexpected character after Shift-Tab. Use "i" for auto-import or "v" for variable creation. For more information see:\n\
/help shortcuts

View File

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@ -23,7 +23,7 @@
/*
* @test
* @bug 8144095 8164825 8169818 8153402 8165405 8177079
* @bug 8144095 8164825 8169818 8153402 8165405 8177079 8178013
* @summary Test Command Completion
* @modules jdk.compiler/com.sun.tools.javac.api
* jdk.compiler/com.sun.tools.javac.main
@ -173,6 +173,8 @@ public class CommandCompletionTest extends ReplToolTesting {
"/save ", "/set "),
a -> assertCompletion(a, "/help /set |", false,
"editor", "feedback", "format", "mode", "prompt", "start", "truncation"),
a -> assertCompletion(a, "/help set |", false,
"editor", "feedback", "format", "mode", "prompt", "start", "truncation"),
a -> assertCompletion(a, "/help /edit |", false),
a -> assertCompletion(a, "/help dr|", false,
"drop ")