You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@netbeans.apache.org by GitBox <gi...@apache.org> on 2021/01/21 11:17:42 UTC

[GitHub] [netbeans] dbalek opened a new pull request #2698: Restart NBLS when an extension providing some NB cluster is installed/uninstalled.

dbalek opened a new pull request #2698:
URL: https://github.com/apache/netbeans/pull/2698


   Language Server should be restarted whenever an extension providing its part (e.g. nbjavac) is installed/uninstalled.


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2698: Restart NBLS when an extension providing some NB cluster is installed/uninstalled.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2698:
URL: https://github.com/apache/netbeans/pull/2698#discussion_r562358499



##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -156,6 +157,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
 
     // find acceptable JDK and launch the Java part
     findJDK((specifiedJDK) => {
+        context.subscriptions.push(vscode.extensions.onDidChange(() => {
+            const currentClustersSorted = currentClusters.slice().sort();

Review comment:
       keep the global state somewhere here, if possible.

##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -66,7 +67,7 @@ export function enableConsoleLog() {
 }
 
 export function findClusters(myPath : string): string[] {

Review comment:
       This is an exported function, I'd prefer to keep it pure (e.g. without side effects).

##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -156,6 +157,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
 
     // find acceptable JDK and launch the Java part
     findJDK((specifiedJDK) => {
+        context.subscriptions.push(vscode.extensions.onDidChange(() => {
+            const currentClustersSorted = currentClusters.slice().sort();
+            const newClusters = findClusters(context.extensionPath);
+            if (newClusters.length !== currentClustersSorted.length || newClusters.sort().find((value, index) => value !== currentClustersSorted[index])) {

Review comment:
       Wow. That's a functional programming!




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] dbalek merged pull request #2698: Restart NBLS when an extension providing some NB cluster is installed/uninstalled.

Posted by GitBox <gi...@apache.org>.
dbalek merged pull request #2698:
URL: https://github.com/apache/netbeans/pull/2698


   


----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] JaroslavTulach commented on a change in pull request #2698: Restart NBLS when an extension providing some NB cluster is installed/uninstalled.

Posted by GitBox <gi...@apache.org>.
JaroslavTulach commented on a change in pull request #2698:
URL: https://github.com/apache/netbeans/pull/2698#discussion_r562358499



##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -156,6 +157,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
 
     // find acceptable JDK and launch the Java part
     findJDK((specifiedJDK) => {
+        context.subscriptions.push(vscode.extensions.onDidChange(() => {
+            const currentClustersSorted = currentClusters.slice().sort();

Review comment:
       keep the global state somewhere here, if possible.

##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -66,7 +67,7 @@ export function enableConsoleLog() {
 }
 
 export function findClusters(myPath : string): string[] {

Review comment:
       This is an exported function, I'd prefer to keep it pure (e.g. without side effects).

##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -156,6 +157,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
 
     // find acceptable JDK and launch the Java part
     findJDK((specifiedJDK) => {
+        context.subscriptions.push(vscode.extensions.onDidChange(() => {
+            const currentClustersSorted = currentClusters.slice().sort();
+            const newClusters = findClusters(context.extensionPath);
+            if (newClusters.length !== currentClustersSorted.length || newClusters.sort().find((value, index) => value !== currentClustersSorted[index])) {

Review comment:
       Wow. That's a functional programming!




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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


[GitHub] [netbeans] dbalek commented on a change in pull request #2698: Restart NBLS when an extension providing some NB cluster is installed/uninstalled.

Posted by GitBox <gi...@apache.org>.
dbalek commented on a change in pull request #2698:
URL: https://github.com/apache/netbeans/pull/2698#discussion_r562469069



##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -66,7 +67,7 @@ export function enableConsoleLog() {
 }
 
 export function findClusters(myPath : string): string[] {

Review comment:
       Fixed.

##########
File path: java/java.lsp.server/vscode/src/extension.ts
##########
@@ -156,6 +157,13 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
 
     // find acceptable JDK and launch the Java part
     findJDK((specifiedJDK) => {
+        context.subscriptions.push(vscode.extensions.onDidChange(() => {
+            const currentClustersSorted = currentClusters.slice().sort();

Review comment:
       Fixed.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@netbeans.apache.org
For additional commands, e-mail: notifications-help@netbeans.apache.org

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