Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Includes #3

Open
frepond opened this issue Sep 11, 2015 · 11 comments
Open

Includes #3

frepond opened this issue Sep 11, 2015 · 11 comments

Comments

@frepond
Copy link

frepond commented Sep 11, 2015

Hi, I couldn't get includes working. Neither setting absolute or relative paths. Do you have any clue?

I have the following project structure:

+ elr_prj
    + apps
          + app1
              + include
              + src
              ...
          + app2
              + include
              + src
              + ...
    + deps
     + ...

Thanks in advance
@tduffield
Copy link
Contributor

I got it to work for me by setting my includeDirs setting to "./apps/app1/include ./apps/app2/include"

@frepond
Copy link
Author

frepond commented Sep 11, 2015

Setting the include dirs like that:

"linter-erlang":
    includeDirs: "./apps/lsm_oauth_client/include"

It gives me the following error, something with the underscores in the dir name (lsm_oauth_client) perhaps?

Atom Version: 1.0.11
System: Mac OS X 10.11
Thrown From: linter-erlang package, v0.3.0

Stack Trace

Uncaught TypeError: Cannot read property 'match' of undefined

At /Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:680

TypeError: Cannot read property 'match' of undefined
  at TokenizedBuffer.module.exports.TokenizedBuffer.indentLevelForLine (/Applications/Atom.app/Contents/Resources/app.asar/src/tokenized-buffer.js:680:23)
  at DisplayBuffer.module.exports.DisplayBuffer.indentLevelForLine (/Applications/Atom.app/Contents/Resources/app.asar/src/display-buffer.js:817:35)
  at TextEditor.module.exports.TextEditor.indentLevelForLine (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2284:33)
  at TextEditor.module.exports.TextEditor.indentationForBufferRow (/Applications/Atom.app/Contents/Resources/app.asar/src/text-editor.js:2256:19)
  at Object.module.exports.Helpers.rangeFromLineNumber (/Users/frepond/.atom/packages/linter-erlang/node_modules/atom-linter/lib/helpers.coffee:55:30)
  at parse_row (/Users/frepond/.atom/packages/linter-erlang/lib/init.coffee:81:30)
  at BufferedProcess.exit (/Users/frepond/.atom/packages/linter-erlang/lib/init.coffee:92:15)
  at triggerExitCallback (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:213:47)
  at /Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:220:18
  at Socket.<anonymous> (/Applications/Atom.app/Contents/Resources/app.asar/src/buffered-process.js:98:18)
  at emitOne (events.js:82:20)
  at Socket.emit (events.js:166:7)
  at Pipe.close (net.js:464:12)

Commands

     -0:40.4.0 core:select-all (atom-text-editor#linter-erlang.includeDirs.editor.mini.is-focused)
     -0:38.4.0 core:paste (atom-text-editor#linter-erlang.includeDirs.editor.mini.is-focused)
  5x -0:37.5.0 editor:move-to-beginning-of-word (atom-text-editor#linter-erlang.includeDirs.editor.mini.is-focused)
  2x -0:33.1.0 core:save (div.settings-view.pane-item)

Config

{
  "core": {
    "disabledPackages": [
      "symbols-view"
    ],
    "themes": [
      "one-light-ui",
      "writer-syntax"
    ]
  },
  "linter-erlang": {
    "includeDirs": "./apps/lsm_oauth_client/include"
  }
}

Installed Packages

# User
atom-beautify, v0.28.12
atom-ctags, v4.2.0
autocomplete-erlang, v1.1.1
autocomplete-html-entities, v0.1.0
autocomplete-paths, v1.0.2
autocomplete-polymer, v0.2.4
autocomplete-python, v0.5.3
color-picker, v2.0.11
file-icons, v1.6.9
file-types, v0.5.1
git-log, v0.4.1
imdone-atom, v1.1.38
language-elixir, v0.5.2
language-erlang, v3.0.0
language-log, v0.6.0
language-plantuml, v0.1.1
linter, v1.5.1
linter-erlang, v0.3.0
linter-markdown, v1.2.1
linter-pep8, v1.0.1
markdown-mindmap, v0.2.4
markdown-scroll-sync, v0.4.2
minimap, v4.13.3
pigments, v0.14.0
plantuml-viewer, v0.6.1
project-manager, v2.5.1
python-autopep8, v0.1.3
sync-settings, v0.6.0
writer-syntax, v0.16.2

# Dev
No dev packages

@RaoH
Copy link
Owner

RaoH commented Sep 12, 2015

Hmmm I'll look into it tonight when I get som more time. I think I have an idea what is going on.

@frepond
Copy link
Author

frepond commented Sep 17, 2015

Hi RaoH, if you give me some tip maybe I could have a look at it.

@RaoH
Copy link
Owner

RaoH commented Sep 21, 2015

Really sorry! Life came in my way big time so I couldn't get time to focus on the issue here.

Looks like we didn't get the row number as expected when parsing the row on init.coffee on line 75.
Hmm... weird. Could you try and output the row we are parsing?

parse_row = (row) ->
  if row.indexOf("Module name") != -1

change to

parse_row = (row) ->
  console.log(row)
  if row.indexOf("Module name") != -1

And turn on the developer tools on atom. If you could paste the output it should hasten a solution!

On a side-note, this package will be removed from atom-packages quite soon. I am now admin on the linter-erlc package. So will probably do an overhaul on the entire parsing on linter errors. But your output will help making it better!

@frepond
Copy link
Author

frepond commented Sep 21, 2015

Don't worry. This is the console output (the intended line in init.coffee for me is 65 instead of 75):

./deps/ls_lib/include/ls_uri.hrl:27: type record() undefined
./deps/lsd_api/include/lsd.hrl:403: type tuple(
) undefined

@RaoH
Copy link
Owner

RaoH commented Sep 22, 2015

Oh it does help if I'm looking in the right version =)

Ah I see it now! Thanks!
When I get some free time at work I'll see if I can make a quick fix.

@RaoH
Copy link
Owner

RaoH commented Sep 22, 2015

Hmm thought I didn't catch type warnings. But seems that it does.

Did a mock project like the structure you got, but I don't seem to get the error at all. Really weird.

I made a little patch that bumped the atom-linter helper module to a newer version. If you could help me with a console.log(filePath) at the same place, perhaps I could understand why the crash happens. Seems like the atom-linter helper somehow crashes.

@frepond
Copy link
Author

frepond commented Sep 23, 2015

Here is the console output:

/Users/frepond/Documents/code/lsm_bot/apps/lsm_oauth_client/src/lsm_oauth_session.erl

@RaoH
Copy link
Owner

RaoH commented Sep 28, 2015

Man, I've been trying to replicate the error for awhile now and I really don't see it anymore.
But I do think the way I handle the output is bad. So this will be rewritten in linter-erlc.

@frepond
Copy link
Author

frepond commented Sep 28, 2015

Raoul, thanks for having a look at it. If I'm able to replicate this in a project I could share I'll send it to you. In the meanwhile I look forward for linter-erlc.

Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants