Skip to content

lsp: support for path aliases & auto-import? #10946

@MagicDuck

Description

@MagicDuck

hi, I am just in the process of trying out the snazzy deno LSP in an existing javascript project that builds with webpack and was wondering if deno lsp has support for path aliases in jsconfig.json (I tried with a tsconfig.json as well just in case). Here's my jsconfig.json:

{
  "compilerOptions": {
    "checkJs": true,
    "strict": false,
    "allowSyntheticDefaultImports": true,
    "module": "es6",
    "esModuleInterop": true,
    "moduleResolution": "node",
    "jsx": "preserve",
    "baseUrl": "./",
    "paths": {
      "actions/*": ["./src/actions/*"],
      "Application/*": ["./src/Application/*"],
      "animations/*": ["./src/animations/*"],
      "components/*": ["./src/components/*"],
      "history/*": ["./node_modules/history/*"],
      "hoc/*": ["./src/hoc/*"],
      "hooks/*": ["./src/hooks/*"],
      "IntlWrapper/*": ["./src/IntlWrapper/*"],
      "pages/*": ["./src/pages/*"],
      "reducers/*": ["./src/reducers/*"],
      "resources/*": ["./src/resources/*"],
      "selectors/*": ["./src/selectors/*"],
      "services/*": ["./src/services/*"],
      "store/*": ["./src/store/*"],
      "utils/*": ["./src/utils/*"],
      "xm-constants/*": ["./src/xm-constants/*"],
      "test/*": ["./test/*"],
      "xm-spark": ["./node_modules/xm-spark/dist/spark.bundle.js"],
      "xm-spark-table": ["./node_modules/xm-spark/dist/sparkTable.bundle.js"],
      "xm-spark-time": ["./node_modules/xm-spark/dist/sparkTime.bundle.js"]
    }
  },
  "include": ["src/**/*.js", "src/**/*.jsx"],
  "exclude": ["node_modules"]
}

When I tried it, I got the following (in neovim):
image

Not sure if there is some flag that needs to be set or if this functionality just doesn't exist yet...
Similarly I was wondering about auto-import code action and the like. I am trying to replace tsserver with deno, but I am not sure if I am misunderstanding deno at this point, maybe it doesn't even deal with node_modules...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions