question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`deno.enablePaths` conflict with build in typescript language server.

See original GitHub issue

In other word, deno.enablePaths doesn’t disable default typescript language server from running specified path.

So both deno and typescript language server running on the same project…

Versions

deno 1.22.0 (release, x86_64-pc-windows-msvc)
v8 10.0.139.17
typescript 4.6.2

Vscode version:

Version: 1.67.2 (user setup)
Electron: 17.4.1
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.22000

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:9
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
WudsyWudsyWudsycommented, Jun 14, 2022

I have a similar issue to @nurmohammed840 and @ragrag on Windows 11 (and 10).

The issue is that both deno and typescript language servers are running on the same file, not project, and specifically how "deno.enabled" is being handled when "deno.enablePaths" is supplied.

Set up

OS: Windows 11 (22000.675) VS Code: 1.68.0 (user setup) Deno: 1.22.1 Deno VS Code Extension: v3.12.0

Current settings.json:

{
    "deno.enable": true,
    "deno.lint": true,
    "deno.unstable": false,
    "deno.enablePaths": [
        "./deno"
    ]
}

Folder structure:

test_project/
├─ .vscode/
│  ├─ settings.json
├─ deno/
│  ├─ deno_main.ts
├─ typescript/
   ├─ typescript_main.ts

Expected behavior

My understanding is that this set up should yield the following result:

deno_main.ts:

  • deno language server enabled
  • typescript language server disabled

typescript_main.ts:

  • deno language server disabled
  • typescript language server enabled

Observed outcome

What I am actually getting is:

deno_main.ts:

  • deno language server enabled
  • typescript language server disabled

typescript_main.ts:

  • deno language server disabled
  • typescript language server disabled <— Unexpected

In this case (where "deno.enable" is true) typescript language server is disabled on typescript_main.ts, despite me wanted it to be active.

If I change "deno.enable" to false I get the follow:

deno_main.ts:

  • deno language server enabled
  • typescript language server enabled <— Unexpected

typescript_main.ts:

  • deno language server disabled
  • typescript language server enabled

In this case (where "deno.enable" is false) both deno and typescript language servers are active on deno_main.ts, which causes conflicts.

Issue

It appears to me that the following is happening (on Windows 10 and 11):

  1. "deno.enablePaths" is correctly controlling what files and folders the deno language server is active on, however;
  2. "deno.enable" is not being ignored
    • if it is true, the typescript language server is disabled on all files in the project, regardless of if they are in the enabledPaths or not
    • if it is false, the typescript language server is enabled on all files in the project, regardless of if they are in the enabledPaths or not

Desired outcome

Desired outcome would be as follows:

  • "deno.enable" is ignored when "deno.enablePaths" is supplied
  • files and folder which deno language server in enabled on is unchanged from current implementation (i.e., enabled on those in "deno.enablePaths")
  • files and folder which are included in "deno.enablePaths" should have typescript language server disabled
  • files and folder which are not included in "deno.enablePaths" should have typescript language server enabled
3reactions
ragragcommented, Jun 6, 2022

Hello @kitsonk thank you for the follow up. Currently I have this configuration that is working as expected on macOs 12.1 but not on Windows 10

Current directory structure:

  .vscode/settings.json
  scripts
  services

I want Deno Language Server to only work for the scripts directory and ignore the services directory (which has node ts projects). the current configuration I have in settings.json is

{
    "deno.lint": true,
    "deno.unstable": true,
    "deno.enablePaths": ["./scripts"]
}

This current configuration works perfectly on macOs.

As for windows 10:

  • Files in scripts directory are still not detected by the Deno Language Server while files in services are picked up by the built-in Typescript Language Server. im assuming after many trials that deno.enablePaths effectively doesn’t do anything in this case
  • After adding "deno.enable" : true (which according to the docs should be ignored if deno.enablePaths is provided) the files in scripts are picked up by the Deno Language Server and the files in services are ignored. however they are not picked by the Typescript Language Server either (no errors but also no Intellisense). when I remove deno.enablePaths at this point they start to show errors since the Deno Language Server is not ignoring them anymore.

I hope that was not confusing, I will also be willing to do some screen recordings if that is necessary Also worth mentioning is that I have the latest versions of VS Code as well as the Deno extension

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview of the Language Server | Manual - Deno
This allows clients to access documents in the Deno cache, like remote modules and TypeScript library files built into Deno. The Deno language...
Read more >
How to Resolve LSPs for Deno Projects in Neovim
nvim-lspconfig allows me to configure, launch, and initialize various language servers I have on my machine. For my JavaScript and TypeScript ...
Read more >
Deno - Visual Studio Marketplace
Extension for Visual Studio Code - A language server client for Deno. ... the built-in VSCode JavaScript and TypeScript language services, ...
Read more >
Untitled
Vikings draft pick history, When were the pyramids built in mexico, 14hd403, ... Leclercville, Demo recording csgo, Speed networking example, Zatoichi 2003 ...
Read more >
Untitled
Best edinburgh guide book, Catholic church building plans, Fa geba ennigerloh, ... Dailyfix win, Plymouth ma post office long pond rd, Server 03...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found