2

I'm writing my first program in JS, I need to return the cursor text when the mouse hovers over it in Atom.

import {CompositeDisposable} from 'atom';

const atom = require("atom");

const cursorListener = {
  subscriptions: null,
  cursorReturn: null,
    activate (state) {
      constructor();
      //this.subscriptions = new Atom.CompositeDisposable();
    },

    constructor() {
      this.editor = editor;
      this.getClient = getClient;
      this.subscriptions = new Atom.CompositeDisposable();
    }
    this.reinitialize();
    this.subscriptions.add(atom.texteditor.getWordUnderCursor()) {

      var check = atom.texteditor.getWordUnderCursor();
      console.log(check);
    },

    deactivate () {
      this.subscriptions.dispose();
      this.cursorReturn.destroy();
    },
    serialize () {
    }
  };
    exports.cursorListener = cursorListener;

I run atom in dev mode and it doesn't work. I have searched so many places and I cannot figure this out. Please if anyone could help me, please let me know. Thanks.

0 Answers0