You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/amazonq/shared/jetbrains-community/src/software/aws/toolkits/jetbrains/services/amazonq/lsp/AmazonQLspService.kt
+37-34Lines changed: 37 additions & 34 deletions
Original file line number
Diff line number
Diff line change
@@ -633,21 +633,23 @@ private class AmazonQServerInstance(private val project: Project, private val cs
633
633
}
634
634
}
635
635
636
-
if (Files.exists(nodePath) &&Files.isExecutable(nodePath)) {
637
-
resolveNodeMetric(true, true)
638
-
return nodePath
639
-
}
640
-
641
-
// use alternative node runtime if it is not found
642
-
LOG.warn { "Node Runtime download failed. Fallback to user specified node runtime " }
643
636
// attempt to use user provided node runtime path
644
637
val nodeRuntime =LspSettings.getInstance().getNodeRuntimePath()
645
638
if (!nodeRuntime.isNullOrEmpty()) {
646
639
LOG.info { "Using node from $nodeRuntime" }
647
640
648
641
resolveNodeMetric(false, true)
649
642
returnPath.of(nodeRuntime)
643
+
}
644
+
645
+
// attempt to use bundled node
646
+
if (Files.exists(nodePath) &&Files.isExecutable(nodePath) && validateNode(nodePath) !=null) {
647
+
resolveNodeMetric(true, true)
648
+
return nodePath
650
649
} else {
650
+
// use alternative node runtime if it is not found
651
+
LOG.warn { "Node Runtime download failed. Fallback to user environment search" }
652
+
651
653
val localNode = locateNodeCommand()
652
654
if (localNode !=null) {
653
655
LOG.info { "Using node from ${localNode.toAbsolutePath()}" }
@@ -689,34 +691,35 @@ private class AmazonQServerInstance(private val project: Project, private val cs
0 commit comments