Skip to content

deno.unstable Configuration Not Functioning as Expected #26223

Closed

Description

@jakubdonovan

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.

Activity

  1. added
    bugSomething isn't working correctly
    lsprelated to the language server
    on Oct 14, 2024
  2. self-assigned this
    on Oct 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working correctlylsprelated to the language server

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions