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

feat: add internalDebug config flag #406

Merged
merged 1 commit into from
May 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -117,6 +117,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 @@ -51,6 +51,7 @@ const settingsKeys: Array<keyof Settings> = [
"config",
"enable",
"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
2 changes: 1 addition & 1 deletion client/src/lsp_extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/** Contains extensions to the Language Server Protocol that are supported by
* the Deno Language Server.
*
*
* The requests and notifications types should mirror the Deno's CLI
* `cli/lsp/language_server.rs` under the method `request_else`.
*/
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);
});
}
}());
14 changes: 12 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,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 @@ -283,7 +293,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 All @@ -295,4 +305,4 @@
"@types/node": "^14.14.25",
"typescript": "^4.1.3"
}
}
}
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 @@ -31,6 +31,7 @@ const defaultSettings: Settings = {
codeLens: null,
config: null,
importMap: null,
internalDebug: false,
lint: false,
suggest: {
autoImports: true,
Expand Down