package com.sasslint.settings;

import com.intellij.openapi.components.*;
import com.intellij.openapi.project.Project;
import com.intellij.util.xmlb.XmlSerializerUtil;
import org.jetbrains.annotations.Nullable;

@State(name = "SassLintProjectComponent",
        storages = {
                @Storage(id = "default", file = StoragePathMacros.PROJECT_FILE),
                @Storage(id = "dir", file = StoragePathMacros.PROJECT_CONFIG_DIR + "/sasslintPlugin.xml", scheme = StorageScheme.DIRECTORY_BASED)})
public class Settings implements PersistentStateComponent<Settings> {
    public String configFile = "";
    public String rulesPath = "";
    public String builtinRulesPath = "";
    public String extensions = "";
    public String lintExecutable = "";
    public String nodeInterpreter;
    public boolean treatAllIssuesAsWarnings;
    public boolean pluginEnabled;

    protected Project project;

    public static Settings getInstance(Project project) {
        Settings settings = ServiceManager.getService(project, Settings.class);
        settings.project = project;
        return settings;
    }

    @Nullable
    @Override
    public Settings getState() {
        return this;
    }

    @Override
    public void loadState(Settings state) {
        XmlSerializerUtil.copyBean(state, this);
    }

    public String getVersion() {
        return nodeInterpreter + lintExecutable + configFile + rulesPath + builtinRulesPath + extensions;
    }
}

@@ -161,16 +161,58 @@
 erUtil;%0A
+import org.jetbrains.annotations.NotNull;%0A
 import o
@@ -254,16 +254,25 @@
 %0A@State(
+%0A        
 name = %22
@@ -321,237 +321,39 @@
 s = 
-%7B%0A                @Storage(id = %22default%22, file = StoragePathMacros.PROJECT_FILE),%0A                @Storage(id = %22dir%22, file = StoragePathMacros.PROJECT_CONFIG_DIR + %22/sasslintPlugin.xml%22, scheme = StorageScheme.DIRECTORY_BASED)%7D
+@Storage(%22sasslintPlugin.xml%22)%0A
 )%0Apu
@@ -1086,16 +1086,25 @@
 adState(
+@NotNull 
 Settings

fix deprecations