Link Search Menu Expand Document

IDE integration

Table of contents


SMP JavaScript interface can be integrated in various IDE for early error detection, auto-completion and type-checking.

Instructions

  • Visual Studio Code:
    • Either add a comment to the top of each file pointing to foo_spider_monkey_panel.js interface file:
      /// <reference path="./../../user-components/foo_spider_monkey_panel/docs/js/foo_spider_monkey_panel.js"/>
      
    • Or add a jsconfig.json file in the root of your Visual Studio Code project with the path to docs\js directory. For example (assuming that project is in foobar2000/themes/mytheme):
      {
        "compilerOptions": {
          // this is needed to suppress built-in browser objects (`window`, various DOM objects and etc)
          "lib": ["es2019"]
        },
        "include": [
          // project files
          "**/*.js",
          // docs
          "../../user-components/foo_spider_monkey_panel/docs/js/*.js"
        ]
      }
      

      Note: include works only with relative paths.
      Note 2: project files must be also added to include for the linting to work (**/*.js in the example above).

  • IntelliJ Idea Ultimate/WebStorm:
    • File>Settings>Languages>JavaScript>Libraries>Add...>+>Attach Directories...> Choose foo_spider_monkey_panel\docs\js directory.
    Screenshot Properties of multiple items

Copyright © 2018-2021 Yuri Shutenko.
Distributed by an MIT license.