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

Nimsuggest does not work #48

Closed
vanyle opened this issue Nov 21, 2021 · 5 comments
Closed

Nimsuggest does not work #48

vanyle opened this issue Nov 21, 2021 · 5 comments

Comments

@vanyle
Copy link
Contributor

vanyle commented Nov 21, 2021

When importing the nimgame2 functions, nimsuggest does not work.
I go it to work by changing the following:

Inside the .nimble file, I added a name field:

# Package
name = "nimgame2"
version = "0.6.2"
author = "Vladar"
description = "A simple 2D game engine for Nim language."
license = "MIT"

Inside the root directory, I created a nimgame2 file that exports all the symbols of the library so that only one import is needed to use the library:

import
    nimgame2/nimgame,
    nimgame2/draw,
    nimgame2/entity,
    nimgame2/settings,
    nimgame2/scene,
    nimgame2/utils,
    nimgame2/graphic,
    nimgame2/texturegraphic,
    nimgame2/types,
    nimgame2/input

export nimgame,draw,entity,settings,scene,utils,graphic,texturegraphic,types,input
# More imports / exports are needed here ...
@Vladar4
Copy link
Owner

Vladar4 commented Nov 21, 2021

Sure, I'll accept such pull request.

@vanyle vanyle mentioned this issue Nov 21, 2021
@Vladar4 Vladar4 closed this as completed Nov 21, 2021
@metagn
Copy link
Contributor

metagn commented Nov 22, 2021

What is your nim/nimble version? Nimble breaks if you define name (nim-lang/nimble#237), but if you have a very old version it might require it.

@vanyle
Copy link
Contributor Author

vanyle commented Nov 22, 2021

nimble v0.13.1 compiled at 2021-11-04 21:52:10

Nim Compiler Version 1.6.0 [Windows: amd64]
Compiled at 2021-11-04
Copyright (c) 2006-2021 by Andreas Rumpf

I'm not 100% sure what causes the nimsuggest issue. It might be the name part or the import part.

@Vladar4
Copy link
Owner

Vladar4 commented Nov 22, 2021

The documentation says that
name - The name of the package. (This is not required in the new NimScript format)

Could you check if nimsuggest works with the current setup (without the name entry)?

@Vladar4 Vladar4 reopened this Nov 22, 2021
@vanyle
Copy link
Contributor Author

vanyle commented Nov 22, 2021

Yup, now it does !

@Vladar4 Vladar4 closed this as completed Nov 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants