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

False negative on buildHtml in Karax #112

Open
moigagoo opened this issue Jan 13, 2020 · 3 comments
Open

False negative on buildHtml in Karax #112

moigagoo opened this issue Jan 13, 2020 · 3 comments

Comments

@moigagoo
Copy link

nimsuggest reports an error even with the simplest Karax code, simply if buildHtml is called:

import karax/[karax, karaxdsl, vdom]

proc render(): VNode =
  buildHtml(tdiv):
    p:
      text "hello"

setRenderer render

Nimsuggest output:

$ nimsuggest.exe root.nim
Hint: used config file 'C:\Users\moigagoo\.choosenim\toolchains\nim-1.0.4\config\nim.cfg' [Conf]
Hint: used config file 'C:\Users\moigagoo\Projects\chyatik\public\root.nim.cfg' [Conf]
usage: sug|con|def|use|dus|chk|mod|highlight|outline|known file.nim[;dirtyfile.nim]:line:col
type 'quit' to quit
type 'debug' to toggle debug mode on/off
type 'terse' to toggle terse mode on/off
> chk root.nim
chk     skUnknown               Hint    ???     0       -1      "root [Processing]"     0
chk     skUnknown               Error   C:\Users\moigagoo\Projects\chyatik\public\root.nim      5       11      "template/generic instantiation from here"      0
chk     skUnknown               Error   C:\Users\moigagoo\.nimble\pkgs\karax-1.1.0\karax\karaxdsl.nim   75      6      "cannot generate VM code for result"     0
@moigagoo
Copy link
Author

Original issue: karaxnim/karax#131

@saem
Copy link

saem commented Dec 19, 2020

If I specify the --backend:js and -d:js parameters everything works fine, tested with:

  • nimble as a project file (the backend specification in the nimble file did nothing, had to be via command line)
  • with a nim file it worked and the define could be as a parameter of cfg

This has a work around, extension authors can help here by passing the backend parameter -- this is done in the nim vscode plugin, but not the TS plugin, IIRC.

My thoughts on a more meaningful fix are as follows, if nimsuggest is going to treat the nimble file as a project file, then it should be more nimble aware an get the backend from there. Alternatively, if nimble is going to track this information then it should be more nimsuggest aware and provide a properly configured nimsuggest instance that it can launch for the user or an editor.

@saem
Copy link

saem commented Jan 3, 2021

A workaround(?) for this would be to have the user specify the params in a nim.cfg or $project.nim.cfg.

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