How to use atom - 10 common examples

To help you get started, we’ve selected a few atom examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github viddo / atom-textual-velocity / lib / Disposables.js View on Github external
add(...values) {
    // until https://github.com/eslint/eslint/issues/12117 is resolved:
    // eslint-disable-next-line no-unused-vars
    for (let val of values) {
      if (!Disposable.isDisposable(val)) {
        if (typeof val === "function") {
          val = new Disposable(val);
        } else {
          console.error(
            `val is of type ${typeof val}, was expected to be disposable or a function`
          );
        }
      }
      super.add(val);
    }
  }
}
github Polymer / atom-plugin / lib / polymer-ide.js View on Github external
activate(_) {
        // Initialize.
        this.linter = new Linter();
        this.autocompleter = new Autocompleter();
        // Events subscribed to in atom's system can be easily cleaned up with a
        // CompositeDisposable
        this.subscriptions = new CompositeDisposable();
        this.subscriptions.add(atom.project.onDidChangePaths((projectPaths) => {
            this.setProjectPaths(projectPaths);
        }));
        this.setProjectPaths(atom.project.getPaths());
        this.subscriptions.add(new TooltipManager(this.editorService));
    }
    ;
github Polymer / atom-plugin / src / polymer-ide.ts View on Github external
activate(_: ViewState) {
    // Initialize.
    this.linter = new Linter();
    this.autocompleter = new Autocompleter();

    // Events subscribed to in atom's system can be easily cleaned up with a
    // CompositeDisposable
    this.subscriptions = new CompositeDisposable();

    this.subscriptions.add(
        atom.project.onDidChangePaths((projectPaths: string[]) => {
          this.setProjectPaths(projectPaths);
        }));
    this.setProjectPaths(atom.project.getPaths());
    this.subscriptions.add(new TooltipManager(this.editorService));
  };
github appcelerator / atom-appcelerator-titanium / lib / toolbar / select.js View on Github external
constructor(options) {
      this.element = document.createElement('select');
      this.element.classList.add('select', 'element');
      this.element.style.width = options.width;

      this.emitter = new Emitter();
      this.element.onchange = function(e){
          var selectedOption = this.element.options[this.element.selectedIndex];
          this.emitter.emit('change', {text: selectedOption.text, value: selectedOption.value});
      }.bind(this);
    }
github atom / github / lib / views / git-panel-view.js View on Github external
constructor(props) {
    this.props = props;
    etch.initialize(this);

    this.element.addEventListener('focusin', this.rememberLastFocus);

    this.subscriptions = new CompositeDisposable(
      this.props.commandRegistry.add(this.element, {
        'tool-panel:unfocus': this.blur,
        'core:focus-next': this.advanceFocus,
        'core:focus-previous': this.retreatFocus,
      }),
      new Disposable(() => this.element.removeEventListener('focusin', this.rememberLastFocus)),
    );
  }
github AtomLinter / linter-markdown / lib / config.js View on Github external
function on() {
  subscriptions = new CompositeDisposable();

  subscriptions.add(atom.config.observe('linter-markdown.presetRecommendedWithoutConfig', (value) => {
    presetRecommendedWithoutConfig = value;
  }));

  subscriptions.add(atom.config.observe('linter-markdown.presetConsistentWithoutConfig', (value) => {
    presetConsistentWithoutConfig = value;
  }));
}
github tststs / atom-ternjs / lib / atom-ternjs.js View on Github external
activate() {

    this.subscriptions = new CompositeDisposable();

    this.subscriptions.add(
      atom.packages.onDidActivateInitialPackages(function() {

        if (!atom.inSpecMode()) {

          require('atom-package-deps').install('atom-ternjs', true);
        }
      })
    );

    manager.activate();
  }
github TypeStrong / atom-typescript / lib / main / atom / autoCompleteProvider.ts View on Github external
function getLastNonWhitespaceChar(buffer: Atom.TextBuffer, pos: Atom.Point): string | undefined {
  let lastChar: string | undefined
  const range = new Atom.Range([0, 0], pos)
  buffer.backwardsScanInRange(
    /\S/,
    range,
    ({matchText, stop}: {matchText: string; stop: () => void}) => {
      lastChar = matchText
      stop()
    },
  )
  return lastChar
}
github TypeStrong / atom-typescript / dist / main / atom / autoCompleteProvider.js View on Github external
function getLastNonWhitespaceChar(buffer, pos) {
    let lastChar;
    const range = new Atom.Range([0, 0], pos);
    buffer.backwardsScanInRange(/\S/, range, ({ matchText, stop }) => {
        lastChar = matchText;
        stop();
    });
    return lastChar;
}
function containsScope(scopes, matchScope) {
github heilhead / es-identifier-highlight / lib / view.js View on Github external
_getRange(start, end) {
        let buf = this._editor.getBuffer();

        return new Range(
            buf.positionForCharacterIndex(start),
            buf.positionForCharacterIndex(end)
        );
    }

atom

shared, synchronous, independent state for javascript apps

ISC
Latest version published 1 year ago

Package Health Score

46 / 100
Full package analysis