Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
Etan Shaul
@etanshaul
and in build.gradle:
Yann Cébron
@YannCebron
ok, just double-checking. because Git plugin could be disabled by user
Etan Shaul
@etanshaul
can it? I just checked that and I didn't see the plugin appearing in the repository
ah nm. I do see that now
either way, its not an optional-depends
tanner-bruce
@tanner-bruce
where do I get the version for the goland / rubymine / pycharm plugins for my build.gradle?
intellij { version "2019.2" plugins "PythonCore:2019.2.192.6262.58" }
tanner-bruce
@tanner-bruce
is there a way to use rubymine instead of idea for the runIde gradle task? I need to test some ruby specific runconfiguration stuff
nexoscp
@nexoscp
@tanner-bruce when building with https://github.com/JetBrains/gradle-intellij-plugin/ in the "intellij" section use "type" . using this for testing my clion integration
Mike Bond
@mikeb1_gitlab
@nexoscp - Can you paste your intellij section here?
I'm trying to do the same thing to launch PyCharm
Patrick Scheibe
@halirutan
@tanner-bruce @nexoscp @mikeb1_gitlab Guys/Girls, running is different from building!
To use a different IDE for running your plugin in the runIde task, you use something like this
alternativeIdePath = "/home/patrick/workspace/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.5728.105"
Specifying the SDK you like to build your plugin against, can be done by setting type
I assume (I never tested this) if you specify type and build your plugin with, e.g. Android Studio, then this is also used for the running sandbox.
I'm always building with IDEA but sometimes I test my plugins on other IDEs by specifying an alternativePath.
nexoscp
@nexoscp
@mikeb1_gitlab intellij { version = "2019.2" type = "CL" setPlugins("com.jetbrains.plugins.ini4idea:192.5728.26") }
CL is for CLion.
Megan Tracy
@megantracy93
When working with CodeInsightTestFixture, does anyone know the main difference between copyFileToProject and addFileToProject? I'm testing the fileCreated function of a VirtualFileListener and it seems that just copying the test file does not consistently trigger the fileCreated method in the listener, while adding the file does.
tanner-bruce
@tanner-bruce
@halirutan thanks! very helpful
tanner-bruce
@tanner-bruce
is there a way to reload a plugin while using the runIde task without restarting the IDE?
Patrick Scheibe
@halirutan
@tanner-bruce If you debug, you can make certain changes, recompile and the plugin is reloaded automatically (it will give you a small green messages).
As usual with reloading changed classes, when you make bigger changes like adding methods, a hot-swap might not be possible.
Yann Cébron
@YannCebron
FWIW we're going to upgrade and add missing docs on how to target non-IntelliJ IDEs very soon, stay tuned. remarks from Patrick are correct
Tomasz Błachut
@tomblachut

Hey, anyone has thoughts on parsing rest of the input not parsed by parser A with parser B?

I have lang fragment that looks like that assets as asset. as keyword glues together 2 embedded JS elements. assets is a JS expression, asset is a JS parameter. they can be of arbitrary complexity, contain destructuring, calls, operators etc and even variable as. as+as as as is valid syntax with 3 different as. as({x: as}).as as {as} is valid too. You get the idea.

I don't want to reimplement JS parsing because it could get outdated eg when new operator is introduced but more importantly I don't know all the rules and don't want to spend time on learning them. Now i'm splitting it into as and 2 lazy tokens with some wonky code and i want to get rid of that.

I'm thinking on creating lazy element type that does such "cooperative" parsing. Is it even reasonable? My main issue for now is that lexer is bound to PsiBuilder and my case requires two of them, but the builder will error when eof is not reached. That could be handled by collapsing rest of the input to yet another lazy token, parsing that with parser BN and then flattening tree by hand if required.

sorry if i mixed something up but I think you'll agree that parsing in idea is very clever but also convoluted

tanner-bruce
@tanner-bruce
does this look correct? It is basically identical to my one for IDEA but my code isn't getting executed
<idea-plugin version="2">
    <extensions defaultExtensionNs="org.jetbrains.plugins.ruby">
        <runConfigurationExtension implementation="com.shopify.shadowenv.products.rubymine.RubyMineRunConfigurationExtension" id="envfileRubyMine"/>
    </extensions>
</idea-plugin>
Yann Cébron
@YannCebron
@tanner-bruce WDYM with "code isn't executed", com.intellij.execution.configuration.RunConfigurationExtensionBase#isApplicableFor not called at all?
tanner-bruce
@tanner-bruce
image.png
:facepalm:
the <depends>...java</depends> was causing it to not be loaded
Robert Ekendahl
@rekendahl
I’m working with stubs (which was probably a mistaken optimization done a long time ago). It’s working ok and I make use of indexStub to find elements I’m interested in. I have a question: Is there anytime com.intellij.psi.stub.IStubElementType.shouldCreateStub should not return true? The rust project only creates a stub if the parent is a stub. By “default” I’m doing the same but I’m leaning towards removing the override as I just got burned on it.
tanner-bruce
@tanner-bruce
anyone have a thought on how I can override the Ruby/Go SDK used in a default Ruby / Go RunConfiguration? I have RunConfigurationExtensions setup for them now, and I am able to figure out which version I should be running there however am not able to actually use it

I tried doing this:

        Sdk sdk = ProjectJdkTable.getInstance().findJdk("chruby: " + rv);
        configuration.setAlternativeSdk(sdk);
        configuration.setShouldUseAlternativeSdk(true);

but receive an error message when actually running it

image.png
Robert Ekendahl
@rekendahl
Regarding stubs.shouldCreateStub: I understand how it would be a great resource for debugging to not create a stub if the parent isn’t a stub. That way it’s easier to find where stubbing breaks down. But I don’t see how it should be a problem mixing a stub inside a not stubbed object?
tanner-bruce
@tanner-bruce
hm, I've got it sort of working, however you have to Run the configuration once, and then it adjusts the SDK, and then all subsequent run use the new version
I wonder if i can extend a sort of SaveRubyRunConfiguration or Create...
Yann Cébron
@YannCebron
@rekendahl there's a note about it here, does that clarify? http://www.jetbrains.org/intellij/sdk/docs/basics/indexing_and_psi_stubs/stub_indexes.html
Robert Ekendahl
@rekendahl
Somewhat. Makes me more confident that I can return true for it. Makes me realize that I might now want to stub if I’m inside my macro inserted code though as it can be dependent on outside file changes.
Mike Bond
@mikeb1_gitlab

Trying to follow the documentation for LineMarkerProvider (https://upsource.jetbrains.com/idea-ce/file/idea-ce-e97504227f5f68c58cd623c8f317a134b6d440b5/platform/lang-api/src/com/intellij/codeInsight/daemon/LineMarkerProvider.java) and the recommendations for Please create line marker info for leaf elements only, etc. This works fine for IDEA; however, in PyCharm, the node classes are different and I'm having trouble finding the correct node. At the moment, my marker is being adding 4 times on the same line.
These are the log lines from adding the line markers:

sourceFileLineNumber(4) Valid element found: [PsiElement(Py:CLASS_KEYWORD)], parent: [PyClass: MyClass], range: [(26,31)] 
sourceFileLineNumber(4) Valid element found: [PsiWhiteSpace], parent: [PyClass: MyClass], range: [(31,32)] 
sourceFileLineNumber(4) Valid element found: [PsiElement(Py:IDENTIFIER)], parent: [PyClass: MyClass], range: [(32,39)] 
sourceFileLineNumber(4) Valid element found: [PsiElement(Py:COLON)], parent: [PyClass: MyClass], range: [(39,40)] 
sourceFileLineNumber(4) Valid element found: [PsiWhiteSpace], parent: [PyClass: MyClass], range: [(40,46)]

Any suggestions (I'm also trying to use the PsiViewer add-on to find elements)?

tanner-bruce
@tanner-bruce
When is it possible to update the SDK a RunConfiguration is using?
I'm trying to find a way to dynamically patch the SDK RunConfigurations use based on external data. I have the external data being pulled in fine, I am just trying to figure out where to actually do the work. Doing it in extendCreatedConfiguration causes an error to be thrown when trying to run it
Amol Grover
@frextrite

When working with CodeInsightTestFixture, does anyone know the main difference between copyFileToProject and addFileToProject? I'm testing the fileCreated function of a VirtualFileListener and it seems that just copying the test file does not consistently trigger the fileCreated method in the listener, while adding the file does.

@megantracy93 I too was working with copyFileToProject but for me the files were not being copied for some odd reason. Maybe the same is happening to you as well?

xiaolong
@LoveSeriously

Unable to import com.intellij.lang.javascript.psi.*;

use gradle build;

build.gradle:

// See https://github.com/JetBrains/gradle-intellij-plugin/
intellij {
     version '2019.1.4'
     plugins ['java']
     sandboxDirectory 'C:\Users\lw\.IntelliJIdea2019.1\system\plugins-sandbox'
}

plugin.xml:

       <depends>com.intellij.modules.xml</depends>
       <depends>com.intellij.modules.lang</depends>
       <depends>JavaScript</depends>

Thank you for your answers.

Bastien Jansen
@bjansen
I think you need to add the javascript plugin in your build.gradle
nexoscp
@nexoscp
lookin for examples regarding ProjectGeneratorPeer#isBackgroundJobRunning Google doesnt have a lot
Amol Grover
@frextrite

Hi, I just published my plugin to Jetbrains repository, but I'm getting a few verification problems:

Package 'gherkin' is not found along with its 10 classes. Probably the package 'gherkin' belongs to a library or dependency that is not resolved by the checker. It is also possible, however, that this package was actually removed from a dependency causing the detected problems. Access to unresolved classes at runtime may lead to NoSuchClassError.

Though I am able to use it while developing and its shown as a part of IC Platform sources. Do I need to include it in dependency somehow? Thanks.