Skip to content

Commit

Permalink
Rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
InSyncWithFoo committed May 28, 2024
1 parent 934cb2c commit ac5dd2d
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ internal fun Configurable.configurationPanel(state: Configurations) = panel {
group(message("configurations.group.languageServer")) {
row(message("configurations.targetedFileExtensions.label")) {
makeTargetedFileExtensionsInput {
comment(message("configurations.targetedFileExtensions.comment"))
bindText(
{ state.targetedFileExtensions.orEmpty().deduplicate() },
{ state.targetedFileExtensions = it.deduplicate() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import com.insyncwithfoo.pyrightls.message
import com.intellij.openapi.components.BaseState


internal typealias FileExtension = String
internal typealias DelimitedFileExtensionList = String
private const val FILE_EXTENSIONS_DELIMITER = "|"


private const val fileExtensionsDelimiter = "|"
internal typealias FileExtension = String
internal typealias DelimitedFileExtensionList = String


private fun FileExtension.normalize() = this.trim().lowercase()
Expand All @@ -19,11 +19,11 @@ private fun List<FileExtension>.toSetOfNormalized(): Set<FileExtension> =


internal fun DelimitedFileExtensionList.split(): MutableList<FileExtension> =
this.split(fileExtensionsDelimiter).toSetOfNormalized().toMutableList()
this.split(FILE_EXTENSIONS_DELIMITER).toSetOfNormalized().toMutableList()


internal fun List<FileExtension>.join() =
this.toSetOfNormalized().joinToString(fileExtensionsDelimiter)
this.toSetOfNormalized().joinToString(FILE_EXTENSIONS_DELIMITER)


internal fun DelimitedFileExtensionList.deduplicate() =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,6 @@ private val Project.pyrightLSExecutable: Path?
}


internal val VirtualFile.isSupported: Boolean
get() = extension == "py"


@Suppress("UnstableApiUsage")
internal class PyrightLSSupportProvider : LspServerSupportProvider {

Expand Down
1 change: 0 additions & 1 deletion src/main/resources/messages/pyrightls.properties
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ configurations.workspaceFolders.projectBase = Project base directories
configurations.workspaceFolders.sourceRoots = Source roots

configurations.targetedFileExtensions.label = Targeted file extensions:
configurations.targetedFileExtensions.comment = List of extensions of files on which the language server should be run.

configurations.hint.fileFound = File found
configurations.hint.fileNotExecutable = File is not executable
Expand Down

0 comments on commit ac5dd2d

Please sign in to comment.