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 for nested functions #129

Closed
mahaffey opened this issue Nov 16, 2023 · 0 comments · Fixed by #150
Closed

Completion Fails for nested functions #129

mahaffey opened this issue Nov 16, 2023 · 0 comments · Fixed by #150

Comments

@mahaffey
Copy link

mahaffey commented Nov 16, 2023

Version 0.13.1

Similar to: #113

Log

time="2023-11-16T11:47:36-08:00" level=info msg="Starting the language server"
time="2023-11-16T11:47:36-08:00" level=info msg="Initializing jsonnet-language-server version 0.13.1"
time="2023-11-16T11:47:36-08:00" level=info msg="Reading stdlib"
time="2023-11-16T11:47:36-08:00" level=info msg="configuration updated: {ResolvePathsWithTanka:true JPaths:[/<MYPATH>/lib/] ExtVars:map[] ExtCode:map[] FormattingOptions:{Indent:2 MaxBlankLines:2 StringStyle:1 CommentStyle:1 PrettyFieldNames:true PadArrays:false PadObjects:true SortImports:true UseImplicitPlus:true StripEverything:false StripComments:false StripAllButComments:false} EnableEvalDiagnostics:true EnableLintDiagnostics:false}"
...
time="2023-11-16T11:48:23-08:00" level=error msg="DocumentSymbol: error parsing the document"
time="2023-11-16T11:48:23-08:00" level=error msg="Completion: error finding ranges: field Critical() was not found in ast.DesugaredObject"
time="2023-11-16T11:48:24-08:00" level=error msg="DocumentSymbol: error parsing the document"
time="2023-11-16T11:48:41-08:00" level=error msg="Definition: error finding definition" error="cannot find definition"

Library

{

  // Stack Criticality modifiers
  Critical: function(warning_period=3) {
    critical: true,
    warning_period: warning_period,

    TimeZone: function(time_zone='America/Los_Angeles') self {
      timezone: time_zone,
    }
  },

  NonCritical: function() $.Critical() {
    critical: false,
  },
}

Live Configuration

local crit = import crit.libsonnet;

{
   test: crit.Critical().
                      // ^^^
                      // IntelliSense cannot resolve the nested function TimeZone, resulting in the error
                      // "Completion: error finding ranges: field Critical() was not found in ast.DesugaredObject"
                      //  however it can resolve both Critital and NonCritical on the local var/object crit
}
julienduchesne added a commit that referenced this issue Aug 7, 2024
Closes #129
Had to implement a more sophisticated word-splitting function because `myfunc(arg1, arg2) has to be a single "word"
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

Successfully merging a pull request may close this issue.

1 participant