package org.rust.ide.utils

import com.intellij.openapi.fileEditor.impl.UniqueNameEditorTabTitleProvider
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import org.rust.lang.core.psi.isRustFile

class RsModTabTitleProvider : UniqueNameEditorTabTitleProvider() {
    val MOD_FILE_NAME = "mod.rs"

    override fun getEditorTabTitle(project: Project, file: VirtualFile): String? {
        if (file.isRustFile && MOD_FILE_NAME == file.name) {
            return super.getEditorTabTitle(project, file) ?:
                "${file.parent.name}/${file.name}"
        }

        return null
    }
}

package org.rust.ide.utils

import com.intellij.openapi.fileEditor.impl.UniqueNameEditorTabTitleProvider
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import org.rust.lang.core.psi.isRustFile
import java.io.File

class RsModTabTitleProvider : UniqueNameEditorTabTitleProvider() {
    val MOD_FILE_NAME = "mod.rs"

    override fun getEditorTabTitle(project: Project, file: VirtualFile): String? {
        if (file.isRustFile && MOD_FILE_NAME == file.name) {
            return super.getEditorTabTitle(project, file) ?:
                "${file.parent.name}${File.separator}${file.name}"
        }

        return null
    }
}

Fix mod.rs tab names on Windows
Fix mod.rs tab names on Windows

close #1043

alygin/intellij-rust,intellij-rust/intellij-rust,alygin/intellij-rust,alygin/intellij-rust,anton-okolelov/intellij-rust,intellij-rust/intellij-rust,intellij-rust/intellij-rust,anton-okolelov/intellij-rust,d9n/intellij-rust,himikof/intellij-rust,d9n/intellij-rust,alygin/intellij-rust,Undin/intellij-rust,himikof/intellij-rust,Undin/intellij-rust,alygin/intellij-rust,d9n/intellij-rust,Undin/intellij-rust,himikof/intellij-rust,himikof/intellij-rust,anton-okolelov/intellij-rust,d9n/intellij-rust,Undin/intellij-rust,anton-okolelov/intellij-rust,intellij-rust/intellij-rust,anton-okolelov/intellij-rust,Undin/intellij-rust,himikof/intellij-rust,intellij-rust/intellij-rust,intellij-rust/intellij-rust,Undin/intellij-rust,d9n/intellij-rust