Add JS and CSS support to Android Studio project

后端 未结 3 1072
囚心锁ツ
囚心锁ツ 2020-12-05 06:53

I just installed the new Android Studio and I\'m looking for a way to be able to get support for CSS and JS (autocomplete, highlighting for incorrect usages) as i would in P

3条回答
  •  自闭症患者
    2020-12-05 07:19

    You can get syntax highlighting pretty easy.

    In File > Settings > Files Types, create a Javascript file type and add *.js to the registered patterns. You will need to add all the keywords.

    Alternatively you can edit the XML file directly. In Ubuntu it is stored at /home/"User Name"/.AndroidStudioPreview/config/filetypes, and mine looks like this:

    
    
      
        
          
        
      
      
        
      
    
    

    As for autocompletion you may want to look into File Watcher, but I haven't figured it out yet. But I think if you have PHPStorm and WebStorm you already have the plugins you need for IntelliJ. And you can add custom plugins. Maybe try adding the free IDEA plugins to WebStorm ...

    EDIT: In the latest Android Studio (1.0) on Windows, the location of these XMLs is the following:

    .AndroidStudio\config\options\filetypes.xml :

    
    
      
        
        
          
        
      
    
    

    .AndroidStudio\config\filetypes\Javascript.xml

    
    
      
        
          
        
      
      
        
      
    
    

提交回复
热议问题