This repository was archived by the owner on Jul 25, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ class HtmlView(title: String) extends js.Object {
2626object Metals extends ScalaLanguageServer { server =>
2727 val name : String = " metals"
2828 val description : String = " Metals"
29- val defaultVersion : String = " 0.5.2 "
29+ val defaultVersion : String = " 0.6.1 "
3030
3131 def trigger (projectPath : String ): Boolean = {
3232 (projectPath / " .metals" ).isDirectory
@@ -109,6 +109,21 @@ object Metals extends ScalaLanguageServer { server =>
109109 }
110110 })
111111
112+ // Send windowStateDidChange notification to Metals every time window is in/out of focus
113+ Atom .asInstanceOf [js.Dynamic ].getCurrentWindow()
114+ .on(" focus" , { _ : js.Any =>
115+ connection.sendCustomNotification(
116+ " metals/windowStateDidChange" ,
117+ js.Dynamic .literal(" focused" -> true )
118+ )
119+ })
120+ .on(" blur" , { _ : js.Any =>
121+ connection.sendCustomNotification(
122+ " metals/windowStateDidChange" ,
123+ js.Dynamic .literal(" focused" -> false )
124+ )
125+ })
126+
112127 Atom .workspace.onDidChangeActiveTextEditor { editorOrUndef =>
113128 for {
114129 editor <- editorOrUndef
You can’t perform that action at this time.
0 commit comments