Skip to content

Commit

Permalink
feat: add internalDebug config flag (#406)
Browse files Browse the repository at this point in the history
Also integrate upstream formatting changes in deno fmt.

Ref: denoland/deno#10368
  • Loading branch information
kitsonk committed May 11, 2021
1 parent 366f5c0 commit 006a67b
Show file tree
Hide file tree
Showing 16 changed files with 93 additions and 77 deletions.
4 changes: 1 addition & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,4 @@ If applicable, add screenshots to help explain your problem.

**Versions**

vscode: xxx
deno: xxx
extension: xxx
vscode: xxx deno: xxx extension: xxx
3 changes: 2 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ about: Suggest an idea for this project

**Is your feature request related to a problem? Please describe.**

A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
A clear and concise description of what the problem is. Ex. I'm always
frustrated when [...]

**Describe the solution you'd like**

Expand Down
40 changes: 20 additions & 20 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
// A launch configuration that compiles the extension and then opens it inside a new window
{
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"outFiles": [
"${workspaceRoot}/client/out/**/*.js"
],
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
}
]
}
"version": "0.2.0",
"configurations": [
{
"type": "extensionHost",
"request": "launch",
"name": "Launch Client",
"runtimeExecutable": "${execPath}",
"args": [
"--extensionDevelopmentPath=${workspaceRoot}"
],
"outFiles": [
"${workspaceRoot}/client/out/**/*.js"
],
"preLaunchTask": {
"type": "npm",
"script": "watch"
}
}
]
}
10 changes: 5 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"editor.insertSpaces": false,
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "./node_modules/typescript/lib",
"typescript.preferences.quoteStyle": "double",
}
"editor.insertSpaces": false,
"typescript.tsc.autoDetect": "off",
"typescript.tsdk": "./node_modules/typescript/lib",
"typescript.preferences.quoteStyle": "double"
}
64 changes: 32 additions & 32 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc"
]
},
{
"type": "npm",
"script": "watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
}
]
}
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "compile",
"group": "build",
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc"
]
},
{
"type": "npm",
"script": "watch",
"isBackground": true,
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"panel": "dedicated",
"reveal": "never"
},
"problemMatcher": [
"$tsc-watch"
]
}
]
}
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ extension has the following configuration options:
either be relative to the workspace, or an absolute path. _string, default
`null`, examples: `./import_map.json`, `/path/to/import_map.json`,
`C:\path\to\import_map.json`_
- `deno.internalDebug`: If enabled the Deno Language Server will log additional
internal diagnostic information.
- `deno.lint`: Controls if linting information will be provided by the Deno
Language Server. _boolean, default `false`_
- `deno.suggest.imports.hosts`: A map of domain hosts (origins) that are used
Expand Down
1 change: 1 addition & 0 deletions client/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ const workspaceSettingsKeys: Array<keyof Settings> = [
"codeLens",
"config",
"importMap",
"internalDebug",
"lint",
"suggest",
"unstable",
Expand Down
3 changes: 3 additions & 0 deletions client/src/interfaces.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export interface Settings {
enable: boolean;
/** A path to an import map that should be applied. */
importMap: string | null;
/** A flag that enables additional internal debug information to be printed
* to the _Deno Language Server_ output. */
internalDebug: boolean;
/** Determine if the extension should be providing linting diagnostics. */
lint: boolean;
suggest: {
Expand Down
4 changes: 2 additions & 2 deletions client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outDir": "out",
"rootDir": "src",
"sourceMap": true,
"strict": true,
"strict": true
},
"include": [
"src"
Expand All @@ -17,4 +17,4 @@
"node_modules",
".vscode-test"
]
}
}
16 changes: 8 additions & 8 deletions media/welcome.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright 2018-2021 the Deno authors. All rights reserved. MIT license.

(function () {
const vscode = acquireVsCodeApi();
const vscode = acquireVsCodeApi();

const commands = document.querySelectorAll('.Command');
for (const command of commands) {
const msg = JSON.parse(JSON.stringify(command.dataset));
command.addEventListener("click", () => {
vscode.postMessage(msg);
});
}
const commands = document.querySelectorAll(".Command");
for (const command of commands) {
const msg = JSON.parse(JSON.stringify(command.dataset));
command.addEventListener("click", () => {
vscode.postMessage(msg);
});
}
}());
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,16 @@
true,
false
]
},
"deno.internalDebug": {
"type": "boolean",
"default": false,
"markdownDescription": "Determines if the internal debugging information for the Deno language server will be logged to the _Deno Language Server_ console.",
"scope": "window",
"examples": [
true,
false
]
}
}
},
Expand All @@ -284,7 +294,7 @@
"scripts": {
"vscode:prepublish": "npm run compile",
"compile": "tsc -b",
"fmt": "deno fmt client/src typescript-deno-plugin/src docs README.md CHANGELOG.md",
"fmt": "deno fmt .vscode .github client/src media typescript-deno-plugin/src typescript-deno-plugin/*.md docs package.json tsconfig.json README.md CHANGELOG.md",
"lint": "deno lint --unstable client/src typescript-deno-plugin/src docs",
"watch": "tsc -b -w",
"postinstall": "cd typescript-deno-plugin && npm i && cd ../client && npm i && cd .."
Expand Down
2 changes: 1 addition & 1 deletion schemas/deno-import-intellisense.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,4 @@
}
}
}
}
}
2 changes: 1 addition & 1 deletion schemas/import_map.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@
}
}
}
}
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"outDir": "out",
"rootDir": "src",
"sourceMap": true,
"strict": true,
"strict": true
},
"include": [
"src"
Expand All @@ -25,4 +25,4 @@
"path": "./typescript-deno-plugin"
}
]
}
}
2 changes: 1 addition & 1 deletion typescript-deno-plugin/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# typescript-deno-plugin

The `typescript-deno-plugin` is a language service plugin for TypeScript. It is
loaded by the extension client. The main purpose of the plugin is to _disable_
loaded by the extension client. The main purpose of the plugin is to _disable_
parts of the built in TypeScript/JavaScript language server in Visual Studio
Code when Deno is enabled for a project, as language server information will be
obtained from the Deno CLI Language Server itself.
1 change: 1 addition & 0 deletions typescript-deno-plugin/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const defaultSettings: Settings = {
codeLens: null,
config: null,
importMap: null,
internalDebug: false,
lint: false,
suggest: {
autoImports: true,
Expand Down

0 comments on commit 006a67b

Please sign in to comment.