Skip to content

fix: Update settings to save file path to config file and not the config file directory #157

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

### Fixed

- Fix Manual configuration to save the correct file path to the Oxlint config file.

## [0.0.2] - 2025-04-15

### Fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
package com.github.oxc.project.oxcintellijplugin.settings

import com.github.oxc.project.oxcintellijplugin.settings.OxcSettingsState.Companion.DEFAULT_EXTENSION_LIST
import com.intellij.openapi.components.*
import com.intellij.openapi.components.Service
import com.intellij.openapi.components.SettingsCategory
import com.intellij.openapi.components.SimplePersistentStateComponent
import com.intellij.openapi.components.State
import com.intellij.openapi.components.Storage
import com.intellij.openapi.components.service
import com.intellij.openapi.project.Project
import com.intellij.openapi.vfs.VirtualFile
import java.io.File

@Service(Service.Level.PROJECT)
@State(name = "OxcSettings", storages = [Storage("OxcSettings.xml")],
Expand Down Expand Up @@ -34,11 +38,6 @@ class OxcSettings(private val project: Project) :
var configPath: String
get() = state.configPath ?: ""
set(value) {
val file = File(value)
if (file.isFile) {
state.configPath = file.parentFile.path
return
}
state.configPath = value
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/resources/messages/OxcBundle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
oxc.config.path.label=Path to .oxlintrc.json
oxc.config.path.label=Path to Oxlint Config File
oxc.configure.extensions.link=Configure file extensions
oxc.file.not.supported.description=The file "{0}" is not supported by Oxc.
oxc.file.not.supported.title=Unsupported file
Expand All @@ -24,4 +24,4 @@ oxc.settings.languageServerPath=Path to Oxc Language Server
oxc.settings.oxlintRunTrigger=Oxlint Execution Trigger
oxc.settings.selectPathToLanguageServer=Select Path to Oxc Language Server
oxc.supported.extensions.comment=Enter file extensions separated by commas (e.g., .js, .ts, .jsx). Each extension must start with '.' and contain only alphanumeric characters.
oxc.supported.extensions.label=Supported File Extensions:
oxc.supported.extensions.label=Supported File Extensions:
Loading