halohalospecial / atom-elmjutsu

A bag of tricks for developing with Elm. (Atom package)
https://atom.io/packages/elmjutsu
MIT License
192 stars 24 forks source link

Uncaught Error: PCRE does not support \L, \l, \N{name}, \U, or \u #100

Closed xvw closed 4 years ago

xvw commented 6 years ago

[Enter steps to reproduce:]

  1. Just after the installation of some NPM's packages (into an Electron project)

Atom: 1.23.0-beta0 x64 Electron: 1.6.15 OS: Mac OS X 10.12.6 Thrown From: elmjutsu package 7.1.5

Stack Trace

Uncaught Error: PCRE does not support \L, \l, \N{name}, \U, or \u

At /Applications/Atom Beta.app/Contents/Resources/app.asar/node_modules/superstring/index.js:221

Error: PCRE does not support \L, \l, \N{name}, \U, or \u
    at TextBuffer.findAllInRangeSync (/app.asar/node_modules/superstring/index.js:221:44)
    at TextBuffer.module.exports.TextBuffer.findAllInRangeSync (/Applications/Atom Beta.app/Contents/Resources/app/node_modules/text-buffer/lib/text-buffer.js:1147:32)
    at Cursor.getBeginningOfCurrentWordBufferPosition (/Applications/Atom Beta.app/Contents/Resources/app/src/cursor.js:523:45)
    at Object.getToken (/packages/elmjutsu/lib/helper.js:18:31)
    at Object.sendActiveToken (/packages/elmjutsu/lib/indexing.js:74:14)
    at /packages/elmjutsu/lib/core.js:193:32

Commands

  5x -9:28.8.0 core:backspace (input.hidden-input)
     -9:22 atomic-emacs:next-line (input.hidden-input)
     -9:21 atomic-emacs:previous-line (input.hidden-input)
     -9:20.8.0 atomic-emacs:backward-char (input.hidden-input)
  3x -9:19.8.0 core:save (input.hidden-input)
 11x -7:41.2.0 core:backspace (input.hidden-input)
  3x -7:33 core:save (input.hidden-input)
  2x -7:13.7.0 core:backspace (input.hidden-input)
  3x -7:12.6.0 core:save (input.hidden-input)
     -6:54.3.0 core:backspace (input.hidden-input)
  8x -6:54 core:save (input.hidden-input)
  4x -6:39.1.0 core:backspace (input.hidden-input)
  4x -6:34.7.0 core:save (input.hidden-input)
     -2:03.1.0 settings-view:open (input.hidden-input)
  2x -0:42.1.0 core:copy (atom-notification.fatal.icon.icon-bug.native-key-bindings.has-detail.has-close.has-stack)

Non-Core Packages

atom-beautify 0.30.6 
atom-dark-fusion-syntax 2.2.1 
atom-elixir 0.2.3 
atom-ide-ui 0.5.4 
atomic-emacs 0.12.1 
busy-signal 1.4.3 
elm-format 3.0.0 
elmjutsu 7.1.5 
file-icons 2.1.13 
intentions 1.1.5 
language-elixir 0.20.3 
language-elm 1.5.0 
language-ocaml 1.9.5 
language-slim 1.0.0 
linter 2.2.0 
linter-elixirc 1.7.0 
linter-ui-default 1.6.10 
ocaml-indent 0.6.1 
ocaml-merlin 0.14.4 
halohalospecial commented 6 years ago

Hi! A change in Atom 1.23 (beta) broke token detection. For some reason, it's not allowing some unicode characters in the regular expression.

  tokenRegex() {
    return new RegExp(
      '[\\d' +
        unicodeHelper.letters() +
        '~`!@#\\$%\\^&\\*_\\-\\+=:;\\|\\\\<>\\.\\?\\/]+|\\(,+\\)'
    );
  },

https://github.com/halohalospecial/atom-elmjutsu/blob/master/lib/unicode-helper.js

You can either comment out unicodeHelper.letters() + in ~/.atom/packages/elmjutsu/lib/helper.js (where ~/.atom is Atom's root directory) or use Atom 1.22 in the meantime.

xvw commented 6 years ago

Thanks ! It is work now. Should I close the issue or let it ?

halohalospecial commented 6 years ago

Hi, let's leave it open since it still needs to be resolved for Atom 1.23.

LukaHorvat commented 6 years ago

Any news on this? The a ton of features don't seem to work if I comment out that line.

halohalospecial commented 6 years ago

Hi @LukaHorvat, which features didn't work when you commented out the line?

LukaHorvat commented 6 years ago

Well, autocomplete for starters.

halohalospecial commented 6 years ago

Hi all! Sorry, forgot to mention that you should replace the commented line. The latest version (v7.1.6) has a workaround for this. The only caveat is that it will not work for other Unicode characters anymore if the Atom version is 1.23.0 or higher.