Closed yuutayamada closed 8 years ago
We use nimscript:
We can support 1-3 in nimsuggest, but we can not support 4. (or difficult to maintain)
So, I'm hoping that (1) nimsuggest allow another option to avoid loading current dot nims file when editor or IDE called nimsuggest or (2) nimsuggest just allow empty argument as PROJECTNAME.nim for this case.
example
# we call nimsuggest like this and can not omit PROJECTNAME.nim
nimsuggest --port 6000 PROJECTNAME.nim
@Araq is there recommend way? does (1) or (2) look ok?
(3. no, the gangbang has nothing to do with it)
I don't understand this issue. nimsuggest has to run the nimscript files to get the correct --path etc. If your nimscript file has a toplevel mkdir
statement, that's a problem with the nim compiler too.
If your nimscript file has a toplevel mkdir statement, that's a problem with the nim compiler too.
Please let me know proper usage of nimsuggest for nimscript files. I'm having a trouble using nimsuggest with my editor when emacs open nimscript file (emacs calls chk
method of nimsuggest) Below code is official example of nimscript of standalone Nimscript
and when I open the nims file of below content, emacs call nimsuggest for syntax check, which start git clone
by just opening file.
mode = ScriptMode.Verbose
var id = 0
while dirExists("nimble" & $id):
inc id
exec "git clone https://github.com/nim-lang/nimble.git nimble" & $id
withDir "nimble" & $id & "/src":
exec "nim c nimble"
mvFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe
I might wrongly implemented emacs' nim-mode because nimsuggest doesn't work without projectname.nim of last argument. What should I specify as projectname.nim when I want to check just a nimscript file for script usage? (currently Emacs specify current opening file's absolute path)
Checking of nims
files is not supported at all for this reason. Again, this is not a nimsuggest specific problem.
Thank you. I'll disable nimsuggest for nimscript files in emacs' nim-mode.
I made sure this behavior in major-restructure branch, but I think it could be happened in master branch too. (because I copied Araq's code from master to major-restructure branch)
foo.nims:
When I opened above file named foo.nim with Emacs using nimsuggest,
bar
directory was created.I suspect this part is cause of this bug: https://github.com/nim-lang/nimsuggest/blob/master/nimsuggest.nim#L420
but for some reasons my editor doesn't work in nimsuggest's master branch and I can't make sure...