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

Unresolvable functions and variables #171

Open
millerbill3 opened this issue Jan 22, 2016 · 16 comments
Open

Unresolvable functions and variables #171

millerbill3 opened this issue Jan 22, 2016 · 16 comments
Labels

Comments

@millerbill3
Copy link

Noticed that functions imported from another module are not resolvable within the executing module.

@ligasgr
Copy link
Owner

ligasgr commented Jan 22, 2016

Hi,

Thanks for raising the issue.
Please give more details on which implementation you're using and an example modules for which it doesn't work.

@millerbill3
Copy link
Author

So, if I have a module myModule.xqy and I import another module (utils.xqy) and then from within myModule I have a reference to some method in utils, the method is highlighted in red and the tooltip displayed states that the method cannot be resolved.

Example:
In myModule.xqy
import module namespace util = "http://blah.com/util" at "/utils/util.xqy"

Then, later I reference a method within util.xqy
util:getDate() - This will be highlighted in red and tooltip displays it cannot be resolved.

I'm using the XQuery Support version 3 plugin in IntelliJ IDEA 15 CE

@ligasgr
Copy link
Owner

ligasgr commented Jan 26, 2016

Based on the extension used I assume you're using Marklogic.
Please check issue #80 and see if the instruction in the last comment fixes your problem.
If no, please give more detailed contents of the example files.

@millerbill3
Copy link
Author

Based on that, I can select MarkLogic 8, but I'm currently working against a MarkLogic 7 server. Will this be an issue?

@ligasgr
Copy link
Owner

ligasgr commented Jan 26, 2016

That shouldn't be an issue. Only that it will give you Marklogic 8 specfic list of functions on auto-completion list (there isn't one for ML7 anyway in the plugin). Please select ML8 and it should be fine.

@ligasgr
Copy link
Owner

ligasgr commented Jan 31, 2016

I assume it solved the issue.

@ligasgr ligasgr closed this as completed Jan 31, 2016
@willsthompson
Copy link

willsthompson commented Jan 3, 2017

@ligasgr It appears this issue is still present. I'm running ML8, and under Other Settings > XQuery I have set: Main module: xqy, Library module: xqm, XQuery flavour: MarkLogic 8. When I import a library module into a main module or another library module, functions and variables from the imported module are marked as errors Cannot resolve function/variable 'prefix:local-name' and the imported module resources aren't available from the autocomplete listings. I am using WebStorm, not IntelliJ. Please let me know if I can provide any more information.

@ligasgr
Copy link
Owner

ligasgr commented Jan 4, 2017

Can you please post sample project (simplest project/files that recreate the issue) somewhere so that I have it a bit easier to reproduce the issue?

@willsthompson
Copy link

@ligasgr I did some more testing, and the issue appears to be related to the fact that the imported module path contains a hyphen. For example, this works:

import module namespace library-module = "http://test.org/library-module"
  at "/test/library-module.xqm";

But this does not:

import module namespace library-module = "http://test.org/library-module"
  at "/test-folder/library-module.xqm";

If you want a more complete test case, let me know.

@ligasgr
Copy link
Owner

ligasgr commented Jan 9, 2017

Hi Will,
The commit c0c99dc should be fixing this issue.
Thanks for raising this.

@millerbill3
Copy link
Author

Is the update from commit c0c99dc available via the IntelliJ IDE yet? Just looking to update ASAP

@ligasgr
Copy link
Owner

ligasgr commented Jan 19, 2017

Hey, no it's not available yet.
I'm planning a release to happen in the upcoming days, so stay tuned!

@millerbill3
Copy link
Author

Hi there, I have the updated version of the plugin (3.2.0) installed in IntelliJ IDEA (2016.3.3) and it appears the bug is still there. If I have an imported module with a hyphen in the path, the plugin is unable to resolve the imported function/variable.

@ligasgr
Copy link
Owner

ligasgr commented Feb 2, 2017

Can you please create a sample project with sample file and expose it somewhere? I'm not able to reproduce the issue on the files with content provided in this issue...

@ligasgr ligasgr reopened this Feb 2, 2017
@millerbill3
Copy link
Author

I'm trying to recreate the issue, but before I do can you please remind me what the setting is for Database Port? I can't remember if it needs to point to a WebDAV endpoint or HTTP??? Just want to make sure I have the plugin configured correctly.

Here are my settings currently:
Name: MarkLogic-local
Host: localhost
Port: 8049 (WebDAV port, but have tried HTTP too with no success)
Database name: points to my modules database
Username:
Password:

@ligasgr
Copy link
Owner

ligasgr commented Feb 18, 2017

Hey Bill,
Sorry for late response.
Please find the refreshed instructions on how to configure runner here. You should be using XDBC port (you have to configure it first, more details in the link).
To recreate the issue you won't need the runner working. It's only for cases when you actually want to run the main module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants