Giter Site home page Giter Site logo

Comments (8)

sebthom avatar sebthom commented on June 3, 2024

This happens because another clink completion packages was installed which also defined a tables.lua module in the global namespace. So maybe it might be a good idea to register the files under modules via a dedicated namespace.

from clink-completions.

chrisant996 avatar chrisant996 commented on June 3, 2024

This happens because another clink completion packages was installed which also defined a tables.lua module in the global namespace. So maybe it might be a good idea to register the files under modules via a dedicated namespace.

It looks like there are two copies of clink-completions installed.

One in "...clink\clink-completions".
And one in "C:\apps\tools\clink-completions".

Can you clarify how you would register files under dedicated namespaces in Lua? I don't understand how one would do that in Lua.

from clink-completions.

sebthom avatar sebthom commented on June 3, 2024

It looks like there are two copies of clink-completions installed.

No, I shortened the path when creating the issue. There is only one installation.

Can you clarify how you would register files under dedicated namespaces in Lua? I don't understand how one would do that in Lua.

I fixed it like this on the other end: sebthom/more-clink-completions@d8d9ce5

So you basically create a subfolder in modules, e.g. clink_completions or something else and then reference the modules like require("clink_completions.tables") instead of require("tables")

from clink-completions.

chrisant996 avatar chrisant996 commented on June 3, 2024

Oh, I see. That's no different than simply renaming modules to clink_completions_modules. It isn't a "namespace" per se, it just uses a more unique directory name than "modules". I'm cautious about making that change in clink-completions itself, since it is a breaking change that can lead to breaking other scripts and breaking clink-completions itself if someone updates it by unzipping the .zip file.

What is the other clink completions package that has a modules\tables.lua script, but is not the clink-completions package?

from clink-completions.

sebthom avatar sebthom commented on June 3, 2024

Oh, I see. That's no different than simply renaming modules to clink_completions_modules.

This would not solve the problem as the tables module will still be registered at top-level. If you however introduce a subdirectory but continue to put the parent dir, i.e. modules on the lua path, then you can reference the tables module in a qualified way.

What is the other clink completions package that has a modules\tables.lua script, but is not the clink-completions package?

Mine :) https://github.com/sebthom/more-clink-completions/ and I mitigated the issue from my side via sebthom/more-clink-completions@d8d9ce5

from clink-completions.

chrisant996 avatar chrisant996 commented on June 3, 2024

@sebthom ahhh ok I see, now, thanks for explaining.

At this point it would be a breaking change, and I'm cautious about making those, since they tend to be disruptive and result in frustration and lost time for people (including myself, to answer questions and troubleshoot, etc).

But I'm still a little confused:

It sounds like your more-clink-completions may be similar to clink-completions. But it has a tables.lua module in a different module directory, and its different module isn't a copy and works differently? I'd have imagined it would either copy tables.lua or use a different module name if it knew the module name conflicted. Which I suppose is the point -- the conflict wasn't originally noticed.

from clink-completions.

sebthom avatar sebthom commented on June 3, 2024

Well, I don't know but my repo used to work in conjunction with clink-completions with no problems, after installing a new version of clink-completions without having modified my repo I got the error described. Maybe because of this change 2ae1083

The tables.lua I created is different, it is not a copy.

from clink-completions.

chrisant996 avatar chrisant996 commented on June 3, 2024

Well, I don't know but my repo used to work in conjunction with clink-completions with no problems, after installing a new version of clink-completions without having modified my repo I got the error described. Maybe because of this change 2ae1083

The tables.lua I created is different, it is not a copy.

How would it be related to that commit? That commit didn't change anything about the modules path. It only refactored a line so that it could reuse the parent path, instead of computing the parent path twice.

Oh, I get it -- You mentioned using clink installscripts as the way you installed a new version of clink-completions.

That's the cause. Previously clink installscripts must not have been used to install it. The installscripts locations are loaded after all other scripts have been loaded. So git.lua from an installscripts directory ends up loading the tables.lua module from your other scripts.

Which also means that in the past, your scripts must have been accidentally loading the clink-completions copy of tables.lua instead of their own copy?

from clink-completions.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.