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

Completion fails when exposing field at root #113

Closed
Duologic opened this issue Aug 20, 2023 · 0 comments · Fixed by #118
Closed

Completion fails when exposing field at root #113

Duologic opened this issue Aug 20, 2023 · 0 comments · Fixed by #118

Comments

@Duologic
Copy link
Member

Duologic commented Aug 20, 2023

When I configure a library to expose an object through fieldaccess (hello.to), then completion fails.

# hello.jsonnet
local hello = {
  hello: {
    to: {
      the: 'world',
    },
  },
};

hello  // works
//hello.to  // does not work

Import:

local hello = import 'hello.jsonnet';

{
  a: hello.<tab>
}

Error log:

level=error msg="Completion: error finding ranges: field  was not found in ast.DesugaredObject"
julienduchesne added a commit that referenced this issue Aug 22, 2023
Closes #114
Closes #115

I still have #113 to fix but I'll do it in another PR
julienduchesne added a commit that referenced this issue Aug 22, 2023
Closes #113

This also fixes the go-to-definition functionality for this case, since it's the same code
julienduchesne added a commit that referenced this issue Aug 22, 2023
Closes #113

This also fixes the go-to-definition functionality for this case, since it's the same code
julienduchesne added a commit that referenced this issue Aug 23, 2023
* Completion: Fix two issues with local vars
Closes #114
Closes #115

I still have #113 to fix but I'll do it in another PR

* Fix linting

* Fix linting
julienduchesne added a commit that referenced this issue Aug 24, 2023
Closes #113

This also fixes the go-to-definition functionality for this case, since it's the same code
julienduchesne added a commit that referenced this issue Aug 24, 2023
…#118)

* Completion: Fix completion through an import pointing to a local bind
Closes #113

This also fixes the go-to-definition functionality for this case, since it's the same code

* Change order. Var ref is probably more exact than a stack search

* Make it work nested
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant