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
Fixing newly created cpplite project, avoiding starting the C/C++ LSP server when the configuration is not readable. #2877
Fixing newly created cpplite project, avoiding starting the C/C++ LSP server when the configuration is not readable. #2877
Conversation
… server when the configuration is not readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know much about the CPPLite code, but I suggest to get this into master, so that is does not bit rot. I left a few inline comments, that I think should be addressed though.
@@ -78,6 +80,7 @@ public Set instantiate() throws IOException { | |||
Preferences prefs = CPPLiteProject.getRootPreferences(projectDirectory); | |||
prefs.putBoolean(CPPLiteProject.KEY_IS_PROJECT, true); | |||
settings.getBuildConfig().save(getBuildPreferences(projectDirectory)); | |||
getRootPreferences(projectDirectory).put(KEY_COMPILE_COMMANDS, settings.getEditorConfigPath()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest to use the following, to be inline with the existing code in line 81:
getRootPreferences(projectDirectory).put(KEY_COMPILE_COMMANDS, settings.getEditorConfigPath()); | |
prefs.put(KEY_COMPILE_COMMANDS, settings.getEditorConfigPath()) |
LOG.log(Level.WARNING, null, ex); | ||
return null; | ||
} | ||
} else if (config.commandJsonPath != null && commandsPath.canRead()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would simplify to
} else if (config.commandJsonPath != null && commandsPath.canRead()) { | |
} else if (commandsPath != null && commandsPath.canRead()) { |
import static org.netbeans.modules.cpplite.project.CPPLiteProject.getBuildPreferences; | ||
import static org.netbeans.modules.cpplite.project.CPPLiteProject.getRootPreferences; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be dropped with the change in line 83.
Import changes from #2877 and do followup fixes
No description provided.