matthiasblaesing commented on a change in pull request #2877:
URL: https://github.com/apache/netbeans/pull/2877#discussion_r624151427



##########
File path: 
cpplite/cpplite.project/src/org/netbeans/modules/cpplite/project/ui/wizard/CPPLiteProjectWizardIterator.java
##########
@@ -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());

Review comment:
       I suggest to use the following, to be inline with the existing code in 
line 81:
   
   ```suggestion
           prefs.put(KEY_COMPILE_COMMANDS, settings.getEditorConfigPath())
   ```

##########
File path: 
cpplite/cpplite.project/src/org/netbeans/modules/cpplite/project/ui/wizard/CPPLiteProjectWizardIterator.java
##########
@@ -33,7 +33,9 @@
 import org.netbeans.api.templates.TemplateRegistration;
 import org.netbeans.modules.cpplite.project.BuildConfiguration;
 import org.netbeans.modules.cpplite.project.CPPLiteProject;
+import static 
org.netbeans.modules.cpplite.project.CPPLiteProject.KEY_COMPILE_COMMANDS;
 import static 
org.netbeans.modules.cpplite.project.CPPLiteProject.getBuildPreferences;
+import static 
org.netbeans.modules.cpplite.project.CPPLiteProject.getRootPreferences;

Review comment:
       Can be dropped with the change in line 83.

##########
File path: 
cpplite/cpplite.editor/src/org/netbeans/modules/cpplite/editor/lsp/LanguageServerImpl.java
##########
@@ -177,16 +183,13 @@ private static File 
getCompileCommandsDir(CProjectConfigurationProvider configPr
                     LOG.log(Level.WARNING, null, ex);
                     return null;
                 }
-            } else if (config.commandJsonPath != null) {
-                File commandsPath = new File(config.commandJsonPath);
-                if (commandsPath.canRead()) {
-                    try (InputStream in = new FileInputStream(commandsPath);
-                         OutputStream out = new FileOutputStream(tempFile)) {
-                        FileUtil.copy(in, out);
-                    } catch (IOException ex) {
-                        LOG.log(Level.WARNING, null, ex);
-                        return null;
-                    }
+            } else if (config.commandJsonPath != null && 
commandsPath.canRead()) {

Review comment:
       I would simplify to 
   
   ```suggestion
               } else if (commandsPath != null && commandsPath.canRead()) {
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to