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

deno.unstable Configuration Not Functioning as Expected #26223

Closed
jakubdonovan opened this issue Oct 14, 2024 · 0 comments · Fixed by #26655
Closed

deno.unstable Configuration Not Functioning as Expected #26223

jakubdonovan opened this issue Oct 14, 2024 · 0 comments · Fixed by #26655
Assignees
Labels
bug Something isn't working correctly lsp related to the language server

Comments

@jakubdonovan
Copy link

jakubdonovan commented Oct 14, 2024

Version: Deno 2.0.2

The configuration schema indicates that deno.unstable is a valid option that accepts an array of strings.
Screenshot 2024-10-14 at 07 06 35

I have added it to my denols configuration in my lspconfig.lua as follows:

  denols = {
   root_dir = lspconfig.util.root_pattern("package.json", "deno.json", "deno.jsonc"),
   -- single_file_support = false,
   flags = {
     debounce_text_changes = 150,
   },
   filetypes = {
     "javascript",
     "javascript.jsx",
     "javascriptreact",
     "typescript",
     "typescript.tsx",
     "typescriptreact",
     "markdown",
   },
   settings = {
     javascript = {
       inlayHints = {
         parameterNames = { enabled = "none", suppressWhenArgumentMatchesName = true },
         parameterTypes = { enabled = false },
         variableTypes = { enabled = false, suppressWhenTypeMatchesName = true },
         propertyDeclarationTypes = { enabled = false },
         functionLikeReturnTypes = { enabled = false },
         enumMemberValues = { enabled = false },
       },
     },
     typescript = {
       inlayHints = {
         parameterNames = { enabled = "none", suppressWhenArgumentMatchesName = true },
         parameterTypes = { enabled = false },
         variableTypes = { enabled = false, suppressWhenTypeMatchesName = true },
         propertyDeclarationTypes = { enabled = false },
         functionLikeReturnTypes = { enabled = false },
         enumMemberValues = { enabled = false },
       },
     },
     deno = {
       enable = true,
       lint = true,
       -- config = './deno.jsonc',
       -- disabledPaths = []
       -- unstable = { "sloppy-imports" },
       suggest = {
         names = true,
         paths = true,
         completeFunctionCalls = false,
         autoImports = true,
         imports = {
           autoDiscover = true,
           hosts = {
             ["https://deno.land"] = true,
           },
         },
       },
     },
   },
 },

Despite this configuration, the sloppy-imports option does not take effect unless I include a deno.json file with the following content: { "unstable": ["sloppy-imports"] } in the root of my project.

This requirement is problematic for me since I use denols as the language server for all my TypeScript files, including those outside of Deno projects. Adding a deno.json file to non-Deno projects feels out of place.

Request
Could you either enable sloppy-imports by default or fix the issue where the configuration doesn’t pick it up? This change would greatly improve the usability of denols across various projects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly lsp related to the language server
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants