Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
fqqb committed Sep 21, 2023
1 parent 873a84d commit 7abdce4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import java.util.Optional;
import java.util.Properties;

import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.ConfigurationScope;

public class SiteConfiguration {
Expand All @@ -24,8 +25,15 @@ public class SiteConfiguration {
static {
// Read site-specific configuration, this can be used to toggle some functionality
// in a site-controlled manner.

System.out.println("Platform location " + Platform.getLocation());
System.out.println("Platform install location " + Platform.getInstallLocation().getURL());
System.out.println("Platform conf location " + Platform.getConfigurationLocation().getURL());

var configLocation = ConfigurationScope.INSTANCE.getLocation().toFile();
System.out.println("Check for location " + configLocation);
var configFile = new File(configLocation, "site-config.ini");
System.out.println("File exists ? " + configFile.exists());
if (configFile.exists()) {
try (var fileIn = Files.newInputStream(configFile.toPath())) {
props.load(fileIn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ public boolean isSpellEnabled() {
var spellEnabled = getPreferenceStore().getBoolean("spell.enabled");

var override = SiteConfiguration.isSpellEnabled();
System.out.println("Override present ? " + override.isPresent());
if (override.isPresent()) {
System.out.println("enabled " + override.get());
spellEnabled = override.get();
}
return spellEnabled;
Expand Down

0 comments on commit 7abdce4

Please sign in to comment.