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

Present working directory for nim check should probably be your project? #110

Closed
joshgoebel opened this issue Oct 18, 2018 · 2 comments
Closed

Comments

@joshgoebel
Copy link

I have a project in ~/git/nim/pastie.

I'm editing the files with Sublime 3 (my project root is ~/git/nim/pastie) and when saving them the built in nim check is going bonkers. I know why. I have a macro that's running from this file that walks the directory and pulls in other files to compile them. The path passed to walkDir seems to be relative to the path you are running the compiler from. When NimLime runs nim check it's running it from some other location, the macro fails to import the files, and then check reports errors because of missing code.

I skimmed the source but I didn't see any setting or concept of running check in the context of any given path or not.

Any ideas?

Saving the file in my editor

pastes.nim(27, 17) Error: undeclared identifier: 'pastes_index_view'
(and others cascading)

From the shell

From a console prompt in this folder (works fine):

> nim check app/controllers/pastes.nim
Hint: operation successful (54479 lines compiled; 0.826 sec total; 60.418MiB peakmem; Debug Build) [SuccessX]
@joshgoebel
Copy link
Author

I was able to resolve this by modifying my source to usecurrentSourcePath() to eliminate the issue by not caring where it's compiled form.

Varriount pushed a commit that referenced this issue Nov 5, 2018
@Varriount
Copy link
Collaborator

I've modified the current development branch to change the working directory to that of the file being checked, however it's better to have your code support a compile running from any directory.

Varriount pushed a commit that referenced this issue Dec 29, 2018
* Move core files to 'core' directory.
Remove Nimsuggest and Nimble support.

* Refactor settings, hotkeys, and nimcheck code.

* Fix #110

* Fix file permissions.

* fix #118 (#120)

* fix #118

* Update core/commands/nimcheck.py

Co-Authored-By: timotheecour <[email protected]>

* Make command import more correct.

* fix #112 (#123)

* Split comment grammer into separate file, to support nested multiline comments.
Fixes #94

* Update keymaps for new comment definitions.
Fixes #94, #97, and #128

* Straighten out TODO matching.

* Simplify package settings menu by using native edit_settings command.

* Fix comment continuation.

* Remove ST2/ST3 distinction.

* comment and doc comment completion work (#133)

* fix #134 (#135)

* fix #125 (#127)

* should fix #125 (hopefully)
let me know if I'm mistaken

* Update Nim.YAML-tmLanguage (#126)
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

2 participants