Skip to content

Conversation

@arajkumar
Copy link
Contributor

@arajkumar arajkumar commented Feb 8, 2021

This PR eliminates the need to have nodejs runtime on the developer machine. It is just a first step towards making IJ analytics plugin in sync with it's vscode counterpart.

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar force-pushed the download-bundled-lsp branch from 7de6c1b to e9b8434 Compare February 8, 2021 13:24
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
strategy:
matrix:
IJ: [IC-2018.1, IC-2018.2, IC-2018.3, IC-2019.1, IC-2019.2, IC-2019.3, IC-2020.1, IC-2020.2, IC-2020.3]
IJ: [IC-2019.1, IC-2019.2, IC-2019.3, IC-2020.1, IC-2020.2, IC-2020.3]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the rationale for removing those versions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because those weren't supporting new APIs Service and PersistentState. Do we really need to support those old versions as well?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will add telemetry that will give use versions of IJ that are just. Before that, keep current state

Copy link
Contributor Author

@arajkumar arajkumar Feb 11, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffmaury how about keep the supported version in sync with tekton? That seems reasonable to me. WDTY?
https://github.com/redhat-developer/intellij-tekton/blob/master/.github/workflows/IJ.yml#L17

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I told you, the motivation to change supported version will be based on telemetry. Let me know if you can't cope with the current state and I will do the job to adapt your PR

this.lspBundleName = lspBundleName;
}

static Platform detect(Properties systemProperties) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not required, IntelliJ SDK provides com.intellij.openapi.util.SystemInfo

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ack!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed it.

<externalAnnotator id="LSPAnnotator-xml" language="XML" implementationClass="org.wso2.lsp4intellij.contributors.annotator.LSPAnnotator"/>
<externalAnnotator id="LSPAnnotator-json" language="JSON" implementationClass="org.wso2.lsp4intellij.contributors.annotator.LSPAnnotator"/>
<externalAnnotator id="LSPAnnotator-txt" language="TEXT" implementationClass="org.wso2.lsp4intellij.contributors.annotator.LSPAnnotator"/>
<postStartupActivity implementation="org.jboss.tools.intellij.analytics.PostStartupActivity"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for having it implemented as application component is that postStartupActivity is delayed and thus if you have opened documents when you open a project, the LSP may not be started.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works. Also intellij doc says application component is deprecated.

https://plugins.jetbrains.com/docs/intellij/plugin-components.html

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes but deprecated does not mean removed. So my concern is that if the file is already opened then seems the LSP is started but I can't see the decorations on the file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeffmaury I see similar issue even without this change. Can you just try adding a dummy line in the manifest to see whether it could decorate? it is a bug for sure, just want to check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure to understand. If I comment this line out, then LSP won't be started at all. So If this is like before then we're good.

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar force-pushed the download-bundled-lsp branch from e63e3b9 to 8d09142 Compare February 9, 2021 10:02
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
//LSP plugin causes this task to fail
buildSearchableOptions.enabled = false

task downloadFile(type: Download) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The download plugin must be removed as well

@jeffmaury
Copy link
Member

Also while testing it, I got the following error:

java.lang.NullPointerException
	at org.jboss.tools.intellij.analytics.LSPBundle.isNewRelease(LSPBundle.java:73)
	at org.jboss.tools.intellij.analytics.LSPBundle.downloadIfNeeded(LSPBundle.java:80)
	at org.jboss.tools.intellij.analytics.LSPBundle$1.run(LSPBundle.java:62)
	at com.intellij.openapi.progress.impl.CoreProgressManager$TaskRunnable.run(CoreProgressManager.java:888)
	at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:163)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:585)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:531)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:59)
	at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:150)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.lambda$run$0(CoreProgressManager.java:402)
	at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:221)
	at com.intellij.openapi.progress.impl.CoreProgressManager$4.run(CoreProgressManager.java:402)
	at com.intellij.openapi.application.impl.ApplicationImpl$1.run(ApplicationImpl.java:238)
	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar force-pushed the download-bundled-lsp branch from f4726c6 to d89fbb8 Compare February 17, 2021 11:23
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar requested a review from jeffmaury February 17, 2021 11:52
@arajkumar
Copy link
Contributor Author

@jeffmaury rebased and kept 2020.1 as minimum support IJ version. PTAL

Copy link
Member

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last piece before we can merge: remove the download plugin from build.gradle

build.gradle Outdated
plugins {
id "org.jetbrains.intellij" version "0.4.21"
id 'de.undercouch.download' version '3.4.3'
id 'de.undercouch.download' version '3.4.3'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be removed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@arajkumar arajkumar requested a review from jeffmaury February 17, 2021 12:25
Signed-off-by: Arunprasad Rajkumar <ar.arunprasad@gmail.com>
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

Copy link
Member

@jeffmaury jeffmaury left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jeffmaury jeffmaury merged commit daf877c into redhat-developer:master Feb 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants