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

Linting in VS Code not working when using enableProjectDiagnostics #595

Closed
phifa opened this issue Dec 10, 2021 · 33 comments
Closed

Linting in VS Code not working when using enableProjectDiagnostics #595

phifa opened this issue Dec 10, 2021 · 33 comments

Comments

@phifa
Copy link

phifa commented Dec 10, 2021

I set up a simple deno project with only this file. But the linting is messed up. It looks like the default TypeScript language server is still parsing this file, even though I have installed the extension.

import { cron } from 'https://deno.land/x/[email protected]/cron.ts';
import { config } from 'https://deno.land/x/[email protected]/mod.ts';

console.log('cron initiated: ', new Date());

cron('*/5 * * * *', async () => {
  await fetch("bla")
});

My workspace settings:

{
  "deno.lint": true,
  "deno.unstable": true,
  "deno.enable": true
}

Bildschirmfoto 2021-12-10 um 11 33 20

Bildschirmfoto 2021-12-10 um 11 32 20

Bildschirmfoto 2021-12-10 um 11 32 51

@kitsonk
Copy link
Contributor

kitsonk commented Dec 10, 2021

What is the output of View | Output and then Deno Language Server and the top section from Deno: Language Server Status from the command palette.

@phifa
Copy link
Author

phifa commented Dec 11, 2021

Starting Deno language server...
  version: 1.15.3 (release, aarch64-apple-darwin)
  executable: /opt/homebrew/bin/deno
Connected to "Visual Studio Code - Insiders" 1.64.0-insider
language server initialized
Server ready.

@kitsonk

@kitsonk
Copy link
Contributor

kitsonk commented Dec 11, 2021

the top section from Deno: Language Server Status from the command palette

As well please.

@phifa
Copy link
Author

phifa commented Dec 13, 2021

Hey @kitsonk, sorry totally overread this.

Here it is:


# Deno Language Server Status

## Workspace Settings

```json
{
  "enable": true,
  "cache": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": true
  },
  "internalDebug": false,
  "lint": true,
  "suggest": {
    "completeFunctionCalls": false,
    "names": true,
    "paths": true,
    "autoImports": true,
    "imports": {
      "autoDiscover": true,
      "hosts": {}
    }
  },
  "unstable": true
}

Workspace Details

  • Documents in memory: 1
    • file:///Users/phil/deno/index.ts
  • Performance measures: 112
    • document_symbol (6ms)
    • request (5ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_action (2ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • update_diagnostics (2ms)
    • update_diagnostics_ts (2ms)
    • request (2ms)
    • update_diagnostics_deps (1ms)
    • update_diagnostics_lint (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • code_action (3ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (8ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (8ms)
    • request (7ms)
    • op_script_version (0ms)
    • folding_range (2ms)
    • request (1ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_highlight (2ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (26ms)
    • request (25ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (16ms)
    • request (13ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • did_open (0ms)
    • did_close (0ms)
    • update_diagnostics (0ms)
    • update_diagnostics_deps (0ms)
    • update_diagnostics_lint (0ms)
    • update_diagnostics_ts (0ms)
    • did_open (0ms)
    • did_close (0ms)
    • code_action (4ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • folding_range (47ms)
    • request (36ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (2096ms)
    • request (113ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • update_diagnostics (2182ms)
    • update_diagnostics_ts (2182ms)
    • request (2180ms)
    • get_line_index_sync (0ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_resolve (1ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • update_diagnostics_deps (151ms)
    • update_diagnostics_lint (151ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_resolve (0ms)
    • op_get_text (0ms)
    • op_get_length (1ms)
    • op_script_version (0ms)
    • did_open (41ms)
    • initialize (332ms)
    • update_registries (0ms)
    • update_import_map (0ms)
    • request (0ms)
    • update_tsconfig (319ms)
    • request (5ms)
    • update_cache (0ms)

Performance

Name Duration Count
code_action 424ms 5
code_lens 4ms 2
did_close 0ms 2
did_open 14ms 3
document_highlight 2ms 1
document_symbol 16ms 2
folding_range 25ms 2
get_line_index_sync 0ms 12
get_navigation_tree 4ms 2
initialize 332ms 1
op_get_length 0ms 5
op_get_text 0ms 5
op_resolve 0ms 2
op_script_version 0ms 37
request 160ms 15
update_cache 0ms 1
update_diagnostics 728ms 3
update_diagnostics_deps 51ms 3
update_diagnostics_lint 50ms 3
update_diagnostics_ts 728ms 3
update_import_map 0ms 1
update_registries 0ms 1
update_tsconfig 319ms 1

@kitsonk
Copy link
Contributor

kitsonk commented Dec 13, 2021

Ok, the only thing I can see here is that it is an insiders build, and that they may have made a change in 1.64 that breaks vscode_deno's ability to suppress the messages from the built in language server.

@phifa
Copy link
Author

phifa commented Dec 13, 2021

let me know if I can test anything or help further.

@kitsonk
Copy link
Contributor

kitsonk commented Dec 14, 2021

Try using a non-insiders version (1.63) on your machine and see if it works?

@phifa
Copy link
Author

phifa commented Dec 15, 2021

Same thing:

Starting Deno language server...
  version: 1.15.3 (release, aarch64-apple-darwin)
  executable: /opt/homebrew/bin/deno
Connected to "Visual Studio Code" 1.63.1
language server initialized
Server ready.

# Deno Language Server Status

## Workspace Settings

```json
{
  "enable": true,
  "cache": null,
  "config": null,
  "importMap": null,
  "codeLens": {
    "implementations": false,
    "references": false,
    "referencesAllFunctions": false,
    "test": true
  },
  "internalDebug": false,
  "lint": true,
  "suggest": {
    "completeFunctionCalls": false,
    "names": true,
    "paths": true,
    "autoImports": true,
    "imports": {
      "autoDiscover": true,
      "hosts": {}
    }
  },
  "unstable": true
}

Workspace Details

  • Documents in memory: 0
  • Performance measures: 453
    • update_diagnostics (0ms)
    • update_diagnostics_deps (0ms)
    • update_diagnostics_lint (0ms)
    • update_diagnostics_ts (0ms)
    • did_close (1ms)
    • did_change (0ms)
    • document_symbol (2ms)
    • request (2ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • hover (6ms)
    • request (6ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • virtual_text_document (0ms)
    • goto_definition (5ms)
    • get_line_index (0ms)
    • request (5ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (2ms)
    • request (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index (0ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_action (13ms)
    • request (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index (0ms)
    • request (11ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (0ms)
    • request (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (4ms)
    • request (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index (0ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (0ms)
    • virtual_text_document (0ms)
    • goto_definition (8ms)
    • get_line_index (0ms)
    • request (7ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (2ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (2ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (1ms)
    • request (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (1ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (1ms)
    • request (1ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • update_diagnostics (18ms)
    • update_diagnostics_ts (18ms)
    • request (18ms)
    • op_resolve (0ms)
    • op_dispose (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • update_diagnostics_deps (0ms)
    • update_diagnostics_lint (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • did_change (0ms)
    • code_action (9ms)
    • request (8ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (4ms)
    • request (3ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (2ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_highlight (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (3ms)
    • request (3ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (1ms)
    • request (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (1ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (1ms)
    • request (1ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • update_diagnostics (13ms)
    • update_diagnostics_ts (13ms)
    • request (13ms)
    • op_resolve (0ms)
    • op_dispose (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • update_diagnostics_deps (0ms)
    • op_script_version (0ms)
    • update_diagnostics_lint (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • did_change (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (18ms)
    • request (18ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (7ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (7ms)
    • request (1ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • update_diagnostics (27ms)
    • update_diagnostics_ts (26ms)
    • request (26ms)
    • update_diagnostics_deps (8ms)
    • update_diagnostics_lint (8ms)
    • op_resolve (0ms)
    • op_dispose (0ms)
    • op_get_change_range (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • did_change (7ms)
    • code_action (10ms)
    • request (9ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (3ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_highlight (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • hover (12ms)
    • request (11ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • goto_definition (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (3ms)
    • request (2ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (11ms)
    • request (10ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • document_symbol (2ms)
    • request (1ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • code_action (4ms)
    • request (3ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (2ms)
    • request (1ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • did_close (0ms)
    • did_open (0ms)
    • code_lens (0ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (0ms)
    • hover (1ms)
    • request (1ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_lens (1ms)
    • get_line_index_sync (0ms)
    • get_navigation_tree (1ms)
    • request (0ms)
    • op_script_version (0ms)
    • code_action (1ms)
    • request (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • document_symbol (14ms)
    • request (13ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • code_action (38ms)
    • request (37ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • op_script_version (0ms)
    • get_line_index_sync (0ms)
    • virtual_text_document (0ms)
    • update_diagnostics (2187ms)
    • update_diagnostics_ts (2186ms)
    • request (2185ms)
    • did_close (0ms)
    • did_open (0ms)
    • did_change_watched_files (0ms)
    • did_change_watched_files (0ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_resolve (1ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • op_script_version (0ms)
    • op_resolve (0ms)
    • op_get_text (0ms)
    • op_get_length (0ms)
    • update_diagnostics_deps (11ms)
    • update_diagnostics_lint (11ms)
    • op_script_version (0ms)
    • did_open (22ms)
    • initialize (514ms)
    • update_registries (0ms)
    • update_import_map (0ms)
    • request (1ms)
    • update_tsconfig (510ms)
    • request (3ms)
    • update_cache (0ms)

Performance

Name Duration Count
code_action 7ms 16
code_lens 0ms 20
did_change 2ms 4
did_change_watched_files 0ms 2
did_close 0ms 3
did_open 7ms 3
document_highlight 1ms 2
document_symbol 3ms 7
get_line_index 0ms 5
get_line_index_sync 0ms 61
get_navigation_tree 0ms 20
goto_definition 5ms 3
hover 3ms 14
initialize 514ms 1
op_dispose 0ms 3
op_get_change_range 0ms 6
op_get_length 0ms 14
op_get_text 0ms 8
op_resolve 0ms 5
op_script_version 0ms 175
request 45ms 54
update_cache 0ms 1
update_diagnostics 449ms 5
update_diagnostics_deps 4ms 5
update_diagnostics_lint 4ms 5
update_diagnostics_ts 449ms 5
update_import_map 0ms 1
update_registries 0ms 1
update_tsconfig 510ms 1
virtual_text_document 0ms 3

@Namekkural
Copy link

Hi,

I've got exactly the same issue. Is this going to be fixed?

@lucacasonato
Copy link
Member

Is this going to be fixed?

We have not figured out what the root cause is, and can not reproduce the issue without more information.

Could you both provide a list of all VS Code extensions you have installed?

@kitsonk kitsonk transferred this issue from denoland/deno Dec 16, 2021
@kitsonk
Copy link
Contributor

kitsonk commented Dec 16, 2021

I've moved the issue to vscode_deno, as built-in diagnostics appearing have nothing to do with the Deno CLI itself, but the suppression mechanism built into vscode_deno.

To be clear, these are environmental specific situations, where the supression mechanism is failing for a yet unidentified reason. I had thought that maybe the next release of vscode was breaking something in a way, but @phifa indicates that it is broken in their environment irrespective of insiders.

So it is really hard to say "I have exactly the same issue, when will be fixed" because there are potentially many contributing reasons and we have been unable to replicate it and the detailed information provided by @phifa is not revealing anything we wouldn't expect to be true and works in other environments.

If @phifa you want to dig a bit deeper, it gets a bit complex, with a TypeScript/JavaScript file open for a Deno enabled project, under the command pallet, run TypeScript: Open TS Server Log. Likely vscode will complain that the logging is not turned on. Choose to enable it, and quit and restart vscode (or use Developer: Reload Window). Once you have the log open, upload it somewhere and link to it in the issue. There should be some diagnostic message in there related to what typescript-deno-plugin which might provide some insight, but also quite detailed information on what is going on inside the built-in TypeScript language service and why we might not be able to supress the messages.

The most logical guess is that there is some other TypeScript plugin that is modifying the built-in typescript in a way that we can't suppress the messages.

@phifa
Copy link
Author

phifa commented Dec 17, 2021

So I did one thing, I restarted with extensions disabled, but it's the same thing:

Bildschirmfoto 2021-12-17 um 10 43 46

@phifa
Copy link
Author

phifa commented Dec 17, 2021

Here is the log @kitsonk

https://www.codepile.net/pile/VpZaqWLV

@kitsonk
Copy link
Contributor

kitsonk commented Dec 18, 2021

@phifa ok, that is interesting, basically the plugin that supresses the message from typescript is not being loaded or passed even. For example this is from a working version:

Info 2    [20:25:39.801] Arguments: /vscode/bin/linux-x64/899d46d82c4c95423fb7e10e68eba52050e30ba3/node /vscode/bin/linux-x64/899d46d82c4c95423fb7e10e68eba52050e30ba3/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /tmp/vscode-typescript1000/7f6409c00930ccae0b89/tscancellation-ef127da8994916ddd7e5.tmp* --logVerbosity verbose --logFile /home/vscode/.vscode-remote/data/logs/20211218T202533/exthost1/vscode.typescript-language-features/tsserver-log-ZQGIN1/tsserver.log --globalPlugins typescript-deno-plugin --pluginProbeLocations /home/vscode/.vscode-remote/extensions/denoland.vscode-deno-3.9.2 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation

And here is from the log file you provided:

Info 2    [10:55:59.800] Arguments: /Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron /Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName /var/folders/t0/56bhgsk57zdf9kkfz7tqnz3h0000gn/T/vscode-typescript501/15058d5203ee10f255e9/tscancellation-384cdaac7fb7aded7049.tmp* --logVerbosity verbose --logFile /Users/phil/Library/Application Support/Code - Insiders/logs/20211217T103355/exthost1/vscode.typescript-language-features/tsserver-log-4Mu4XM/tsserver.log --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation

You can see the following is missing:

--globalPlugins typescript-deno-plugin --pluginProbeLocations /home/vscode/.vscode-remote/extensions/denoland.vscode-deno-3.9.2

The extension registers itself with an API the vscode provides to load this plugin, and for some reason that seems to be going "wrong" in your environment. I don't know if there are extension "trust" issues at play, or something else. Are there any outputs in Log (Window) or Log (Extension Host) or Extension indicating any errors.

I will investigate if we get any sort of signal in the extension that the plugin can't be loaded, and then surface that in the client, because ultimately the inability to load the plugin is what is causing the built-in diagnostics to not be supressed.

@phifa
Copy link
Author

phifa commented Dec 20, 2021

wait. no, of course the plugin won't be loaded if I run vscode with ALL extensions disabled. I will do some manual testing without extensions.

@phifa
Copy link
Author

phifa commented Dec 20, 2021

@kitsonk so, now here is a new log output. VS Code with all extensions disabled, except deno:

https://gist.github.com/phifa/4ca8945535409964640900c680caa248

Looks like this line --globalPlugins typescript-deno-plugin is in there.

@kitsonk
Copy link
Contributor

kitsonk commented Dec 20, 2021

@phifa ok, it appears that for some reason, the configuration is not coming over for the plugin, which is why it isn't suppressing the diagnostics. For example, something like this is missing from the file:

Info 102  [00:26:23.017] request:
    {"seq":4,"type":"request","command":"configurePlugin","arguments":{"pluginName":"typescript-deno-plugin","configuration":{"enable":true}}}}

We do that here:

const languageFeatures = await extension.activate();
api = languageFeatures.getAPI(0);
assert(api, errorMessage);
const pluginSettings = getPluginSettings();
api.configurePlugin(EXTENSION_TS_PLUGIN, pluginSettings);

If that code would throw, it is supposed to complain with a popup giving the error message, which appears to not be working, so for some reason, that code is likely running but silently failing. I am at a loss though as to what could cause this to fail.

@phifa
Copy link
Author

phifa commented Dec 20, 2021

too bad, please let me know if I can assist further. I wonder how many people are having the same issue and how we could reproduce the issue.

@jespertheend
Copy link
Contributor

@phifa do you happen to have a jsconfig.json with "checkJs": true in your workspace?
I can reliably reproduce this with all extensions disabled except for Deno.

Here's a reduced test case: deno_with_checkjs.zip

@phifa
Copy link
Author

phifa commented Dec 27, 2021

@jespertheend no, as you see above in the screenshot, no additional files: #595 (comment)

@jespertheend
Copy link
Contributor

Do you have project diagnostics enabled? (typescript.tsserver.experimental.enableProjectDiagnostics) That also seems to trigger it for me.

@phifa
Copy link
Author

phifa commented Dec 27, 2021

@jespertheend YES! I think that might be it! @Namekkural maybe givve this a go!

@phifa
Copy link
Author

phifa commented Dec 27, 2021

{
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": true,
  "typescript.tsserver.experimental.enableProjectDiagnostics": false,
}

These are my workspace settings. This fixes it.

@jespertheend
Copy link
Contributor

Related: #437

Though I'm still having this issue as a result of an added jsconfig.json

@phifa phifa changed the title Linting in VS Code not working - still using default TypeScript language server? Linting in VS Code not working when using enableProjectDiagnostics Dec 27, 2021
@Namekkural
Copy link

Namekkural commented Dec 27, 2021

Thank you for looking into it!
I have tried a jsconfig.json with the contents that @phifa suggested.

Adding

{ "deno.enable": true, "deno.lint": true, "deno.unstable": true }

in the jsconfig.json instead of the workspace file fixes
"An async function or method in ES5/ES3 requires the 'Promise'"
but not the error regarding the imports.

Interestingly, adding or removing the line
"typescript.tsserver.experimental.enableProjectDiagnostics": false,
does not change anything.

@jespertheend
Copy link
Contributor

@Namekkural If you want the errors to disappear you have to make sure that both:

  • typescript.tsserver.experimental.enableProjectDiagnostics is set to false
  • and your project doesn't contain any jsconfig.json files.

The Deno.enable setting doesn't belong in your jsconfig.json file, but rather in .vscode/settings.json. Or you can globally disable project diagnostics from the vscode settings screen.

@phifa
Copy link
Author

phifa commented Feb 25, 2022

anything we can do to help fixing the issue? i really want to keep my enableProjectDiagnostics turned on.

@kitsonk
Copy link
Contributor

kitsonk commented Feb 25, 2022

Why do you want to turn it on for a Deno project? It is not useful in that context.

@jespertheend
Copy link
Contributor

@kitsonk I like getting early warnings and errors as I am typing. The reason why I prefer enabling project diagnostics over not enabling it, is that changing a file might make errors show up in other files. With project diagnostics enabled, the folders containing errors turn red and you immediately know you've done something wrong.
This is useful if, for instance, you have a helper file that is being used by multiple entry points. Running deno run a.js might not give you any type errors after you have changed something in shared.js, but running deno run b.js might. And unless you have project diagnostics enabled, you won't know about mistakes like these until you actually run all entry points that use shared.js.

@kitsonk
Copy link
Contributor

kitsonk commented Feb 26, 2022

Enabling project diagnostics for the built in TypeScript server does not enable the same feature for the Deno language server. If there is a desire for the same feature in the Deno language server, that would be a separate request.

This issue only covers the situation where someone has it enabled globally for the built in TypeScript language server, but has enabled Deno for a specifoc workspace. Currently the only workaround would be to disable the feature in the workspace, as it breaks the suppression mechanism of the Deno vscode extension.

@phifa
Copy link
Author

phifa commented Feb 26, 2022

i cannot get it to work... It does not seem possible to have a workspace with one folder a deno project and another folder with a typescript project and enable project diagnostics only for the typescript project. i can only enable it globally.

@antonymott
Copy link

Linting error not suppressed as of Oct 26, 2022, mentioned in this Astro Deno SSR adapter issue

@bartlomieju bartlomieju added bug Something isn't working high priority dx labels Jul 11, 2023
@bartlomieju bartlomieju mentioned this issue Jul 11, 2023
17 tasks
@nayeemrmn
Copy link
Collaborator

Tracked in #437.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants