2017-12-12 11 views
0

스칼라 패턴 매칭에 사용되는 일반적인 기호는 오른쪽 화살표, ⇒ 또는 =>입니다. 그래서 내 질문은 ⇒ 오른쪽 화살표를보고 깔끔하게 입력하는 바로 가기가 무엇입니까? Mac OS에서 IntelliJ를 사용합니다.IntelliJ Mac OS에서 오른쪽 화살표 (예 : ⇒, not =>)를 입력하는 방법은 무엇입니까?

아래이 기호를 사용 https://doc.akka.io/docs/akka/current/guide/tutorial_1.html

package com.lightbend.akka.sample 

import akka.actor.{ Actor, Props, ActorSystem } 
import scala.io.StdIn 

class PrintMyActorRefActor extends Actor { 
    override def receive: Receive = { 
    case "printit" ⇒ 
     val secondRef = context.actorOf(Props.empty, "second-actor") 
     println(s"Second: $secondRef") 
    } 
} 

object ActorHierarchyExperiments extends App { 
    val system = ActorSystem("testSystem") 

    val firstRef = system.actorOf(Props[PrintMyActorRefActor], "first-actor") 
    println(s"First: $firstRef") 
    firstRef ! "printit" 

    println(">>> Press ENTER to exit <<<") 
    try StdIn.readLine() 
    finally system.terminate() 
} 

답변

4

대부분의 프로젝트에서 ⇒을 사용하는 예제 코드, 당신이 그것을 작성한 후 자동으로 =>을 변경 Scalariform 같은 도구를 사용합니다.

개인적으로는 좋은 화살표 등을 렌더링하기 위해 합자 (예 : Fira Code)가있는 글꼴을 사용하는 것이 좋습니다.

2

설정 탭 (Linux의 파일 => 설정, Mac OS의 경우 비슷 함)에서 편집기 => 라이브 템플릿을 통해 라이브 템플릿으로 추가하십시오.

See here for more info