Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf70b759

Browse files
committed
Remove SHELLOPTS=vi and -Xjline support, reinstate -Xnojline
This functionality is better provided by jline through the `~/.inputrc` or other file pointed to by `-Djline.inputrc`The content of the file needs to just include the line```set editing-mode vi # or emacs```
1 parent6b1b9d7 commitf70b759

File tree

9 files changed

+13
-31
lines changed

9 files changed

+13
-31
lines changed

‎project/ScalaOptionParser.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ object ScalaOptionParser {
8383

8484
// TODO retrieve these data programmatically, ala https://github.com/scala/scala-tool-support/blob/master/bash-completion/src/main/scala/BashCompletion.scala
8585
privatedefbooleanSettingNames=List("-X","-Xasync","-Xcheckinit","-Xdev","-Xdisable-assertions","-Xexperimental","-Xfatal-warnings","-Xlog-free-terms","-Xlog-free-types","-Xlog-implicit-conversions","-Xlog-reflective-calls",
86-
"-Xno-forwarders","-Xno-patmat-analysis","-Xnon-strict-patmat-analysis","-Xprint-pos","-Xprint-types","-Xprompt","-Xresident","-Xshow-phases","-Xverify","-Y",
86+
"-Xnojline","-Xno-forwarders","-Xno-patmat-analysis","-Xnon-strict-patmat-analysis","-Xprint-pos","-Xprint-types","-Xprompt","-Xresident","-Xshow-phases","-Xverify","-Y",
8787
"-Ybreak-cycles","-Ydebug","-Ydebug-type-error","-Ycompact-trees","-YdisableFlatCpCaching","-Ydoc-debug",
8888
"-Yide-debug",
8989
"-Ylog-classpath","-Ymacro-debug-lite","-Ymacro-debug-verbose","-Ymacro-no-expand",

‎src/compiler/scala/tools/nsc/settings/ScalaSettings.scala‎

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,18 +100,13 @@ trait ScalaSettings extends StandardScalaSettings with Warnings { _: MutableSett
100100
valmaxwarns=IntSetting ("-Xmaxwarns","Maximum warnings to print",100,None, _=>None)
101101
valXmigration=ScalaVersionSetting ("-Xmigration","version","Warn about constructs whose behavior may have changed since version.", initial=NoScalaVersion, default=Some(AnyScalaVersion))
102102
valXnojline=BooleanSetting ("-Xnojline","Do not use JLine for editing.")
103-
.withDeprecationMessage("Replaced by -Xjline:off")
104-
.withPostSetHook(_=>Xjline.value="off")
105103
valXjline=ChoiceSetting (
106104
name="-Xjline",
107105
helpArg="mode",
108-
descr="Select JLine mode.",
109-
choices=List("emacs","vi","off"),
110-
default="emacs",
111-
choicesHelp=List(
112-
"emacs key bindings.",
113-
"vi key bindings",
114-
"No JLine editing."))
106+
descr="Select JLine mode."
107+
)
108+
.withDeprecationMessage("Replaced by use of '~/.inputrc'. Set 'editing-mode' to 'vi', 'emacs' or 'dumb'")
109+
115110
valXverify=BooleanSetting ("-Xverify","Verify generic signatures in generated bytecode.")
116111
valplugin=MultiStringSetting ("-Xplugin","paths","Load a plugin from each classpath.")
117112
valdisable=MultiStringSetting ("-Xplugin-disable","plugin","Disable plugins by name.")

‎src/manual/scala/man1/scalac.scala‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ object scalac extends Command {
239239
CmdOption("Xno-patmat-analysis"),
240240
"Don't perform exhaustivity/unreachability analysis. Also, ignore"&MItalic("@switch")&" annotation."),
241241
Definition(
242-
CmdOption("Xjline"),
243-
"TheJLinekeybindings to use: emacs/vi/off."),
242+
CmdOption("Xnojline"),
243+
"Do not useJLineat all for REPL input."),
244244
Definition(
245245
CmdOptionBound("Xplugin:",Argument("paths")),
246246
"Load a plugin from each classpath."),

‎src/partest/scala/tools/partest/ReplTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ abstract class ReplTest extends DirectTest {
3232
// final because we need to enforce the existence of a couple settings.
3333
finaloverridedefsettings:Settings= {
3434
vals=super.settings
35-
s.Xjline.value="off"
35+
s.Xnojline.value=true
3636
if (getClass.getClassLoader.getParent!=null) {
3737
s.classpath.value= s.classpath.valuematch {
3838
case""=> testOutput.toString

‎src/repl-frontend/scala/tools/nsc/interpreter/jline/Reader.scala‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ package scala.tools.nsc.interpreter
1414
packagejline
1515

1616
importorg.jline.builtins.InputRC
17-
importorg.jline.keymap.KeyMap
1817
importorg.jline.reader.Parser.ParseContext
1918
importorg.jline.reader._
2019
importorg.jline.reader.impl.{CompletionMatcherImpl,DefaultParser,LineReaderImpl}
@@ -150,8 +149,6 @@ object Reader {
150149
caseNonFatal(_)=>
151150
}//ignore
152151

153-
valkeyMap= reader.getKeyMaps.get("main")
154-
155152
objectScalaShowType {
156153
valName="scala-show-type"
157154
privatevarlastInvokeLocation:Option[(String,Int)]=None
@@ -180,13 +177,6 @@ object Reader {
180177
}
181178
reader.getWidgets().put(ScalaShowType.Name, ()=>ScalaShowType())
182179

183-
locally {
184-
importLineReader._
185-
// VIINS, VICMD, EMACS
186-
valkeymap=if (config.viMode)VIINSelseEMACS
187-
reader.getKeyMaps.put(MAIN, reader.getKeyMaps.get(keymap));
188-
keyMap.bind(newReference(ScalaShowType.Name),KeyMap.alt(KeyMap.ctrl('t')))
189-
}
190180
defsecure(p: java.nio.file.Path):Unit= {
191181
try scala.reflect.internal.util.OwnerOnlyChmod.chmodFileOrCreateEmpty(p)
192182
catch {case scala.util.control.NonFatal(e)=>

‎src/repl-frontend/scala/tools/nsc/interpreter/shell/ShellConfig.scala‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ object ShellConfig {
3838
valbatchText:String=if (settings.execute.isSetByUser) settings.execute.valueelse""
3939
valbatchMode:Boolean= batchText.nonEmpty
4040
valdoCompletion:Boolean=!(settings.noCompletion.value|| batchMode)
41-
valhaveInteractiveConsole:Boolean= settings.Xjline.value!="off"
42-
overridevalviMode=super.viMode|| settings.Xjline.value=="vi"
41+
valhaveInteractiveConsole:Boolean=!settings.Xnojline.value
4342
defxsource:String=if (settings.isScala3:@nowarn) settings.source.value.versionStringelse""
4443
}
4544
case _=>newShellConfig {
@@ -48,8 +47,7 @@ object ShellConfig {
4847
valbatchText:String=""
4948
valbatchMode:Boolean=false
5049
valdoCompletion:Boolean=!settings.noCompletion.value
51-
valhaveInteractiveConsole:Boolean= settings.Xjline.value!="off"
52-
overridevalviMode=super.viMode|| settings.Xjline.value=="vi"
50+
valhaveInteractiveConsole:Boolean=!settings.Xnojline.value
5351
defxsource:String=if (settings.isScala3:@nowarn) settings.source.value.versionStringelse""
5452
}
5553
}
@@ -62,7 +60,6 @@ trait ShellConfig {
6260
defbatchMode:Boolean
6361
defdoCompletion:Boolean
6462
defhaveInteractiveConsole:Boolean
65-
defviMode:Boolean= envOrNone("SHELLOPTS").map(_.split(":").contains("vi")).getOrElse(false)
6663

6764
// source compatibility, i.e., -Xsource
6865
defxsource:String

‎test/files/run/type-tag-leak.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ object Test extends Test {
1919
defmain(args:Array[String]):Unit= {
2020
for (i<-1 to16) {
2121
valsettings=new scala.tools.nsc.Settings
22-
settings.Xjline.value="off"
22+
settings.Xnojline.value=true
2323
settings.usejavacp.value=true
2424

2525
valintp=newIMain(settings,new shell.ReplReporterImpl(settings,newPrintWriter(newStringWriter)))

‎test/junit/scala/tools/nsc/interpreter/CompletionTest.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class CompletionTest {
1313

1414
defnewIMain(classBased:Boolean=false):IMain= {
1515
valsettings=newSettings()
16-
settings.Xjline.value="off"
16+
settings.Xnojline.value=true
1717
settings.usejavacp.value=true
1818
settings.Yreplclassbased.value= classBased
1919

‎test/macro-annot/run/repl/repl_2.scala‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import scala.tools.nsc.interpreter.shell._
44
objectTestextendsApp {
55
privatedefrepl(code:String):String= {
66
vals=newSettings
7-
s.Xjline.value="off"
7+
s.Xnojline.value=true
88
s.usejavacp.value=false
99
s.classpath.value= sys.props("sbt.paths.tests.classpath")
1010
s.plugin.value=List(sys.props("sbt.paths.plugin.jar"))

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp