IntelliJ IDEA not recognizing .feature files

前端 未结 8 653
走了就别回头了
走了就别回头了 2021-01-02 07:12

I have installed the cucumber-java and gherkin plugins in IntelliJ IDEA but when I create a .feature file it is not recognized as a feature file. I did restart IntelliJ and

相关标签:
8条回答
  • 2021-01-02 07:20

    For me it was even worse. The .feature extension was assigned to text. Which was odd as previously created .feature files remained real feature files. Yet newly created feature files were seen as plain text. So do check all relevant file types as intelIj does strange things with this.

    0 讨论(0)
  • 2021-01-02 07:31

    I had a typo in the file name extension. Easy to miss. Verify that the feature file name ends with .feature.

    0 讨论(0)
  • 2021-01-02 07:32

    If you have Substeps IntelliJ Plugin enabled then that might be the issue. you will need to remove and restart.

    0 讨论(0)
  • 2021-01-02 07:33

    Navigate to the settings from File option at menu then -> Editor -> File Types --> Select Cucumber scenario (Recognized file types ) observe that if Registered patterns has *.feature if not then click on + icon and add *.feature in Registered patterns. Apply changes and save. It solved my problem of .feature file. Thanks!

    0 讨论(0)
  • 2021-01-02 07:37

    Check Settings->Editor->File Types. Verify that Cucumber Scenario is set to a Registered Pattern of *.feature.

    0 讨论(0)
  • 2021-01-02 07:37

    Check File -> Settings -> Editor -> File Types and click on the Text file type. Look at the Registered Patterns section below and verify that the file you're trying to create is not in the list of recognized patterns for Text file types.

    This might happen if you created the file without initially giving it the .feature extension. If you do that and then try to add the extension afterwards IntelliJ will probably still think it's a text file and will not treat it as a feature file. This was the fix for me.

    If you're seeing IntelliJ recognizing your intended feature file as some other type of file then check the recognized patterns for that file type and verify again that the file you're trying to create is NOT in that list.

    See http://www.gisremotesensing.com/2014/11/solution-intellij-not-recognizing.html

    For some setups, this is only half the story. Once, you have removed the old file type; now follow the steps:

    • Select "Cucumber scenario" in the "Recognized file types"
    • In the "Registered patterns" box click the "+" and type "*.feature"

    Now you are all set. The feature files will be back to normal.

    0 讨论(0)
提交回复
热议问题