Skip to content

Commit

Permalink
No LS logging to a specific file in the workspace by default
Browse files Browse the repository at this point in the history
  • Loading branch information
BoykoAlex committed Apr 28, 2023
1 parent ef0e601 commit 7a689ba
Showing 1 changed file with 7 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@

import static org.springframework.tooling.ls.eclipse.commons.preferences.LanguageServerConsolePreferenceConstants.ENABLE_BY_DEFAULT;

import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
import org.eclipse.jface.preference.IPreferenceStore;
import org.osgi.framework.Bundle;
import org.springframework.tooling.ls.eclipse.commons.preferences.LanguageServerConsolePreferenceConstants.ServerInfo;

public class PrefsInitializer extends AbstractPreferenceInitializer {
Expand All @@ -26,13 +23,13 @@ public void initializeDefaultPreferences() {
ServerInfo[] installedServers = LsPreferencesUtil.getInstalledLs();
for (ServerInfo s : installedServers) {
store.setDefault(s.preferenceKeyConsoleLog, ENABLE_BY_DEFAULT);
Bundle bundle = Platform.getBundle(s.bundleId);
if (bundle != null) {
IPath stateLocation = Platform.getStateLocation(bundle);
if (stateLocation != null) {
store.setDefault(s.preferenceKeyFileLog, stateLocation.append(s.label.toLowerCase().replaceAll("\\s+", "-") + ".log").toFile().getAbsoluteFile().getPath());
}
}
// Bundle bundle = Platform.getBundle(s.bundleId);
// if (bundle != null) {
// IPath stateLocation = Platform.getStateLocation(bundle);
// if (stateLocation != null) {
// store.setDefault(s.preferenceKeyFileLog, stateLocation.append(s.label.toLowerCase().replaceAll("\\s+", "-") + ".log").toFile().getAbsoluteFile().getPath());
// }
// }
}
store.setDefault(PreferenceConstants.HIGHLIGHT_CODELENS_PREFS, false);
}
Expand Down

0 comments on commit 7a689ba

Please sign in to comment.